-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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] Add an option to disable special handling of standard library headers in include-cleaner #122612
Comments
@llvm/issue-subscribers-clangd Author: Nikolas Klauser (philnik777)
While there are good reasons for adding some special magic for standard libraries, this really gets in the way when actually working on a standard library. For example, the include cleaner is completely broken, since it's always mapping public symbols to the public headers, even though library-internal headers should actually be used. It would be awesome if there was a flag for clangd to disable such special magic, allowing it to be used when working on a standard library without patching your own version together.
|
Are there other examples of special handling besides include-cleaner that you've come across? |
I'm pretty sure I've run into other stuff, but I can't remember right now. Could just be me misremembering as well. The two other things I've patched in are adding custom clang-tidy checks (which is really not standard-library specific) and the include inserter to always use angle brackets, but I can't remember why I did that. |
@llvm/issue-subscribers-clang-include-cleaner Author: Nikolas Klauser (philnik777)
While there are good reasons for adding some special magic for standard libraries, this really gets in the way when actually working on a standard library. For example, the include cleaner is completely broken, since it's always mapping public symbols to the public headers, even though library-internal headers should actually be used. It would be awesome if there was a flag for clangd to disable such special magic, allowing it to be used when working on a standard library without patching your own version together.
|
Ok; I've tweaked the issue title to make it specific to include-cleaner for now. (Note that include-cleaner is a top-level "extra tool" living at If you find other cases of special handling, we can track those in other issues. |
I mostly wanted to express that I don't think there should be an option per site, but a single flag to say "I don't want special handling" regardless where it is. Maybe I should have made that more clear. I don't really see a use-case to be more fine-grained other than people doing more weird stuff with their standard libraries. |
Understood. I'm going to keep the issue title as is to keep the issue focused. ("Audit all codepaths used by clangd that might treat system headers differently" is a larger and fuzzier task that's not likely to be done all at once.) I'm fine though with keeping the name of such an option general (i.e. not specific to include-cleaner), with a view to possibly having the option affect other features as well in the future. |
While there are good reasons for adding some special magic for standard libraries, this really gets in the way when actually working on a standard library. For example, the include cleaner is completely broken, since it's always mapping public symbols to the public headers, even though library-internal headers should actually be used. It would be awesome if there was a flag for clangd to disable such special magic, allowing it to be used when working on a standard library without patching your own version together.
The text was updated successfully, but these errors were encountered: