For some cases, GoToDefinition will navigate to the forward class
declaration, we should always navigate to the class definition.
Details
Diff Detail
- Repository
- rCTE Clang Tools Extra
- Build Status
Buildable 13463 Build 13463: arc lint + arc unit
Event Timeline
clangd/XRefs.cpp | ||
---|---|---|
54 | Can you add some motivation here? e.g. the forward decl example |
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 | ||
---|---|---|
59 | 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 | ||
---|---|---|
59 | Good point! |
Can you add some motivation here? e.g. the forward decl example