GNU bug report logs - #62407
30.0.50; The command to run elixir-ls on Windows is `language_server.bat`

Previous Next

Package: emacs;

Reported by: 牟 桐 <mou.tong <at> outlook.com>

Date: Thu, 23 Mar 2023 16:16:01 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62407 in the body.
You can then email your comments to 62407 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#62407; Package emacs. (Thu, 23 Mar 2023 16:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 牟 桐 <mou.tong <at> outlook.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 23 Mar 2023 16:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 牟 桐 <mou.tong <at> outlook.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 30.0.50; The command to run elixir-ls on Windows is
 `language_server.bat`
Date: Thu, 23 Mar 2023 16:14:55 +0000
[Message part 1 (text/plain, inline)]
When I try to open an elixir file with eglot on Windows, eglot will
guess that I want to execute `language_server.sh`.  But on Windows, it
should be `language_server.bat`.

After I change the command manually, everything works fine.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62407; Package emacs. (Thu, 23 Mar 2023 19:30:02 GMT) Full text and rfc822 format available.

Message #8 received at 62407 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 牟 桐 <mou.tong <at> outlook.com>
Cc: 62407 <at> debbugs.gnu.org
Subject: Re: bug#62407: 30.0.50;
 The command to run elixir-ls on Windows is `language_server.bat`
Date: Thu, 23 Mar 2023 21:29:45 +0200
> From: 牟 桐 <mou.tong <at> outlook.com>
> Date: Thu, 23 Mar 2023 16:14:55 +0000
> 
> 
> When I try to open an elixir file with eglot on Windows, eglot will
> guess that I want to execute `language_server.sh`.  But on Windows, it
> should be `language_server.bat`.

I think it should depend on the shell that Emacs is using, not on the
system type.  What is the value of shell-file-name on that Windows
system?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62407; Package emacs. (Fri, 24 Mar 2023 02:26:02 GMT) Full text and rfc822 format available.

Message #11 received at 62407 <at> debbugs.gnu.org (full text, mbox):

From: 牟 桐 <mou.tong <at> outlook.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "62407 <at> debbugs.gnu.org" <62407 <at> debbugs.gnu.org>
Subject: bug#62407: 30.0.50; The command to run elixir-ls on Windows is
 `language_server.bat`
Date: Fri, 24 Mar 2023 02:22:44 +0000
> What is the value of shell-file-name on that Windows
> system?

It's `cmdproxy.exe` on Windows, after I changed it to `powershell.exe`
and `cmd.exe`, the eglot's guess stays the same. I guess that is because
eglot had hardcoded the result here:

https://github.com/emacs-mirror/emacs/blob/4566a0c6b825a18e6c065da0543b8b942b7db8df/lisp/progmodes/eglot.el#L224-L225

``` emacs-lisp-mode
((elixir-mode elixir-ts-mode heex-ts-mode)
 . ("language_server.sh"))
```



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62407; Package emacs. (Fri, 24 Mar 2023 06:36:01 GMT) Full text and rfc822 format available.

Message #14 received at 62407 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 牟 桐 <mou.tong <at> outlook.com>
Cc: 62407 <at> debbugs.gnu.org
Subject: Re: bug#62407: 30.0.50; The command to run elixir-ls on Windows is
 `language_server.bat`
Date: Fri, 24 Mar 2023 09:35:12 +0300
> From: 牟 桐 <mou.tong <at> outlook.com>
> CC: "62407 <at> debbugs.gnu.org" <62407 <at> debbugs.gnu.org>
> Date: Fri, 24 Mar 2023 02:22:44 +0000
> 
> 
> > What is the value of shell-file-name on that Windows
> > system?
> 
> It's `cmdproxy.exe` on Windows, after I changed it to `powershell.exe`
> and `cmd.exe`, the eglot's guess stays the same. I guess that is because
> eglot had hardcoded the result here:
> 
> https://github.com/emacs-mirror/emacs/blob/4566a0c6b825a18e6c065da0543b8b942b7db8df/lisp/progmodes/eglot.el#L224-L225
> 
> ``` emacs-lisp-mode
> ((elixir-mode elixir-ts-mode heex-ts-mode)
>  . ("language_server.sh"))
> ```

I'm not saying that the current code is correct, I'm just saying that
the condition to use language_server.bat should be based on the value
of shell-file-name, not on system-type, because some people use Bash
on Windows as well.

Btw, is language_server.bat part of that server's distribution, or did
you write the batch file yourself?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62407; Package emacs. (Fri, 24 Mar 2023 07:00:01 GMT) Full text and rfc822 format available.

Message #17 received at 62407 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 牟 桐 <mou.tong <at> outlook.com>
Cc: 62407 <at> debbugs.gnu.org
Subject: Re: bug#62407: 30.0.50; The command to run elixir-ls on Windows is
 `language_server.bat`
Date: Fri, 24 Mar 2023 09:57:00 +0300
> From: 牟 桐 <mou.tong <at> outlook.com>
> CC: "62407 <at> debbugs.gnu.org" <62407 <at> debbugs.gnu.org>
> Date: Fri, 24 Mar 2023 02:22:44 +0000
> 
> 
> > What is the value of shell-file-name on that Windows
> > system?
> 
> It's `cmdproxy.exe` on Windows, after I changed it to `powershell.exe`
> and `cmd.exe`, the eglot's guess stays the same. I guess that is because
> eglot had hardcoded the result here:
> 
> https://github.com/emacs-mirror/emacs/blob/4566a0c6b825a18e6c065da0543b8b942b7db8df/lisp/progmodes/eglot.el#L224-L225
> 
> ``` emacs-lisp-mode
> ((elixir-mode elixir-ts-mode heex-ts-mode)
>  . ("language_server.sh"))
> ```

Can you see if the patch below solves your problem?

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 058bcec..42793a1 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -222,7 +222,10 @@ eglot-server-programs
                                 (dart-mode . ("dart" "language-server"
                                               "--client-id" "emacs.eglot-dart"))
                                 ((elixir-mode elixir-ts-mode heex-ts-mode)
-                                 . ("language_server.sh"))
+                                 . ,(if (and (fboundp 'w32-shell-dos-semantics)
+                                             (w32-shell-dos-semantics))
+                                        "language_server.bat"
+                                      "language_server.sh"))
                                 (ada-mode . ("ada_language_server"))
                                 (scala-mode . ,(eglot-alternatives
                                                 '("metals" "metals-emacs")))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62407; Package emacs. (Fri, 24 Mar 2023 07:20:02 GMT) Full text and rfc822 format available.

Message #20 received at 62407 <at> debbugs.gnu.org (full text, mbox):

From: 牟 桐 <mou.tong <at> outlook.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "62407 <at> debbugs.gnu.org" <62407 <at> debbugs.gnu.org>
Subject: bug#62407: 30.0.50; The command to run elixir-ls on Windows is
 `language_server.bat`
Date: Fri, 24 Mar 2023 07:18:24 +0000
> because some people use Bash on Windows as well

Sorry, I haven’t considered that.

> Btw, is language_server.bat part of that server's distribution, or did you write the batch file yourself?

The former, `language_server.bat` is shipped with the distribution.

> Can you see if the patch below solves your problem?

It will raise an error, so I changed it like this, now it solves my problem:

    ((elixir-mode elixir-ts-mode heex-ts-mode)
     . ,(if (and (fboundp 'w32-shell-dos-semantics)
                 (w32-shell-dos-semantics))        
            '("language_server.bat")        
          '("language_server.sh")))         




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62407; Package emacs. (Fri, 24 Mar 2023 07:49:01 GMT) Full text and rfc822 format available.

Message #23 received at 62407 <at> debbugs.gnu.org (full text, mbox):

From: 牟 桐 <mou.tong <at> outlook.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "62407 <at> debbugs.gnu.org" <62407 <at> debbugs.gnu.org>
Subject: bug#62407: 30.0.50; The command to run elixir-ls on Windows is
 `language_server.bat`
Date: Fri, 24 Mar 2023 07:47:54 +0000
> 
>    ((elixir-mode elixir-ts-mode heex-ts-mode)
>     . ,(if (and (fboundp 'w32-shell-dos-semantics)
>                 (w32-shell-dos-semantics))        
>            '("language_server.bat")        
>          '("language_server.sh")))         
> 
> 
> 

BTW, elixir's lsp installed by brew on Mac is `elixir-ls`, a soft link
to `language_server.sh`.

I don't have a linux computer, so I don't know what the command is on
Linux.

Should we use a unified name in Eglot like `elixir-ls` (which is the
user's job to name their elixir's lsp), or keep using `language_server`,
which may leading to conflict on system wide.

I guess the best way to solve this is to let elixir-ls's dev rename
their release :)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62407; Package emacs. (Fri, 24 Mar 2023 11:42:02 GMT) Full text and rfc822 format available.

Message #26 received at 62407 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 牟 桐 <mou.tong <at> outlook.com>
Cc: 62407 <at> debbugs.gnu.org
Subject: Re: bug#62407: 30.0.50; The command to run elixir-ls on Windows is
 `language_server.bat`
Date: Fri, 24 Mar 2023 14:40:45 +0300
> From: 牟 桐 <mou.tong <at> outlook.com>
> CC: "62407 <at> debbugs.gnu.org" <62407 <at> debbugs.gnu.org>
> Date: Fri, 24 Mar 2023 07:47:54 +0000
> 
> 
> BTW, elixir's lsp installed by brew on Mac is `elixir-ls`, a soft link
> to `language_server.sh`.
> 
> I don't have a linux computer, so I don't know what the command is on
> Linux.
> 
> Should we use a unified name in Eglot like `elixir-ls` (which is the
> user's job to name their elixir's lsp), or keep using `language_server`,
> which may leading to conflict on system wide.
> 
> I guess the best way to solve this is to let elixir-ls's dev rename
> their release :)

I think we should invoke the server as the developers tell us.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62407; Package emacs. (Fri, 24 Mar 2023 15:30:02 GMT) Full text and rfc822 format available.

Message #29 received at 62407 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 牟 桐 <mou.tong <at> outlook.com>, João Távora <joaotavora <at> gmail.com>
Cc: 62407 <at> debbugs.gnu.org
Subject: Re: bug#62407: 30.0.50; The command to run elixir-ls on Windows is
 `language_server.bat`
Date: Fri, 24 Mar 2023 18:29:42 +0300
> From: 牟 桐 <mou.tong <at> outlook.com>
> CC: "62407 <at> debbugs.gnu.org" <62407 <at> debbugs.gnu.org>
> Date: Fri, 24 Mar 2023 07:18:24 +0000
> 
> > Btw, is language_server.bat part of that server's distribution, or did you write the batch file yourself?
> 
> The former, `language_server.bat` is shipped with the distribution.
> 
> > Can you see if the patch below solves your problem?
> 
> It will raise an error, so I changed it like this, now it solves my problem:
> 
>     ((elixir-mode elixir-ts-mode heex-ts-mode)
>      . ,(if (and (fboundp 'w32-shell-dos-semantics)
>                  (w32-shell-dos-semantics))        
>             '("language_server.bat")        
>           '("language_server.sh")))         

Right, sorry about that.

João, okay to install on the master branch?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62407; Package emacs. (Fri, 24 Mar 2023 16:09:02 GMT) Full text and rfc822 format available.

Message #32 received at 62407 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 62407 <at> debbugs.gnu.org, 牟 桐 <mou.tong <at> outlook.com>
Subject: Re: bug#62407: 30.0.50;
 The command to run elixir-ls on Windows is `language_server.bat`
Date: Fri, 24 Mar 2023 15:40:24 +0000
On Fri, Mar 24, 2023 at 3:29 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > From: 牟 桐 <mou.tong <at> outlook.com>
> > CC: "62407 <at> debbugs.gnu.org" <62407 <at> debbugs.gnu.org>
> > Date: Fri, 24 Mar 2023 07:18:24 +0000
> >
> > > Btw, is language_server.bat part of that server's distribution, or did you write the batch file yourself?
> >
> > The former, `language_server.bat` is shipped with the distribution.
> >
> > > Can you see if the patch below solves your problem?
> >
> > It will raise an error, so I changed it like this, now it solves my problem:
> >
> >     ((elixir-mode elixir-ts-mode heex-ts-mode)
> >      . ,(if (and (fboundp 'w32-shell-dos-semantics)
> >                  (w32-shell-dos-semantics))
> >             '("language_server.bat")
> >           '("language_server.sh")))
>
> Right, sorry about that.
>
> João, okay to install on the master branch?

OK.

João




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 24 Mar 2023 18:39:01 GMT) Full text and rfc822 format available.

Notification sent to 牟 桐 <mou.tong <at> outlook.com>:
bug acknowledged by developer. (Fri, 24 Mar 2023 18:39:01 GMT) Full text and rfc822 format available.

Message #37 received at 62407-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 62407-done <at> debbugs.gnu.org, mou.tong <at> outlook.com
Subject: Re: bug#62407: 30.0.50;
 The command to run elixir-ls on Windows is `language_server.bat`
Date: Fri, 24 Mar 2023 21:38:50 +0300
> From: João Távora <joaotavora <at> gmail.com>
> Date: Fri, 24 Mar 2023 15:40:24 +0000
> Cc: 牟 桐 <mou.tong <at> outlook.com>, 62407 <at> debbugs.gnu.org
> 
> On Fri, Mar 24, 2023 at 3:29 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> >
> > > From: 牟 桐 <mou.tong <at> outlook.com>
> > > CC: "62407 <at> debbugs.gnu.org" <62407 <at> debbugs.gnu.org>
> > > Date: Fri, 24 Mar 2023 07:18:24 +0000
> > >
> > > > Btw, is language_server.bat part of that server's distribution, or did you write the batch file yourself?
> > >
> > > The former, `language_server.bat` is shipped with the distribution.
> > >
> > > > Can you see if the patch below solves your problem?
> > >
> > > It will raise an error, so I changed it like this, now it solves my problem:
> > >
> > >     ((elixir-mode elixir-ts-mode heex-ts-mode)
> > >      . ,(if (and (fboundp 'w32-shell-dos-semantics)
> > >                  (w32-shell-dos-semantics))
> > >             '("language_server.bat")
> > >           '("language_server.sh")))
> >
> > Right, sorry about that.
> >
> > João, okay to install on the master branch?
> 
> OK.

Thanks, installed, and closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 22 Apr 2023 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 363 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.