all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#67150: eglot with typescript language server >= 4.1.0
@ 2023-11-13 11:29 Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-13 16:37 ` João Távora
  0 siblings, 1 reply; 13+ messages in thread
From: Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-13 11:29 UTC (permalink / raw)
  To: 67150

[-- Attachment #1: Type: text/plain, Size: 165 bytes --]

typescript language server didOpen fails for .tsx with "Cannot open document"

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

[-- Attachment #2: Type: text/html, Size: 791 bytes --]

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

* bug#67150: eglot with typescript language server >= 4.1.0
  2023-11-13 11:29 bug#67150: eglot with typescript language server >= 4.1.0 Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-13 16:37 ` João Távora
  2023-11-13 16:42   ` Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 13+ messages in thread
From: João Távora @ 2023-11-13 16:37 UTC (permalink / raw)
  To: Rajeev N; +Cc: 67150

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





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

* bug#67150: eglot with typescript language server >= 4.1.0
  2023-11-13 16:37 ` João Távora
@ 2023-11-13 16:42   ` Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-13 16:49     ` João Távora
  0 siblings, 1 reply; 13+ messages in thread
From: Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-13 16:42 UTC (permalink / raw)
  To: João Távora; +Cc: 67150

[-- Attachment #1: Type: text/plain, Size: 440 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1327 bytes --]

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

* bug#67150: eglot with typescript language server >= 4.1.0
  2023-11-13 16:42   ` Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-13 16:49     ` João Távora
  2023-11-13 16:57       ` Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 13+ messages in thread
From: João Távora @ 2023-11-13 16:49 UTC (permalink / raw)
  To: Rajeev N; +Cc: 67150

On Mon, Nov 13, 2023 at 4:42 PM Rajeev N <contact@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





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

* bug#67150: eglot with typescript language server >= 4.1.0
  2023-11-13 16:49     ` João Távora
@ 2023-11-13 16:57       ` Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-14  0:12         ` João Távora
  0 siblings, 1 reply; 13+ messages in thread
From: Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-13 16:57 UTC (permalink / raw)
  To: João Távora; +Cc: 67150

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

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,

[-- Attachment #2: Type: text/html, Size: 964 bytes --]

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

* bug#67150: eglot with typescript language server >= 4.1.0
  2023-11-13 16:57       ` Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-14  0:12         ` João Távora
  2023-11-14 12:07           ` Eli Zaretskii
  2023-11-15  9:51           ` Simon Pugnet
  0 siblings, 2 replies; 13+ messages in thread
From: João Távora @ 2023-11-14  0:12 UTC (permalink / raw)
  To: Rajeev N, 67150-done

[-- Attachment #1: Type: text/plain, Size: 686 bytes --]

On Mon, Nov 13, 2023 at 4:57 PM Rajeev N <contact@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

[-- Attachment #2: Type: text/html, Size: 1294 bytes --]

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

* bug#67150: eglot with typescript language server >= 4.1.0
  2023-11-14  0:12         ` João Távora
@ 2023-11-14 12:07           ` Eli Zaretskii
  2023-11-14 12:19             ` João Távora
  2023-11-15  9:51           ` Simon Pugnet
  1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2023-11-14 12:07 UTC (permalink / raw)
  To: João Távora; +Cc: 67150, contact

> Resent-To: bug-gnu-emacs@gnu.org
> From: João Távora <joaotavora@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?





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

* bug#67150: eglot with typescript language server >= 4.1.0
  2023-11-14 12:07           ` Eli Zaretskii
@ 2023-11-14 12:19             ` João Távora
  2023-11-14 14:28               ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: João Távora @ 2023-11-14 12:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 67150, contact

On Tue, Nov 14, 2023 at 12:07 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > Resent-To: bug-gnu-emacs@gnu.org
> > From: João Távora <joaotavora@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





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

* bug#67150: eglot with typescript language server >= 4.1.0
  2023-11-14 12:19             ` João Távora
@ 2023-11-14 14:28               ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2023-11-14 14:28 UTC (permalink / raw)
  To: João Távora; +Cc: 67150, contact

> From: João Távora <joaotavora@gmail.com>
> Date: Tue, 14 Nov 2023 12:19:15 +0000
> Cc: 67150@debbugs.gnu.org, contact@sivalik.com
> 
> On Tue, Nov 14, 2023 at 12:07 PM Eli Zaretskii <eliz@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.





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

* bug#67150: eglot with typescript language server >= 4.1.0
  2023-11-14  0:12         ` João Távora
  2023-11-14 12:07           ` Eli Zaretskii
@ 2023-11-15  9:51           ` Simon Pugnet
  2023-11-15 10:18             ` João Távora
  1 sibling, 1 reply; 13+ messages in thread
From: Simon Pugnet @ 2023-11-15  9:51 UTC (permalink / raw)
  To: 67150; +Cc: contact, joaotavora

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

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

* bug#67150: eglot with typescript language server >= 4.1.0
  2023-11-15  9:51           ` Simon Pugnet
@ 2023-11-15 10:18             ` João Távora
  2023-11-15 10:27               ` Simon Pugnet
  0 siblings, 1 reply; 13+ messages in thread
From: João Távora @ 2023-11-15 10:18 UTC (permalink / raw)
  To: Simon Pugnet; +Cc: 67150, contact

On Wed, Nov 15, 2023 at 9:51 AM Simon Pugnet <simon@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





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

* bug#67150: eglot with typescript language server >= 4.1.0
  2023-11-15 10:18             ` João Távora
@ 2023-11-15 10:27               ` Simon Pugnet
  2023-11-15 10:29                 ` João Távora
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Pugnet @ 2023-11-15 10:27 UTC (permalink / raw)
  To: João Távora; +Cc: 67150, contact

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]


João Távora <joaotavora@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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

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

* bug#67150: eglot with typescript language server >= 4.1.0
  2023-11-15 10:27               ` Simon Pugnet
@ 2023-11-15 10:29                 ` João Távora
  0 siblings, 0 replies; 13+ messages in thread
From: João Távora @ 2023-11-15 10:29 UTC (permalink / raw)
  To: Simon Pugnet; +Cc: 67150, contact

On Wed, Nov 15, 2023 at 10:28 AM Simon Pugnet <simon@polaris64.net> wrote:
>
>
> João Távora <joaotavora@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!





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

end of thread, other threads:[~2023-11-15 10:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-13 11:29 bug#67150: eglot with typescript language server >= 4.1.0 Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-13 16:37 ` João Távora
2023-11-13 16:42   ` Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-13 16:49     ` João Távora
2023-11-13 16:57       ` Rajeev N via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-14  0:12         ` João Távora
2023-11-14 12:07           ` Eli Zaretskii
2023-11-14 12:19             ` João Távora
2023-11-14 14:28               ` Eli Zaretskii
2023-11-15  9:51           ` Simon Pugnet
2023-11-15 10:18             ` João Távora
2023-11-15 10:27               ` Simon Pugnet
2023-11-15 10:29                 ` João Távora

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.