I have two use cases for refactoring related to header files / inclusions and I’m wondering if there is any way to accomplish them with clangd:
-
sometimes the #include of a particular header is actually not needed - maybe due to some previous refactoring that forgot to remove the (now) useless header. Is there some way to have clangd help me identify such cases where a particular #include serves no purpose in the given TU?
-
sometimes when tracking down dependencies, I want to see what symbols/definitions/macros in the current TU come from a particular header. Is there a way to get a list of symbols in the current TU that came from a given header? Given that information, it would be possible to do determine how much or how little a given TU depends on a particular header, which can be helpful when trying to break dependencies, for example.
Thanks.