sublimelsp / LSP-ruff

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

refactor: use ruff as the server #58

Open jfcherng opened 2 months ago

jfcherng commented 2 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 2 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 2 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 2 months ago

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

rchl commented 2 months ago

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

jfcherng commented 2 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 2 months ago

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

jfcherng commented 1 month ago

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