unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Niels Thykier <niels@thykier.net>, 72088@debbugs.gnu.org
Subject: bug#72088: eglot: Segregates language servers in a way that hampers polyglot language servers
Date: Sat, 13 Jul 2024 17:29:04 +0100	[thread overview]
Message-ID: <CALDnm51jfOg=7ouYF+yvFmuScGak2mix1X74B2Fe-jS8d8FSrw@mail.gmail.com> (raw)
In-Reply-To: <86bk31lsvd.fsf@gnu.org>

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

Major modes in eglot-server-programs don't work? What was attempted? I
couldn't understand. Look at existing examples, like C/C++ file types being
handled by the same server, and others.

João

On Sat, Jul 13, 2024, 07:16 Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Fri, 12 Jul 2024 13:33:56 +0200
> > From: Niels Thykier <niels@thykier.net>
> >
> > 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? :)
>
> João, any comments or suggestions?
>

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

  reply	other threads:[~2024-07-13 16:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALDnm51jfOg=7ouYF+yvFmuScGak2mix1X74B2Fe-jS8d8FSrw@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=72088@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=niels@thykier.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).