This enables include insertion by adding canonical includes into
preambledata.
Details
Diff Detail
- Repository
- rCTE Clang Tools Extra
- Build Status
Buildable 27671 Build 27670: arc lint + arc unit
Event Timeline
clangd/ClangdUnit.cpp | ||
---|---|---|
100 | Does this have to own the IWYUHandler? Could we create one when getCommentHandler is called? | |
124 | This looks like a memory leak? release()? | |
340 | I think so? A header file (with IWYU pragma) can also be the main file. | |
unittests/clangd/CodeCompleteTests.cpp | ||
2317 | nit: maybe put this close to test cases that involve preamble. e.g. IndexSuppressesPreambleCompletions | |
2331 | nit: just use std::string for readability. | |
unittests/clangd/FileIndexTests.cpp | ||
207 | Are we sure the comment will be included in the preamble if there is no #include block? |
- Address comments.
- Call addSystemHeaderMappings when we are building ast without preamble.
clangd/ClangdUnit.cpp | ||
---|---|---|
100 | The class needs to own it, since preprocessor doesn't take the ownership. But we can move the creation to getcommenthandler. | |
124 | Preprocessor doesn't take the ownership, so this seems to be correct ? | |
340 | Also call addSystemHeadersMapping in case there is no preamble. |
lgtm.
Note that this will enable include insertions for everyone (even without index switched on). Not sure if we should provide options.
clangd/ClangdServer.cpp | ||
---|---|---|
16 | nit: is this used? |
I don't think so, since the only reason this already wasn't enabled was because there was a fixme ? Also we want people to use -background-index by default in future so I think it should be OK
nit: is this used?