bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67441: [PATCH] eglot: Add ruff-lsp as an alternative python server


From: Stefan Kangas
Subject: bug#67441: [PATCH] eglot: Add ruff-lsp as an alternative python server
Date: Thu, 14 Dec 2023 17:22:29 -0800

Niall Dooley <dooleyn@gmail.com> writes:

> ruff-lsp [1] is a Language Server Protocol implementation for Ruff [2,
> 3], an extremely fast Python linter and code formatter, written in
> Rust.
>
> 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/

João, any comments here?  Does eglot support running more than one LSP
server at the same time?

AFAICT, pylsp (for example) has built-in support for ruff, so while I'm
sure there's a use case for ruff-lsp, I don't think I currently
understand it.

In any case, I think the patch seems harmless enough, and could probably
be installed as-is.

> ---
>  lisp/progmodes/eglot.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
> index 48ea33c3ee1..d7d91bddb01 100644
> --- a/lisp/progmodes/eglot.el
> +++ b/lisp/progmodes/eglot.el
> @@ -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")
> --
> 2.30.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]