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

From: Filippo Argiolas <[email-masked]>
Date: Mon, 21 Aug 2023 10:41:46 +0200

Hi,
I've recently been working in some big C project with ton of ifdefs
and inactive code regions.

One of the few annoyances (maybe the last) remaining with emacs+eglot
is the inability to show these regions as grayed out in a LSP aware
way.

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.

It's been introduced in clangd 17 with the review [1].

It should be pretty straightforward to implement as it's just a server
notification that sends inactive regions ranges once enabled.

In [2] you can find the pull request that added support for this in
vscode clangd extension.

I did some experiment on my own but I'm still not able to see the
notifications. Probably I'm missing something within eglot code base,
my impression was that enabling the inactiveRegions capability would
get me some Unknown notification message but I wasn't able to see
them.

Anyways it would be great if eglot could 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.

1. https://reviews.llvm.org/D143974
2. https://github.com/clangd/vscode-clangd/pull/193/commits/ef75f637e7f79f94064369368ca665861836e482