When scopes are specified, only match symbols from scopes.
Details
Diff Detail
- Repository
- rCTE Clang Tools Extra
- Build Status
Buildable 13243 Build 13243: arc lint + arc unit
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 | ||
---|---|---|
127 | 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. | |
133 | 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 | ||
30 | 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 | ||
---|---|---|
128 | 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 | ||
39 | This is too early - we may not actually have an N+1th match :-( | |
clangd/index/SymbolCollector.cpp | ||
63 ↗ | (On Diff #127478) | If you'll never have leading ::, assert that. |
unittests/clangd/FileIndexTests.cpp | ||
127 ↗ | (On Diff #127478) | 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.