unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Filippo Argiolas <filippo.argiolas@gmail.com>
To: "João Távora" <joaotavora@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 12:52:58 +0200	[thread overview]
Message-ID: <CAOdrLG+BZqx-maT0Otk5uKgHmUFRfww5wBeLRqz=LAk_k=0-Uw@mail.gmail.com> (raw)
In-Reply-To: <87zg2fnwm0.fsf@gmail.com>

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!
Still testing it but so far it seems to work perfectly! Love that
clangd is smart enough to classify as inactive also other stuff beyond
ifdefs, like headers included but not used.

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? Kind of
surprised clangd doesn't use some kind of namespacing convention for
their protocol extensions.

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.

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?

Thanks a lot again,
Filippo





  reply	other threads:[~2023-08-27 10:52 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 [this message]
2023-08-27 14:01             ` João Távora
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='CAOdrLG+BZqx-maT0Otk5uKgHmUFRfww5wBeLRqz=LAk_k=0-Uw@mail.gmail.com' \
    --to=filippo.argiolas@gmail.com \
    --cc=65418@debbugs.gnu.org \
    --cc=felician.nemeth@gmail.com \
    --cc=joaotavora@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).