sammccall added a comment.

In D83501#2148671 <https://reviews.llvm.org/D83501#2148671>, @dgoldman wrote:

> I implemented goto-definition from Foo() --> Foo impl in Xrefs, on the 
> symbolcollector side I don't think there's anything to do?


This can't be done purely in xrefs as the AST may not be available.

A.m: `@class Foo; ^Foo x;` <-- go-to-definition at ^
B.m: `@interface Foo...@end @implementation Foo...@end`

The index needs to know that for the USR associated with the @class (found by 
targetDecl), the canonical decl is the @interface in B and the definition is 
the @implementation in B.
So SymbolCollector needs to see it as a definition. **The tests seem to show it 
does already**, but it's not obvious why from the code. Do you know? Maybe it's 
the fact that they share a USR and thus a symbol ID. This is worth making 
explicit somewhere.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83501/new/

https://reviews.llvm.org/D83501



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to