When scopes are specified, only match symbols from scopes.
Details
Diff Detail
- Repository
- rCTE Clang Tools Extra
Event Timeline
Nice, thanks!
Some suggestions for further tightening the semantics, I'm happy to do these as a followup if you think it's too invasive here.
clangd/index/Index.h | ||
---|---|---|
130 | If i'm reading this right, you still support fuzzy-matching the scopes (scope information can be in Query, or Scopes, or both). Why? Semantics would be simpler if query matched the identifier only. | |
135 | nit: can we choose one?
Allowing multiple options is somewhat confusing to callers and puts a bigger burden on implementers of this interface. | |
clangd/index/MemIndex.cpp | ||
31–33 | Rather than doing tricky matches against QName, it may be simpler to split Symbol::QName into Symbol::Scope + Symbol::Name. In addition to this becoming exact string matching without parsing, the Symbol::Scopes will have lots of duplicates that can share storage, reducing the size of each Symbol. WDYT? |
just nits, all this stuff up to you
clangd/index/Index.h | ||
---|---|---|
131 | I think the rest of the comment isn't needed now - the first two sentences are enough (plus the comment on Scopes) | |
clangd/index/MemIndex.cpp | ||
38 | This is too early - we may not actually have an N+1th match :-( | |
clangd/index/SymbolCollector.cpp | ||
63 | If you'll never have leading ::, assert that. | |
unittests/clangd/FileIndexTests.cpp | ||
127 | nit: i usually find Req.Scopes = {"ns"} more clear, up to you |
If i'm reading this right, you still support fuzzy-matching the scopes (scope information can be in Query, or Scopes, or both). Why? Semantics would be simpler if query matched the identifier only.