From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#72088: eglot: Segregates language servers in a way that hampers polyglot language servers Date: Sat, 13 Jul 2024 17:29:04 +0100 Message-ID: References: <6e65694c-88d6-4c54-93a8-2ffb843ce6d0@thykier.net> <86bk31lsvd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000626d99061d237f65" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23280"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Niels Thykier , 72088@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 13 18:31:20 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sSfeY-0005sM-Jq for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Jul 2024 18:31:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSfeM-0007C5-6t; Sat, 13 Jul 2024 12:31:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sSfeH-0007Bb-Bh for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2024 12:31:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sSfeH-0007Sd-3B for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2024 12:31:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sSfeH-0006ES-Ux for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2024 12:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jul 2024 16:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72088 X-GNU-PR-Package: emacs Original-Received: via spool by 72088-submit@debbugs.gnu.org id=B72088.172088822823895 (code B ref 72088); Sat, 13 Jul 2024 16:31:01 +0000 Original-Received: (at 72088) by debbugs.gnu.org; 13 Jul 2024 16:30:28 +0000 Original-Received: from localhost ([127.0.0.1]:56632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSfdj-0006DL-W2 for submit@debbugs.gnu.org; Sat, 13 Jul 2024 12:30:28 -0400 Original-Received: from mail-oi1-f181.google.com ([209.85.167.181]:57463) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSfdh-0006D4-47 for 72088@debbugs.gnu.org; Sat, 13 Jul 2024 12:30:26 -0400 Original-Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-3d9e13ef8edso1813361b6e.2 for <72088@debbugs.gnu.org>; Sat, 13 Jul 2024 09:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720888158; x=1721492958; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JEhT8yl3bX5zquO7e/wscmMfbkl1GSWrfH35QuJfFNo=; b=iqOWGo4sMqiq0zuwS1n7XT+bJxRjjKcrYL47L6pH/wEvN9g4q4N1+Igv2vmI17af2X CpJvymc9aQK8myrX4eEGByIcv9v5tP4efKYgCIHPb5rSLH8de6E5+egsQiD8ei9xmsws ePBsbmdDDQBDie5W6TPdA4N7LKBeGhuZiiGR8rPt0lBQeaCEvixOUegqsoh3Bd7cMWLz O/cAfvI6yRRnM4Yz4Mkucfg0A3Q9V2jtLCRA2N3Cn0Z+w9yzxoABMedDSiFrAgi26E0p nEoNW9dUjZMbcN+bVN/mHhO/bPuo/rH9LhJSl/0Ev+py7LgebGYhSq8TaExtoVhWDYpp +abg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720888158; x=1721492958; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JEhT8yl3bX5zquO7e/wscmMfbkl1GSWrfH35QuJfFNo=; b=p1Nqb+ukbTPiO7tghhDWcMuUCUlOj5Wd3+qyJdH7SmrS3ra6RXzXnoGz3efAJA6g66 jiUNyp+vT3OXhH1TTr9a2J/Tc15iEWyqjI5Ve+908EhHMz2luMvLOju8B/8samVK64hQ F3VFJ8K9zpF9TZ6y3FtYUe0uv+dqxjQmCPu0dsoQWsDwYzEMib06D+Yx8iviepammH2k puSUUGK4Hp4oNSZAbWvHpB2HhAEouUkiLqllf0cDgliGtP4bdLa09YnrOi2UYrxpAl2l 2tWcGxBG3jZQ1ZA7Q6hftEXQAt3Hd7jwCgSk/aRGLi1+RX5Fn6+N/3Lph2gPTTQnglNb IGUg== X-Forwarded-Encrypted: i=1; AJvYcCUT+YTlyU1W0QNm9WwI9oW4gHEPe/TxnU2uP02eslqQcVBd4G8xc4x+rOPhnqZjfhvNQnxjxILlqGL5+9/WC9kjIqcVDy8= X-Gm-Message-State: AOJu0YyTQBqkEuC8TCobERP87AqwGH5KTefFbeV26xoMNtrHk/TTLryG /spwAa/+MGbvOL7vPAqZfDDuGkfxbo3ki/tZs+TGdzxUUz6npobZDvyxHxvKzlGNeBpXZhPahbW omxppdkLc6Rn+O4TxdFgSRYSDDgvNEQ== X-Google-Smtp-Source: AGHT+IEym89jGTGkGw6VOfovYUJ7Flej6HNnZ+7kRt+IeTRRIAbjaXYaZbcJhGcPQT3kV+5smKwvyuHE+itwz7VbNsY= X-Received: by 2002:a05:6870:1687:b0:25e:14e9:10c9 with SMTP id 586e51a60fabf-25eae74a795mr12219610fac.6.1720888158478; Sat, 13 Jul 2024 09:29:18 -0700 (PDT) In-Reply-To: <86bk31lsvd.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288818 Archived-At: --000000000000626d99061d237f65 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=C3=A3o On Sat, Jul 13, 2024, 07:16 Eli Zaretskii wrote: > > Date: Fri, 12 Jul 2024 13:33:56 +0200 > > From: Niels Thykier > > > > 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 a= m > > 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 feature= s > > 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=C3=A3o, any comments or suggestions? > --000000000000626d99061d237f65 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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=C3=A3o

On Sat, Jul 13, 2024, 07:16= Eli Zaretskii <eliz@gnu.org> wro= te:
> Date: F= ri, 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 <= br> > 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 mode= s.
>
> 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 featur= es
> they saw as supporting this implicit requirement (both of them boils <= br> > 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=C3=A3o, any comments or suggestions?
--000000000000626d99061d237f65--