We scrape the enclosing scopes from the source file, and use them in the query.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clangd/SourceCode.cpp | ||
---|---|---|
503 ↗ | (On Diff #196476) | I believe it is safe to ignore(just mark the opening brace) anonymous namespaces here. Since there were no comments(and no test cases) just wanted to make sure you did not miss that case. |
595 ↗ | (On Diff #196476) | scopesForIndexQuery already de-duplicates. Do you plan to have any other users for the results of this function? |
clangd/SourceCode.h | ||
169 ↗ | (On Diff #196476) | Does the code ever make use of it? |
unittests/clangd/SourceCodeTests.cpp | ||
325 ↗ | (On Diff #196476) | NIT: maybe switch to TEST_P ? |
Add comments, add anon-namespacce test, tighten parsing rules slightly (namespace ::... is illegal)
clangd/SourceCode.cpp | ||
---|---|---|
503 ↗ | (On Diff #196476) | Right, this was intended. Added a comment and a test. |
595 ↗ | (On Diff #196476) | Only unit tests. |
clangd/SourceCode.h | ||
169 ↗ | (On Diff #196476) | This is passed into the ScopeDistance, and the first scope gets a quality boost. Added a comment. I just noticed that getQueryScopes (not used on this codepath) only sometimes returns the scopes in the right order. Will fix in another patch. |
unittests/clangd/SourceCodeTests.cpp | ||
325 ↗ | (On Diff #196476) | I find TEST_P much less readable and prefer to avoid it unless absolutely necessary. |
Correctly handle absolutely qualifier (::foo::bar).
Fix seed scopes for proximity to be consistent with Sema case.
LGTM, thanks!
unittests/clangd/SourceCodeTests.cpp | ||
---|---|---|
325 ↗ | (On Diff #196476) | I just wanted to make sure we don't have more huge test cases as in Hover.All. I believe it would've helped if we've kept cases in small groups. But I guess we won't gain much here, since number of cases is not huge and I think there won't be many additions. |