]> git.eshelyaron.com Git - emacs.git/commitdiff
Eglot: Add ruff-lsp as an alternative Python server
authorNiall Dooley <dooleyn@gmail.com>
Fri, 24 Nov 2023 15:52:36 +0000 (16:52 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 16 Dec 2023 19:15:25 +0000 (20:15 +0100)
ruff-lsp [1] is an LSP server for Ruff [2], [3], a fast Python linter
and code formatter.

It supports surfacing Ruff diagnostics and providing Code Actions to
fix them, but is intended to be used alongside another Python LSP in
order to support features like navigation and autocompletion.

[1]: https://github.com/astral-sh/ruff-lsp
[2]: https://github.com/astral-sh/ruff
[3]: https://docs.astral.sh/ruff/

* lisp/progmodes/eglot.el (eglot-server-programs): Add ruff-lsp.

Copyright-paperwork-exempt: yes
(cherry picked from commit 6b6e770a1f55da0580706c7ec21a409437d19ab4)

lisp/progmodes/eglot.el

index 51d2dd74e2b408b5d6f399a1756ae6336ad17ae0..6e43cc2b01c205f68f21bb8f484cd62aa74c43da 100644 (file)
@@ -216,7 +216,7 @@ chosen (interactively or automatically)."
                                 (vimrc-mode . ("vim-language-server" "--stdio"))
                                 ((python-mode python-ts-mode)
                                  . ,(eglot-alternatives
-                                     '("pylsp" "pyls" ("pyright-langserver" "--stdio") "jedi-language-server")))
+                                     '("pylsp" "pyls" ("pyright-langserver" "--stdio") "jedi-language-server" "ruff-lsp")))
                                 ((js-json-mode json-mode json-ts-mode)
                                  . ,(eglot-alternatives '(("vscode-json-language-server" "--stdio")
                                                           ("vscode-json-languageserver" "--stdio")