unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67441: [PATCH] eglot: Add ruff-lsp as an alternative python server
@ 2023-11-24 15:52 Niall Dooley
  2023-12-15  1:22 ` Stefan Kangas
  0 siblings, 1 reply; 4+ messages in thread
From: Niall Dooley @ 2023-11-24 15:52 UTC (permalink / raw)
  To: 67441; +Cc: Niall Dooley

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






^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#67441: [PATCH] eglot: Add ruff-lsp as an alternative python server
  2023-11-24 15:52 bug#67441: [PATCH] eglot: Add ruff-lsp as an alternative python server Niall Dooley
@ 2023-12-15  1:22 ` Stefan Kangas
  2023-12-15  1:29   ` João Távora
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Kangas @ 2023-12-15  1:22 UTC (permalink / raw)
  To: Niall Dooley, 67441; +Cc: João Távora

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#67441: [PATCH] eglot: Add ruff-lsp as an alternative python server
  2023-12-15  1:22 ` Stefan Kangas
@ 2023-12-15  1:29   ` João Távora
  2023-12-16 11:12     ` Stefan Kangas
  0 siblings, 1 reply; 4+ messages in thread
From: João Távora @ 2023-12-15  1:29 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Niall Dooley, 67441

On Fri, Dec 15, 2023 at 1:22 AM Stefan Kangas <stefankangas@gmail.com> wrote:
>
> 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?

No.  This is the same question of Eli, who phrased it "alongside".

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

Me neither.  The fact that some language servers (pylsp, clangd) already
do what the hypothetical Eglot feature for running servers alongside each
other would do, is also the main reason why that feature has lost some
(definitely not all) of its relevance.

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

Agree.  Install at will.

João





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#67441: [PATCH] eglot: Add ruff-lsp as an alternative python server
  2023-12-15  1:29   ` João Távora
@ 2023-12-16 11:12     ` Stefan Kangas
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Kangas @ 2023-12-16 11:12 UTC (permalink / raw)
  To: João Távora; +Cc: Niall Dooley, 67441-done

Version: 29.2

João Távora <joaotavora@gmail.com> writes:

> Install at will.

Thanks, done.  I'm therefore closing this bug report.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-16 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-24 15:52 bug#67441: [PATCH] eglot: Add ruff-lsp as an alternative python server Niall Dooley
2023-12-15  1:22 ` Stefan Kangas
2023-12-15  1:29   ` João Távora
2023-12-16 11:12     ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).