GNU bug report logs - #67150
eglot with typescript language server >= 4.1.0

Previous Next

Package: emacs;

Reported by: Rajeev N <contact <at> sivalik.com>

Date: Mon, 13 Nov 2023 15:26:01 UTC

Severity: normal

Done: João Távora <joaotavora <at> gmail.com>

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 67150 in the body.
You can then email your comments to 67150 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#67150; Package emacs. (Mon, 13 Nov 2023 15:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Rajeev N <contact <at> sivalik.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 13 Nov 2023 15:26:02 GMT) Full text and rfc822 format available.

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

From: Rajeev N <contact <at> sivalik.com>
To: bug-gnu-emacs <at> gnu.org
Subject: eglot with typescript language server >= 4.1.0
Date: Mon, 13 Nov 2023 11:29:06 +0000
[Message part 1 (text/plain, inline)]
typescript language server didOpen fails for .tsx with "Cannot open document"

- https://github.com/typescript-language-server/typescript-language-server/issues/794
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67150; Package emacs. (Mon, 13 Nov 2023 16:39:02 GMT) Full text and rfc822 format available.

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

From: João Távora <joaotavora <at> gmail.com>
To: Rajeev N <contact <at> sivalik.com>
Cc: 67150 <at> debbugs.gnu.org
Subject: Re: bug#67150: eglot with typescript language server >= 4.1.0
Date: Mon, 13 Nov 2023 16:37:35 +0000
Hello Rajeev,

You need to provide more information about this problem.

See https://joaotavora.github.io/eglot/#Troubleshooting-Eglot

I read that thread and the server author thinks is it "likely"
that Eglot sent the wrong language ID.  That may be, but even if so,
there may be many reasons why it happened.

From what I can tell in the code, the language id for .tsx files in tsx-mode
or tsx-ts-mode is correctly calculated.

But I don't even know what version of Emacs you have,  what your
configuration is, etc...  All these things are described in the link above.

João

On Mon, Nov 13, 2023 at 3:25 PM Rajeev N via Bug reports for GNU
Emacs, the Swiss army knife of text editors <bug-gnu-emacs <at> gnu.org>
wrote:
>
> typescript language server didOpen fails for .tsx with "Cannot open document"
>
> https://github.com/typescript-language-server/typescript-language-server/issues/794



-- 
João Távora




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67150; Package emacs. (Mon, 13 Nov 2023 16:51:01 GMT) Full text and rfc822 format available.

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

From: João Távora <joaotavora <at> gmail.com>
To: Rajeev N <contact <at> sivalik.com>
Cc: 67150 <at> debbugs.gnu.org
Subject: Re: bug#67150: eglot with typescript language server >= 4.1.0
Date: Mon, 13 Nov 2023 16:49:32 +0000
On Mon, Nov 13, 2023 at 4:42 PM Rajeev N <contact <at> sivalik.com> wrote:
>
> I am running the latest stable branch of emacs with the latest eglot from stable.

I'm sorry I don't know what "latest eglot from stable" is.

M-x emacs-version and the contents of the Version: header in the eglot.el
file are what's needed usually.

> The following fixed the issue for me.
>
> (add-to-list 'eglot-server-programs
>              `(((js-mode :language-id "javascript")
>                 (js-ts-mode :language-id "javascript")
>                 (tsx-ts-mode  :language-id "typescriptreact")
>                 typescript-ts-mode typescript-mode)
>                .
>                ("typescript-language-server" "--stdio")))

Oh, so "tsx" is not a valid language ID?  For this particular
server, this particular server version, or universally?
How the heck are clients supposed  to know that?

IOW where did you glean this information about language ids from?

Anyway, I think your modification makes sense regardless.

João




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67150; Package emacs. (Mon, 13 Nov 2023 17:15:02 GMT) Full text and rfc822 format available.

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

From: Rajeev N <contact <at> sivalik.com>
To: João Távora <joaotavora <at> gmail.com>
Cc: 67150 <at> debbugs.gnu.org
Subject: Re: bug#67150: eglot with typescript language server >= 4.1.0
Date: Mon, 13 Nov 2023 16:42:11 +0000
[Message part 1 (text/plain, inline)]
I am running the latest stable branch of emacs with the latest eglot from stable.

The following fixed the issue for me.

#+begin_src elisp
(add-to-list 'eglot-server-programs
             `(((js-mode :language-id "javascript")
		(js-ts-mode :language-id "javascript")
		(tsx-ts-mode  :language-id "typescriptreact")
		typescript-ts-mode typescript-mode)
               .
               ("typescript-language-server" "--stdio")))
#+end_src
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67150; Package emacs. (Mon, 13 Nov 2023 17:15:02 GMT) Full text and rfc822 format available.

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

From: Rajeev N <contact <at> sivalik.com>
To: João Távora <joaotavora <at> gmail.com>
Cc: 67150 <at> debbugs.gnu.org
Subject: Re: bug#67150: eglot with typescript language server >= 4.1.0
Date: Mon, 13 Nov 2023 16:57:49 +0000
[Message part 1 (text/plain, inline)]
GNU Emacs 29.1.90 (build 7, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2023-11-10

;;; eglot.el --- Version: 1.15

I got the info about language Ids from:

 https://github.com/typescript-language-server/typescript-language-server/issues/794#issuecomment-1807613575

Best,
[Message part 2 (text/html, inline)]

Reply sent to João Távora <joaotavora <at> gmail.com>:
You have taken responsibility. (Tue, 14 Nov 2023 00:11:02 GMT) Full text and rfc822 format available.

Notification sent to Rajeev N <contact <at> sivalik.com>:
bug acknowledged by developer. (Tue, 14 Nov 2023 00:11:02 GMT) Full text and rfc822 format available.

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

From: João Távora <joaotavora <at> gmail.com>
To: Rajeev N <contact <at> sivalik.com>, 67150-done <at> debbugs.gnu.org
Subject: Re: bug#67150: eglot with typescript language server >= 4.1.0
Date: Tue, 14 Nov 2023 00:12:24 +0000
[Message part 1 (text/plain, inline)]
On Mon, Nov 13, 2023 at 4:57 PM Rajeev N <contact <at> sivalik.com> wrote:

> GNU Emacs 29.1.90 (build 7, x8664-pc-linux-gnu, GTK+ Version 3.24.38,
> cairo version 1.16.0) of 2023-11-10
>
> ;;; eglot.el — Version: 1.15
>
> I got the info about language Ids from:
>
>
> https://github.com/typescript-language-server/typescript-language-server/issues/794#issuecomment-1807613575
>

Thanks.  In the meantime I asked the server author some questions and
it seems the change has been rolled back, with the server accepting
the old language-ids again.  But I've pushed the change to eglot.el
anyway.  I think this bug can be closed, but let me know if you
disagree.

João
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67150; Package emacs. (Tue, 14 Nov 2023 12:09:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 67150 <at> debbugs.gnu.org, contact <at> sivalik.com
Subject: Re: bug#67150: eglot with typescript language server >= 4.1.0
Date: Tue, 14 Nov 2023 14:07:05 +0200
> Resent-To: bug-gnu-emacs <at> gnu.org
> From: João Távora <joaotavora <at> gmail.com>
> Date: Tue, 14 Nov 2023 00:12:24 +0000
> 
> Thanks.  In the meantime I asked the server author some questions and
> it seems the change has been rolled back, with the server accepting 
> the old language-ids again.  But I've pushed the change to eglot.el
> anyway.  I think this bug can be closed, but let me know if you 
> disagree.

Any reasons not to backport this to the emacs-29 branch?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67150; Package emacs. (Tue, 14 Nov 2023 12:21:02 GMT) Full text and rfc822 format available.

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

From: João Távora <joaotavora <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 67150 <at> debbugs.gnu.org, contact <at> sivalik.com
Subject: Re: bug#67150: eglot with typescript language server >= 4.1.0
Date: Tue, 14 Nov 2023 12:19:15 +0000
On Tue, Nov 14, 2023 at 12:07 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > Resent-To: bug-gnu-emacs <at> gnu.org
> > From: João Távora <joaotavora <at> gmail.com>
> > Date: Tue, 14 Nov 2023 00:12:24 +0000
> >
> > Thanks.  In the meantime I asked the server author some questions and
> > it seems the change has been rolled back, with the server accepting
> > the old language-ids again.  But I've pushed the change to eglot.el
> > anyway.  I think this bug can be closed, but let me know if you
> > disagree.
>
> Any reasons not to backport this to the emacs-29 branch?

No, go right ahead, though this isn't really a bug,
people will probably want to update Eglot from ELPA, and the
language server author has reverted the breaking change
as well.

Anyway I forget the emacs-29 is still a thing.  Are bugfixes _always_
to go release branch N-1 if they are applicable there (where N is
whatever master is going to become).  Was it always so?

João




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67150; Package emacs. (Tue, 14 Nov 2023 14:30:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 67150 <at> debbugs.gnu.org, contact <at> sivalik.com
Subject: Re: bug#67150: eglot with typescript language server >= 4.1.0
Date: Tue, 14 Nov 2023 16:28:56 +0200
> From: João Távora <joaotavora <at> gmail.com>
> Date: Tue, 14 Nov 2023 12:19:15 +0000
> Cc: 67150 <at> debbugs.gnu.org, contact <at> sivalik.com
> 
> On Tue, Nov 14, 2023 at 12:07 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> >
> > Any reasons not to backport this to the emacs-29 branch?
> 
> No, go right ahead, though this isn't really a bug,
> people will probably want to update Eglot from ELPA, and the
> language server author has reverted the breaking change
> as well.

Done.

> Anyway I forget the emacs-29 is still a thing.  Are bugfixes _always_
> to go release branch N-1 if they are applicable there (where N is
> whatever master is going to become).  Was it always so?

In general, yes, but the bugfix should be safe enough, or the bug
grave enough, to be eligible for the release branch after N.1 version
was released.  If in doubt, please ask.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67150; Package emacs. (Wed, 15 Nov 2023 15:44:04 GMT) Full text and rfc822 format available.

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

From: João Távora <joaotavora <at> gmail.com>
To: Simon Pugnet <simon <at> polaris64.net>
Cc: 67150 <at> debbugs.gnu.org, contact <at> sivalik.com
Subject: Re: bug#67150: eglot with typescript language server >= 4.1.0
Date: Wed, 15 Nov 2023 10:18:56 +0000
On Wed, Nov 15, 2023 at 9:51 AM Simon Pugnet <simon <at> polaris64.net> wrote:
>
> > Thanks.  In the meantime I asked the server author some questions and
> > it seems the change has been rolled back, with the server accepting
> > the old language-ids again.  But I've pushed the change to eglot.el
> > anyway.  I think this bug can be closed, but let me know if you
> > disagree.
>
> I'm not sure if this fix is correct. In the documentation for
> `eglot-server-programs' it says: -
>
> * A list (MAJOR-MODE-SYMBOL :LANGUAGE-ID ID) where
>   MAJOR-MODE-SYMBOL is the aforementioned symbol and ID is a
>   string identifying the language to the server;
>
> However the commit 260ba357bbe3e6faaadb20d998107c11fab40aa5 sets the
> `:language-id' to symbols. So I think these should be strings instead,
> e.g. "javascript".

Yup, that was a mistake, guess I should have tested, but I don't
have this language server.  Keywords would probably work too,
but I fixed them to strings as you suggest.  Pushed to master
and cherry-picked to emacs-29.

João




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67150; Package emacs. (Wed, 15 Nov 2023 15:48:01 GMT) Full text and rfc822 format available.

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

From: Simon Pugnet <simon <at> polaris64.net>
To: 67150 <at> debbugs.gnu.org
Cc: contact <at> sivalik.com, joaotavora <at> gmail.com
Subject: Re: bug#67150: eglot with typescript language server >= 4.1.0
Date: Wed, 15 Nov 2023 09:51:19 +0000
[Message part 1 (text/plain, inline)]
> Thanks.  In the meantime I asked the server author some questions and
> it seems the change has been rolled back, with the server accepting 
> the old language-ids again.  But I've pushed the change to eglot.el
> anyway.  I think this bug can be closed, but let me know if you 
> disagree.

I'm not sure if this fix is correct. In the documentation for
`eglot-server-programs' it says: -

* A list (MAJOR-MODE-SYMBOL :LANGUAGE-ID ID) where
  MAJOR-MODE-SYMBOL is the aforementioned symbol and ID is a
  string identifying the language to the server;

However the commit 260ba357bbe3e6faaadb20d998107c11fab40aa5 sets the
`:language-id' to symbols. So I think these should be strings instead,
e.g. "javascript".

Kind regards,

Simon
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67150; Package emacs. (Wed, 15 Nov 2023 16:18:01 GMT) Full text and rfc822 format available.

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

From: João Távora <joaotavora <at> gmail.com>
To: Simon Pugnet <simon <at> polaris64.net>
Cc: 67150 <at> debbugs.gnu.org, contact <at> sivalik.com
Subject: Re: bug#67150: eglot with typescript language server >= 4.1.0
Date: Wed, 15 Nov 2023 10:29:16 +0000
On Wed, Nov 15, 2023 at 10:28 AM Simon Pugnet <simon <at> polaris64.net> wrote:
>
>
> João Távora <joaotavora <at> gmail.com> writes:
>
> >> I'm not sure if this fix is correct. In the documentation for
> >> `eglot-server-programs' it says: -
> >>
> >> * A list (MAJOR-MODE-SYMBOL :LANGUAGE-ID ID) where
> >>   MAJOR-MODE-SYMBOL is the aforementioned symbol and ID is a
> >>   string identifying the language to the server;
> >>
> >> However the commit 260ba357bbe3e6faaadb20d998107c11fab40aa5 sets
> >> the
> >> `:language-id' to symbols. So I think these should be strings
> >> instead,
> >> e.g. "javascript".
> >
> > Yup, that was a mistake, guess I should have tested, but I don't
> > have this language server.  Keywords would probably work too,
> > but I fixed them to strings as you suggest.  Pushed to master
> > and cherry-picked to emacs-29.
>
> Perfect, I can confirm that this now works correctly in emacs-29.
>
> Thanks for the quick fix!

Thank you for the heads up!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67150; Package emacs. (Wed, 15 Nov 2023 16:28:02 GMT) Full text and rfc822 format available.

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

From: Simon Pugnet <simon <at> polaris64.net>
To: João Távora <joaotavora <at> gmail.com>
Cc: 67150 <at> debbugs.gnu.org, contact <at> sivalik.com
Subject: Re: bug#67150: eglot with typescript language server >= 4.1.0
Date: Wed, 15 Nov 2023 10:27:04 +0000
[Message part 1 (text/plain, inline)]
João Távora <joaotavora <at> gmail.com> writes:

>> I'm not sure if this fix is correct. In the documentation for
>> `eglot-server-programs' it says: -
>>
>> * A list (MAJOR-MODE-SYMBOL :LANGUAGE-ID ID) where
>>   MAJOR-MODE-SYMBOL is the aforementioned symbol and ID is a
>>   string identifying the language to the server;
>>
>> However the commit 260ba357bbe3e6faaadb20d998107c11fab40aa5 sets 
>> the
>> `:language-id' to symbols. So I think these should be strings 
>> instead,
>> e.g. "javascript".
>
> Yup, that was a mistake, guess I should have tested, but I don't
> have this language server.  Keywords would probably work too,
> but I fixed them to strings as you suggest.  Pushed to master
> and cherry-picked to emacs-29.

Perfect, I can confirm that this now works correctly in emacs-29.

Thanks for the quick fix!

Kind regards,

-- 
Simon Pugnet
https://www.polaris64.net/
PGP key fingerprint: 3BF7 85DE 162C 00C8 FB4D  A6FD BA13 59A8 2C0B 
3EF9
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 14 Dec 2023 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 148 days ago.

Previous Next


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