sublimelsp / LSP-ruff

LSP helper for ruff - an extremely fast Python linter, written in Rust.
https://packagecontrol.io/packages/LSP-ruff
MIT License
38 stars 4 forks source link

refactor: use ruff as the server #58

Closed jfcherng closed 4 months ago

jfcherng commented 7 months ago

Proposal

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

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.

The current latest ruff release can be found on https://github.com/astral-sh/ruff/releases/latest

jfcherng commented 7 months ago

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.

rchl commented 7 months ago

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.

jfcherng commented 7 months ago

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

rchl commented 7 months ago

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

jfcherng commented 7 months ago

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...

LDAP commented 7 months ago

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

jfcherng commented 6 months ago

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

jfcherng commented 4 months ago

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 commented 4 months ago

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