This is a tricky case (we baked the assumption that symbols come from
the preamble xor mainfile pretty deeply) and the fix is a bit of a hack:
We look at the code to guess the macro names, and deserialize them from
the preamble "by hand".
Details
Details
- Reviewers
ilya-biryukov - Commits
- rG73c44e45eca2: Revert rL359778 : [clangd] Fix code completion of macros defined in the…
rCTE359796: Revert rL359778 : [clangd] Fix code completion of macros defined in the…
rL359796: Revert rL359778 : [clangd] Fix code completion of macros defined in the…
rG929f639eb81b: [clangd] Fix code completion of macros defined in the preamble region of the…
rL359778: [clangd] Fix code completion of macros defined in the preamble region of the…
rCTE359778: [clangd] Fix code completion of macros defined in the preamble region of the…
Diff Detail
Diff Detail
- Repository
- rCTE Clang Tools Extra
Event Timeline
Comment Actions
LGTM.
I suggest considering a more direct way to solve the same problem: we could collect symbols for the main-file macros when building the preamble and store them in PreambleData (or somewhere else with the same lifetime).
I don't see any reasons why the current approach won't work, though, so looks ok too.
unittests/clangd/CodeCompleteTests.cpp | ||
---|---|---|
2081 ↗ | (On Diff #195975) | are we missing # here? |
Comment Actions
@sammccall I'm sorry but I had to revert this to fix the buildbots: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/47684/
Comment Actions
No worries, thanks for reverting.
I think this is just a bad assert, I'll fix it and reland.