Subject: bug#61312: closed (Re: bug#61312: Patch for eglot: scala LSP binary name)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 09 Feb 2023 10:19:02 +0000

Your bug report

#61312: Patch for eglot: scala LSP binary name

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
61312: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61312
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#61312: Patch for eglot: scala LSP binary name
From: Eli Zaretskii <[email-masked]>
To: João Távora <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Thu, 09 Feb 2023 12:18:12 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: João Távora <[email-masked]>
> Date: Mon, 6 Feb 2023 18:45:39 +0000
> Cc: skykanin <[email-masked]>, [email-masked]
> 
> 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.

Subject: Patch for eglot: scala LSP binary name
From: skykanin <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Sun, 05 Feb 2023 21:15:48 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

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"))
```

From 215d54ff5ee3352bcda01d88d7a167925cd8dbeb Mon Sep 17 00:00:00 2001
From: skykanin <[email-masked]>
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