Subject: bug#65418: 29.1; Eglot: support clangd inactiveRegions extension

From: Filippo Argiolas <[email-masked]>
Date: Tue, 22 Aug 2023 09:09:28 +0200

On Mon, Aug 21, 2023 at 9:04 PM Felician Nemeth
<[email-masked]> wrote:
>
> Filippo Argiolas <[email-masked]> writes:
>
> > [...] This was maybe possibile until now with clangd with semantic
> > tokens but they've recently introduced a new protocol extension that
> > should solve this problem in a much easier to implement way.
>
> In the past, João wasn't keen on supporting non-standard features in
> Eglot.  I Cc'd him anyway as he is the maintainer of Eglot.

Let's wait for feedback from João then. I'd say this could warrant an
exception on the basis that disabling code with the preprocessor is
something specific enough to C/C++. It makes sense to have it as a
server extension.

Also this IMHO would solve quite an important problem with C
development, not sure if it's worth waiting while we could solve it
now with the extension and move to the standard protocol if and once
the LSP spec will support this.

> > Not sure UI-wise what would be the best approach, vscode patch reduces
> > the opacity of the inactive regions but rendering them as comment
> > would also be nice at first.
>
> Maybe hide-ifdef-mode is good for providing inspiration.

No idea how easy that would be and if that makes sense but we could
maybe follow the eglot philosophy of working with existing components
and just forward inactive regions to hide-ifdef-mode?

Filippo