We now hide the static/dynamic split from the code completion, behind a
new implementation of the SymbolIndex interface. This will reduce the
complexity of the sema/index merging that needs to be done by
CodeComplete, at a fairly small cost in flexibility.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clangd/index/Merge.cpp | ||
---|---|---|
29 ↗ | (On Diff #129804) | Maybe add another FIXME, saying filer out symbols in static index, but are removed in dynamic index? |
34 ↗ | (On Diff #129804) | IIUC, Dyn is a local variable, which holds all the underlying data of Symbol, the Symbol returned in the callback of fuzzyFind would be invalid after the fuzzyFind(..) function call is finished. Our previous assumption is that Symbol is valid as long as the SymbolIndex exists? |
75 ↗ | (On Diff #129804) | Don't we need CompletionDetail? |
Fixed bug where we wrote into the underlying index's symbols.
Extended testcase.
Added documentation around contracts.
clangd/index/Merge.cpp | ||
---|---|---|
29 ↗ | (On Diff #129804) | Done (function-level comment, because it's not a localized fix) |
34 ↗ | (On Diff #129804) |
No, it's only valid for the callback. Valid for the life of the index would make life hard for remote indexes. |
75 ↗ | (On Diff #129804) | Sure. I was assuming it wasn't optional (should be present and match if USR matches), but i'm not 100% sure. |
75 ↗ | (On Diff #129804) | This was a bug. It'd be caught by marking Symbol::Detail const. Added a TODO. |