From: "João Távora" <joaotavora@gmail.com>
To: Filippo Argiolas <filippo.argiolas@gmail.com>
Cc: 65418@debbugs.gnu.org, Philip Kaludercic <philipk@posteo.net>,
Felician Nemeth <felician.nemeth@gmail.com>
Subject: bug#65418: 29.1; Eglot: support clangd inactiveRegions extension
Date: Sun, 27 Aug 2023 15:01:37 +0100 [thread overview]
Message-ID: <873504d1oe.fsf@gmail.com> (raw)
In-Reply-To: <CAOdrLG+BZqx-maT0Otk5uKgHmUFRfww5wBeLRqz=LAk_k=0-Uw@mail.gmail.com> (Filippo Argiolas's message of "Sun, 27 Aug 2023 12:52:58 +0200")
Filippo Argiolas <filippo.argiolas@gmail.com> writes:
> On Fri, Aug 25, 2023 at 2:16 PM João Távora <joaotavora@gmail.com> wrote:
>>
>> Filippo Argiolas <filippo.argiolas@gmail.com> writes:
>>
>> OK, after fetching that git snapshot today, I've done this:
>>
>> It's bare-bone but it works, because the method for communicating
>> "inactive regions" is very basic (and similar to unsolicited
>> diagnostics).
>>
>> Only minimally tested, so YMMV.
>>
>> This serves as a good example of how to support unofficial LSP
>> extensions using Eglot as an API. Could well be in the manual.
>>
>> The method for providing a client-side capability based on a server is
>> crude. Servers do identify themselves properly via LSP, but only after
>> being initialized, so it's too late and I had to use an heuritic based
>> on the command. We could also use a proper subclass for clangd servers,
>> but that's too verbose and overkill IMHO.
>
> That's great! Definitely owe you a beer or a bottle of your favorite
> beverage!
Glad to help. You're lucky I'm not some kind of wine connoisseur ;-)
> About the heuristic would it be that bad to just include
> inactiveRegions in the general client capabilities? Guess it would be
> just ignored by other servers not supporting it, wouldn't it?
Yes, but you would still need the extra add-on code. It just doesn't
belong in Eglot. It could belong in cc-mode.el (as could
eglot-server-programs's clangd entry, btw) but I heavily doubt the
author of that package would accept it. The brand new c++-ts-mode and
c-ts-mode is a different story though. Or it could just be a separate
file to require. Or a separate GNU ELPA package.
> Kind of surprised clangd doesn't use some kind of namespacing
> convention for their protocol extensions.
Yes. What's worse, it supports multiple different versions outside and
inside of the standard of the same feature. I've just seen this with
the textDocument/typeHierarchy method, which is now officially called
textDocument/prepareTypeHierarchy. So I don't want to add two methods
to support basically the same thing to Eglot.
> Anyway, it would be great if this could be a part of eglot but I can
> understand being careful given it's not in the standard protocol and
> not even in a released clangd yet.
> It would be great though if this example was included in the docs. It
> says a lot about how easy to extend and well designed eglot is.
Make a patch for that (and remember to also include the exportation of
the '--' symbols).
> One thing about UI, all the themes I tried seem to render shadow as
> grey-ish but it was my impression reading the docs that it would be a
> dim version of the current face, so it would still have syntax
> highlighting. Is it just a theme limitation (probably because shadow
> wasn't used for something like this before) or it's not technically
> possible?
I'm fairly sure it's technically possible, even if perhaps not easy.
You can investigate or ask this on emacs-devel.
João
next prev parent reply other threads:[~2023-08-27 14:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-21 8:41 bug#65418: 29.1; Eglot: support clangd inactiveRegions extension Filippo Argiolas
2023-08-21 16:57 ` Philip Kaludercic
2023-08-21 19:04 ` Felician Nemeth
2023-08-22 7:09 ` Filippo Argiolas
2023-08-22 8:56 ` João Távora
2023-08-22 11:02 ` Filippo Argiolas
2023-08-25 12:18 ` João Távora
2023-08-27 10:52 ` Filippo Argiolas
2023-08-27 14:01 ` João Távora [this message]
2023-08-31 17:28 ` Filippo Argiolas
2023-09-04 1:05 ` João Távora
2023-09-04 1:08 ` João Távora
2023-09-04 3:59 ` Filippo Argiolas
2023-09-04 4:09 ` Filippo Argiolas
2023-09-04 10:51 ` João Távora
2023-09-04 12:44 ` Eli Zaretskii
2023-09-04 12:49 ` João Távora
2023-09-04 16:17 ` Eli Zaretskii
2023-09-04 20:37 ` João Távora
2023-09-04 11:41 ` Eli Zaretskii
2023-09-02 8:14 ` Filippo Argiolas
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=873504d1oe.fsf@gmail.com \
--to=joaotavora@gmail.com \
--cc=65418@debbugs.gnu.org \
--cc=felician.nemeth@gmail.com \
--cc=filippo.argiolas@gmail.com \
--cc=philipk@posteo.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).