For some cases, GoToDefinition will navigate to the forward class
declaration, we should always navigate to the class definition.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
clangd/XRefs.cpp | ||
---|---|---|
54 ↗ | (On Diff #128399) | Can you add some motivation here? e.g. the forward decl example |
Comment Actions
With more test, it turns out that ASTNode.OrigD is not always pointed to the definition, so we can't rely on D or ASTNode.OrigD :(.
I revised the way of checking definition, it should works for major cases. Please review it again.
clangd/XRefs.cpp | ||
---|---|---|
68 ↗ | (On Diff #128501) | That seems like a useful helper on its own, maybe create a helper called Decl* getDefinition(Decl* D) and use it instead? |
clangd/XRefs.cpp | ||
---|---|---|
68 ↗ | (On Diff #128501) | Good point! |