unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#72088: eglot: Segregates language servers in a way that hampers polyglot language servers
@ 2024-07-12 11:33 Niels Thykier
  2024-07-13  6:15 ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Niels Thykier @ 2024-07-12 11:33 UTC (permalink / raw)
  To: 72088

Hi

Thanks for providing LSP support in emacs. :)


For reference, I used emacs 29.4 from Debian when I tested. If this 
feature has changed in emacs 30, then I would not have seen it yet (I am 
not tracking emacs/eglot development a lot).


I am working on a language server for Debian packaging (called 
`debputy`). The Debian packaging files consists of several different 
file formats with cross references between the formats. As a 
consequence, I built my language server to be a "polyglot" (multi-language).

While testing with eglot, I noticed that my language server was not 
informed of all changes. As far as I can see, eglot spawns a language 
server per file format (major mode) and then only informs the language 
server of events (didOpen/didChange) for that major mode. This happens 
even through it is exactly the same command + args for both major modes.

The next result is that my language server when used via emacs + eglot, 
requires the user to save a file before the language server can "see" 
the effect when you are working in a different file.

I was a bit in doubt whether the spec accounted for polyglot language 
servers, so I asked in the LSP github for clarification. They made the 
argument that a language server should be able to see events for other 
file formats and suggested that I contacted you (the eglot maintainers) 
about this 
(https://github.com/microsoft/language-server-protocol/issues/1964). 
They acknowledged this was implicit and then listed the two key features 
they saw as supporting this implicit requirement (both of them boils 
down to DocumentSelector as I read it).

I tried a static registration with a DocumentSelector on `**/debian/*` 
(I think it was hover docs, though it might have been completion), but 
my debugging suggested that my instances did not get didOpen/didChange 
events "across" the file formats even with this registration.

Can we work towards a solution where I can ask eglot to provide 
didOpen/didChange events across formats? :)

Best regards,
Niels





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

end of thread, other threads:[~2024-07-14 13:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12 11:33 bug#72088: eglot: Segregates language servers in a way that hampers polyglot language servers Niels Thykier
2024-07-13  6:15 ` Eli Zaretskii
2024-07-13 16:29   ` João Távora
2024-07-14  4:37     ` Eli Zaretskii
2024-07-14  7:31       ` Niels Thykier
2024-07-14  8:01       ` João Távora
2024-07-14  9:36         ` Niels Thykier
2024-07-14  9:46           ` Niels Thykier
2024-07-14 10:30             ` Niels Thykier
2024-07-14  9:48           ` João Távora
2024-07-14 12:01             ` Niels Thykier
2024-07-14 13:21               ` João Távora

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).