all messages for Emacs-related lists mirrored at yhetil.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: Tue, 22 Aug 2023 13:02:47 +0200	[thread overview]
Message-ID: <CAOdrLGLPzR_qCcSUNgBHxykjS+_yQBCysL_duUt9umouSn6E=w@mail.gmail.com> (raw)
In-Reply-To: <CALDnm50Gy953X1NGeosxuwzWRZosjV+NhzytfJQ1BrqZ7oRHzQ@mail.gmail.com>

On Tue, Aug 22, 2023 at 10:56 AM João Távora <joaotavora@gmail.com> wrote:
> I'm more worried that this isn't even out yet. Afaik Filippo you compiled a Clangd 17 with a patch, right? I have done that in the past, but it's not very practical every time, so either we wait for this to stabilize or you have to tell me where to grab the patched Clangd and llvm toolchain somewhere.

It's much easier than that! They release unstable git snapshots in
github. You can find them at https://github.com/clangd/clangd/releases
Clangd is released as a static binary you can just copy in your path
(e.g. in ~/.local/bin). From what I can tell you don't need to upgrade
the whole toolchain, the binary runs fine on its own. Latest one for
linux is at https://github.com/clangd/clangd/releases/download/snapshot_20230820/clangd-linux-snapshot_20230820.zip

It would be great if you could test it and see if you can get server
notifications for inactiveRegions.

I think the interface should be already stable, reading the review the
only thing that is probably going to change at some point is dropping
the support to generate semantic tokens for inactive regions as
comments, which they are keeping for backwards compatibility.

>> 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.
>
> I'm also personally interested in this feature. But how likely is it that this makes it into the LSP standard, in your opinion?

Honestly I don't know :-) Only information I could find is this vscode
issue https://github.com/microsoft/vscode/issues/123352 where they
seemed to agree it's not something that belongs in semantic tokens but
then the discussion stalled.


> FWIW, other languages have similar features. Common Lisp has read-time conditionals for example, which are similar if not identical in function (and obviously not as rotten as C macros).
>
> By the way, if you didn't know this silly trick, if you're in a #ifdef web, a half-decent way to know whether a given point is active is to try and find a definition inside it or type some syntactically correct code. If Eglot jumps to target or highlights variable names, the region is active, else it probably isn't.

Thanks! that's actually a great way to see if the highlighted code is
active! Still greying it out or dimming the colors would be great to
see at a glance if a region is dead, especially for big regions. It's
also one of those few features that Emacs still misses when compared
to vscode.

Filippo





  reply	other threads:[~2023-08-22 11:02 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 [this message]
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
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOdrLGLPzR_qCcSUNgBHxykjS+_yQBCysL_duUt9umouSn6E=w@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.