We used to query the index when completing after class qualifiers,
e.g. 'ClassName::^'. We should not do that for the same reasons we
don't query the index for member access expressions.
Details
Diff Detail
- Repository
- rCTE Clang Tools Extra
Event Timeline
clangd/CodeComplete.cpp | ||
---|---|---|
810 | we could use a high level comment here explaining what the rest of the function is about. e.g. // We also avoid ClassName::bar (but allow namespace::bar). or just take the "we only query the index" comment, hoist it a bit, and generalize it (to not assume we're in name:: context) | |
826 | (nit: this seems like undue weight, and could just be a trailing line comment // Unresolved inside a template) | |
unittests/clangd/CodeCompleteTests.cpp | ||
829 | Can we avoid disabling clang-format here? I do find it useful, and it adds noise. | |
837 | I think you should also include "Foo::SomeNameInTheIndex" in the index. At first glance this doesn't seem to actually test all the failure modes (though I think it tested the one we actually had) | |
845 | I think one of these would be enough, but up to you |
- Address review comments
unittests/clangd/CodeCompleteTests.cpp | ||
---|---|---|
829 | Thanks! I struggled to rewrite code in a way that makes clang-format happy. | |
845 | Those test different kinds of NestedNameSpecifiers (Type, TypeSpecWithTemplate and Identifier), so I'd keep all of them to make sure we have good coverage on that front. |
we could use a high level comment here explaining what the rest of the function is about. e.g.
// We also avoid ClassName::bar (but allow namespace::bar).
or just take the "we only query the index" comment, hoist it a bit, and generalize it (to not assume we're in name:: context)