Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
228 | In the future, I can envision expanding this to return additional information, possibly the AST node itself. For now, I just started with a boolean. |
Thanks for your patience!
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
154 | shovelling this IsDependentName bool around seems a bit ad-hoc. The actual node doesn't live long enough, but can you make it an ASTNodeKind instead, and move the isDependentName check down to locateTextually where it makes sense to be that specific? | |
354 | This sentence is hard to parse now, and also doesn't really justify the behaviour. | |
575–577 | the way the two (possible!) writes get combined is not obvious here. I'd suggest using two different variables and writing IsDependent || IsNearbyIdentDependent in the usage below, if that's the intent. | |
clang-tools-extra/clangd/unittests/XRefsTests.cpp | ||
665–666 | move these into the header so it can't be identifier-based heuristics? (And so the test doesn't change behaviour when we turn that on) | |
693 | this has a loop but only one test... | |
780 | this looks like a very close superset of TextualDependent, do we need both? Again, these decls should move into the header I think. |
Address review comments
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
575–577 | Good catch. There's actually no point letting this second locateASTReferent() call set IsDependentName, because IsDependentName only changes the outcome if the original location was an expanded token, but findNearbyIdentifier() bails in that case. So now I just pass nullptr instead. (We could work harder and make "comment referencing nearby dependent name" work, but I think that's enough of an edge that I didn't bother.) |
This breaks tests on Windows: http://45.33.8.238/win/13855/step_9.txt
Please take a look and revert while you do if it takes a while to investigate.
shovelling this IsDependentName bool around seems a bit ad-hoc. The actual node doesn't live long enough, but can you make it an ASTNodeKind instead, and move the isDependentName check down to locateTextually where it makes sense to be that specific?