Skip to content
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

[IncludeCleaner] Support mapping files similar to IWYU #1276

Open
cmfcmf opened this issue Sep 5, 2022 · 1 comment
Open

[IncludeCleaner] Support mapping files similar to IWYU #1276

cmfcmf opened this issue Sep 5, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@cmfcmf
Copy link

cmfcmf commented Sep 5, 2022

It would be great if IncludeCleaner could support mapping files similar to IWYU: https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUMappings.md. For example, during Chromium development, clangd will often suggest the wrong include paths for header, like gtest/gtest.h instead of the Chromium-specific testing/gtest/include/gtest/gtest.h or absl/types/optional.h instead of third_party/abseil-cpp/absl/types/optional.h. The conclusion in this chromium.org thread was that we would need to find a way to configure clangd's IncludeCleaner to achieve better DX here.

@cmfcmf cmfcmf added the enhancement New feature or request label Sep 5, 2022
@johngladp
Copy link

I'd also request this feature, including the "ref" entries.

For example: including vulkan.h doesn't satisfy IncludeCleaner currently and we get asked to include vulkan_core.h which is a file included within vulkan.h and an invalid suggestion (you're supposed to include vulkan.h)

Similarly with gsl.h, we're asked to include gsl_pointer.h directly which isn't a suitable requirement as you're supposed to include gsl.h.

In both of the above examples, both are external projects so we can't add // IWYU pragma: private ... statements to those header files so a mapping file is required ideally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants