LSP-ruff icon indicating copy to clipboard operation
LSP-ruff copied to clipboard

refactor: use ruff as the server

Open jfcherng opened this issue 1 year ago • 6 comments

I am not going to keep tracking the latest ruff release in this PR. Remember to update the version number if you are going to merge this PR.

As of ruff v0.4.0, it can be used as a LSP server. We no longer need the ruff-lsp Python wrapper. Plus, ruff is even faster than ruff-lsp, obviously.

ref: https://github.com/astral-sh/ruff/releases/tag/v0.4.0

jfcherng avatar Apr 19 '24 02:04 jfcherng

This PR doesn't do the following.


Technically, python and pip are not required if we use $ ruff server --preview command to run the server. That means LSP-ruff doesn't have to inherit PipClientHandler. ruff binary can be downloaded from its GitHub releases. The downside would be that the dependabot doesn't seem able to monitor the version change for new GitHub releases (or does it?). People can subscribe to ruff releases on GitHub though.

I can spend some time to refactor this but before that I want to make sure that we are interested in this.

I think it makes sense to assume people who use ruff (write python) have python installed on their machine. And likely so does pip.

jfcherng avatar Apr 19 '24 02:04 jfcherng

The changelog says that it's in alpha which makes me want to wait with switching to it since there might be potentially missing features or have bugs to iron out.

rchl avatar Apr 19 '24 07:04 rchl

Fine. I will use it in my daily work to see if there is a critical bug.

jfcherng avatar Apr 19 '24 07:04 jfcherng

BTW. We have github actions that can monitor github releases (used in LSP-rust-analyzer for example)

rchl avatar Apr 19 '24 07:04 rchl

BTW. We have github actions that can monitor github releases (used in LSP-rust-analyzer for example)

Thanks for the info. I am pretty sure that is what I was looking for repositories I forgot...

jfcherng avatar Apr 19 '24 07:04 jfcherng

I have one for LSP-clangd too https://github.com/sublimelsp/LSP-clangd/blob/main/.github/workflows/update_check.yaml

LDAP avatar Apr 19 '24 08:04 LDAP

ruff as a LSP server is in beta stage: https://github.com/astral-sh/ruff/releases/tag/v0.4.5

jfcherng avatar May 23 '24 07:05 jfcherng

https://github.com/astral-sh/ruff/releases/tag/0.5.3

Ruff 0.5.3 marks the stable release of the Ruff language server and introduces revamped documentation, including setup guides for your editor of choice and the language server itself.

jfcherng avatar Jul 18 '24 17:07 jfcherng

I saw now that there are some setting changes: docs.astral.sh/ruff/editors/migration

Will you handle that or do you want someone to take over?

done

jfcherng avatar Jul 22 '24 12:07 jfcherng