When parser backtracks, we might receive multiple code completion
callbacks.
Previously we had a failing assertion there, now we take first results
and hope they are good enough.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
As a follow-up to an offline discussion: I opted for not excluding results from 'Recovery' contexts, because they are actually somewhat semantically relevant (i.e. contain only local variables from the current function). One example where this is useful are skipped PP branches (see CompleteInExcludedPPBranch test).
clangd/CodeComplete.cpp | ||
---|---|---|
454 ↗ | (On Diff #138702) | Suggest some hint in the log that helps readers who don't know the code structure. (It's easy to find the code structure by searching. E.g. "Multiple code complete callbacks (parser backtracked?). Dropping results from context {0}, keeping results from {1}." |
unittests/clangd/CodeCompleteTests.cpp | ||
623 ↗ | (On Diff #138702) | dead code? delete it or add an assertion |