We scrape the enclosing scopes from the source file, and use them in the query.
Details
Diff Detail
- Repository
- rCTE Clang Tools Extra
- Build Status
Buildable 30947 Build 30946: arc lint + arc unit
Event Timeline
clangd/SourceCode.cpp | ||
---|---|---|
503 | 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 | scopesForIndexQuery already de-duplicates. Do you plan to have any other users for the results of this function? | |
clangd/SourceCode.h | ||
169 | Does the code ever make use of it? | |
unittests/clangd/SourceCodeTests.cpp | ||
325 | NIT: maybe switch to TEST_P ? |
Add comments, add anon-namespacce test, tighten parsing rules slightly (namespace ::... is illegal)
clangd/SourceCode.cpp | ||
---|---|---|
503 | Right, this was intended. Added a comment and a test. | |
595 | Only unit tests. | |
clangd/SourceCode.h | ||
169 | 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 | 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 | 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. |
Does the code ever make use of it?