[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [NonGNU ELPA] new package: clangd-inactive-regions
From: |
Filippo Argiolas |
Subject: |
Re: [NonGNU ELPA] new package: clangd-inactive-regions |
Date: |
Mon, 4 Nov 2024 08:17:13 +0100 |
On Mon, Nov 4, 2024 at 6:34 AM Richard Stallman <rms@gnu.org> wrote:
> > > It's an eglot extension that listens to clangd inactiveRegions
> > > notifications and shades inactive code accordingly. It's useful to
> > > highlight disabled code sections in a LSP aware way, honoring current
> > > building options and defines.
>
> Does "inactive region" mean unreachable code? I am guessin so.
>
> Is there a standard way for lamguage servers to report unreachable code?
> Could we make Emacs recognize that way? Then eglot could handle it
> for any language, and it would not be specific to clangd.
In this context it means unreachable code as disabled by the
preprocessor stage, e.g. code under a currently disabled ifdef branch.
LSP advantage here is providing knowledge about how a file is compiled
with proper build time flags and defines for current build
configuration.
At the moment it's a clangd specific extension, there was some plan[1]
for standard LSP inclusion but I'm not sure it went anywhere.
Also, does this specific meaning make sense for non c/c++/preprocessed
languages?
I believe unreachable in the control flow/static analysis sense can
already be achieved with normal LSP diagnostics. If I am not mistaken
clangd already provides diagnostics for this when clang-tidy is
enabled.
1. https://github.com/clangd/clangd/issues/132#issuecomment-1722327517
- Re: [NonGNU ELPA] new package: clangd-inactive-regions, (continued)
Re: [NonGNU ELPA] new package: clangd-inactive-regions, Eli Zaretskii, 2024/11/03
Re: [NonGNU ELPA] new package: clangd-inactive-regions, Richard Stallman, 2024/11/04