* bug#61312: Patch for eglot: scala LSP binary name
@ 2023-02-05 21:15 skykanin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-06 15:46 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: skykanin via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-02-05 21:15 UTC (permalink / raw)
To: 61312
[-- Attachment #1: Type: text/plain, Size: 447 bytes --]
Hello,
It seems that eglot expects the scala metals LSP server binary to be named `metals-emacs` instead of `metals`. The included patch fixes this behaviour. At least in the nix package manager the `metals` binary is simply call 'metals'. However if other package managers distribute an alias for the binary as 'metals-emacs' as well we could instead do something like:
```
(scala-mode . ,(eglot-alternatives '("metals" "metals-emacs"))
```
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Patch-eglot-scala-LSP-server-binary-name.patch --]
[-- Type: text/x-patch; name=0001-Patch-eglot-scala-LSP-server-binary-name.patch, Size: 1225 bytes --]
From 215d54ff5ee3352bcda01d88d7a167925cd8dbeb Mon Sep 17 00:00:00 2001
From: skykanin <3789764+skykanin@users.noreply.github.com>
Date: Sun, 5 Feb 2023 21:41:19 +0100
Subject: [PATCH] Patch eglot scala LSP server binary name
Ensure that eglot picks up the correct
binary name for the scala metals LSP server.
---
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 4fa886bc78..ca025cf7d8 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -221,7 +221,7 @@ chosen (interactively or automatically)."
"--client-id" "emacs.eglot-dart"))
(elixir-mode . ("language_server.sh"))
(ada-mode . ("ada_language_server"))
- (scala-mode . ("metals-emacs"))
+ (scala-mode . ("metals"))
(racket-mode . ("racket" "-l" "racket-langserver"))
((tex-mode context-mode texinfo-mode bibtex-mode)
. ,(eglot-alternatives '("digestif" "texlab")))
--
2.39.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#61312: Patch for eglot: scala LSP binary name
2023-02-05 21:15 bug#61312: Patch for eglot: scala LSP binary name skykanin via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-02-06 15:46 ` Eli Zaretskii
2023-02-06 18:45 ` João Távora
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2023-02-06 15:46 UTC (permalink / raw)
To: skykanin, João Távora; +Cc: 61312
> Date: Sun, 05 Feb 2023 21:15:48 +0000
> From: skykanin via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> It seems that eglot expects the scala metals LSP server binary to be named `metals-emacs` instead of `metals`. The included patch fixes this behaviour. At least in the nix package manager the `metals` binary is simply call 'metals'. However if other package managers distribute an alias for the binary as 'metals-emacs' as well we could instead do something like:
> ```
> (scala-mode . ,(eglot-alternatives '("metals" "metals-emacs"))
> ```
Looking at this site:
https://github.com/rossabaker/lsp-scala
I see this:
(defcustom lsp-scala-server-command "metals-emacs"
"The command to launch the Scala language server."
:group 'lsp-scala
:type 'file)
So maybe we do need to support both names.
João, WDYT?
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#61312: Patch for eglot: scala LSP binary name
2023-02-06 15:46 ` Eli Zaretskii
@ 2023-02-06 18:45 ` João Távora
2023-02-09 10:18 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: João Távora @ 2023-02-06 18:45 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 61312, skykanin
[-- Attachment #1: Type: text/plain, Size: 724 bytes --]
Hi, Eli,
As usual, I defer this decision to you. I think it's reasonable to
support both names, and I also think it's reasonable to stick to
just the one we think is most used or representative of the
program.
In this case, I think "metals-emacs" is a contradiction of LSP's
stated goal, which is to have editor-agnostic servers. But I
don't know what the reasons were for doing this, I haven't
investigated.
It would be even more reasonable, I think, if distributions
settled -- or mostly settled - on names for their binaries they
distribute, much like *nix toolchains do. Of course we do not
control that process, but maybe we could influence it instead
of being constantly influenced by it.
João
[-- Attachment #2: Type: text/html, Size: 1011 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#61312: Patch for eglot: scala LSP binary name
2023-02-06 18:45 ` João Távora
@ 2023-02-09 10:18 ` Eli Zaretskii
0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2023-02-09 10:18 UTC (permalink / raw)
To: João Távora; +Cc: 61312-done, skykanin
> From: João Távora <joaotavora@gmail.com>
> Date: Mon, 6 Feb 2023 18:45:39 +0000
> Cc: skykanin <skykanin@proton.me>, 61312@debbugs.gnu.org
>
> As usual, I defer this decision to you. I think it's reasonable to
> support both names, and I also think it's reasonable to stick to
> just the one we think is most used or representative of the
> program.
>
> In this case, I think "metals-emacs" is a contradiction of LSP's
> stated goal, which is to have editor-agnostic servers. But I
> don't know what the reasons were for doing this, I haven't
> investigated.
>
> It would be even more reasonable, I think, if distributions
> settled -- or mostly settled - on names for their binaries they
> distribute, much like *nix toolchains do. Of course we do not
> control that process, but maybe we could influence it instead
> of being constantly influenced by it.
Thanks, I went with supporting both names in Emacs 29. I cannot see
any harm in supporting both, once "metals" is the first name to check.
With that, I'm closing this bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-09 10:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-05 21:15 bug#61312: Patch for eglot: scala LSP binary name skykanin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-06 15:46 ` Eli Zaretskii
2023-02-06 18:45 ` João Távora
2023-02-09 10:18 ` Eli Zaretskii
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).