-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clangd causes headers to be flagged as not used #1683
Comments
Hi @cjdb, your compile flags are also likely to be relevant, but usually having some header & source code should be enough to demonstrate a small reproducer for include-cleaner purposes. I was looking into the logs attached and there seems to be patterns like:
foo.cc:
Does this relate to the patterns you're facing the issues with? So if your project involves such patterns the best thing is to disable analysis for the whole project or certain headers. See https://clangd.llvm.org/guides/include-cleaner#adjusting-behavior for some configuration knobs. |
Thanks for identifying the root problem so quickly!
Ah, that explains why it's affecting this project and not others. That's unfortunate, since this project is a standard library implementation (the Would it be possible for clangd to use normal mappings when |
My sense is some projects use So, we may want a separate config knob for this use case. |
Perhaps there should be an option in |
Yes, the project which I am working on at work also fits this description: We are using the standard library, but we want to overwrite the include paths and hence use |
Please describe the problem.
https://reviews.llvm.org/D152686 seems to have broken clangd for a project of mine. Most of my headers are now flagged as not being directly used even though they're the root header for the symbol.
I've managed to bisect it to this commit, but don't really know how to reduce it for a repro. Should I just try and recreate one of the headers in a new project with my config file? Should I also consider my compile_commands.json?
Interestingly, if I ask clangd to take me to the definition, it will move to that file.
Logs
clangd.txt
System information
Any version of clangd post-D152686.
Editor/LSP plugin: VS Code
Operating systems: Arch Linux, macOS SSHing to Debian
The text was updated successfully, but these errors were encountered: