You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a possible remedy workaround for issue #1481, #374, #70.
Generally speaking, not all library use IWYU style pragma to indicate if its' including header is "public" or "private". IWYU maintains a long manifest to help itself recognize these.
Currently, Clangd partially supports IWYU pragma in source code file, but effects are still limited as mentioned above. I'd like
to propose that we could have a more user-friendly completion experience by supporting parsing mappings from IWYU imp files.
For example, user could specify where the imp file locates in configuration:
Then clangd reads mappings from this imp file and do an extra mapping at SymbolCollector::finish().
Pros:
More precise auto-inserting headers. We can avoid some extra insertion for so-called "umbrella-like" headers, i.e., headers that transitively export other headers only. (For C/C++, not that "umbrella header" in ObjC)
The manifest is maintained by IWYU, which is the de-facto header cleanup tools in C++ community.
Cons:
User had to specify these mappings for themself, which hurts the OOBE, though it is optional.
Would IWYU guys keep the format of imp files consistent?
Alternative:
A heuristic way is to recognize if a symbol is included by an umbrella header that user had included it. Then we don't complete for that transitive header. (But it breaks the rules of what IWYU follows)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is a possible remedy workaround for issue #1481, #374, #70.
Generally speaking, not all library use IWYU style pragma to indicate if its' including header is "public" or "private". IWYU maintains a long manifest to help itself recognize these.
Currently, Clangd partially supports IWYU pragma in source code file, but effects are still limited as mentioned above. I'd like
to propose that we could have a more user-friendly completion experience by supporting parsing mappings from IWYU imp files.
For example, user could specify where the imp file locates in configuration:
Then clangd reads mappings from this imp file and do an extra mapping at
SymbolCollector::finish()
.Pros:
Cons:
Alternative:
Beta Was this translation helpful? Give feedback.
All reactions