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
- rCTE Clang Tools Extra
- Build Status
Buildable 13493 Build 13493: arc lint + arc unit
Event Timeline
clangd/XRefs.cpp | ||
---|---|---|
67–78 | 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 | ||
---|---|---|
72 | 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 | ||
---|---|---|
72 | Good point! |
That seems like a useful helper on its own, maybe create a helper called Decl* getDefinition(Decl* D) and use it instead?
It's implementation can be as short as the one we currently have for IsDefinition, since all interesting Decl types have getDefinition method.