This reuses the type=>decl mapping from go-to-definition on auto.
(Which could stand some improvement, but that can happen later).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks. LGTM.
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
1869 | Reason for reverse isn't clear to me. Can you add a comment. | |
1880–1882 | Can you add tests for these as well. | |
1883 | I think this would be useful for enumerations primarily. Would it work as of now (would we return the enum definition loc) ? | |
1925–1927 | Can this be accommodated in typeForNode ? | |
clang-tools-extra/clangd/XRefs.h | ||
110 | This is sounds confusing to me about the current behaviour. | |
clang-tools-extra/clangd/unittests/XRefsTests.cpp | ||
1805 | Can you add a lambda as well |
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
1883 | Yes, it does work (tested manually). | |
1925–1927 | Agree. It's not convenient to do it exactly in typeForNode though, as we have to wrap every return with the unwrapping logic. | |
clang-tools-extra/clangd/XRefs.h | ||
110 | Whoops, you're right. I'd love to have this behavior but decided not to bite it off in this patch. | |
clang-tools-extra/clangd/unittests/XRefsTests.cpp | ||
1805 | Done. This isn't handled yet (lambdas are CXXRecordType, not FunctionType) so added it |
clang-tools-extra/clangd/ClangdLSPServer.cpp | ||
---|---|---|
1292 | any particular reason for jumping to declaration here, rather than using definition when it's available or was this just an oversight? because this results in us jumping to forward declarations every now and then, and I can't see any use case where a declaration would be preferred to definition of a type. |
any particular reason for jumping to declaration here, rather than using definition when it's available or was this just an oversight?
because this results in us jumping to forward declarations every now and then, and I can't see any use case where a declaration would be preferred to definition of a type.