Nathan Ridge
Nathan Ridge
Agree this would be useful. Out of curiosity, how did you get the highlighting shown in the first screenshot?
Could you provide a complete code example?
> what are the supported extensions? The extensions currently supported by clangd's "switch source/header" command are [these ones](https://searchfox.org/llvm/rev/98c90a13c6b27768315eaecc92f036f75195eff4/clang-tools-extra/clangd/HeaderSourceSwitch.cpp#23-25): ```c++ llvm::StringRef SourceExtensions[] = {".cpp", ".c", ".cc", ".cxx", ".c++", ".m", ".mm"}; llvm::StringRef...
> As discussed in [#1913](https://github.com/clangd/clangd/issues/1913#issuecomment-1911546390), it is possible to lower the diagnostic severity of "UnusedInclude" to [`DiagnosticSeverity.Information`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnosticSeverity), as "MissingInclude" already does this. I found a [code comment](https://searchfox.org/llvm/rev/3855757f98935208d7d0481af01a474139de9519/clang-tools-extra/clangd/IncludeCleaner.cpp#162-174) that suggests that...
As for tracking direct vs. indirect uses: I'm not familiar with the details of the include-cleaner implementation, but I suspect this would require additional infrastructure / implementation work, making that...
The warning is produced by a new feature in clangd 17 called [include cleaner](https://clangd.llvm.org/guides/include-cleaner). The issue you describe sounds like the first scenario discussed in [this section](https://clangd.llvm.org/guides/include-cleaner#scenarios-and-solutions) section, you can...
> Is there a way to keep "unused header" behavior, but allow indirect use as well? I think such an option is possible to implement, but isn't currently implemented. We...
> Even just considering `stdlib.h`. If I have auto-insert on, every time I type `NULL`, clangd would include some weird low-level platform header which I definitely don't want in my...
> > The warning is produced by a new feature in clangd 17 called [include cleaner](https://clangd.llvm.org/guides/include-cleaner). > > I am new to using clangd, but is there a way that...
> In the meantime, are there any ways we can change severities in our config files or through command-line options? Not that I know of.