Different classes for reference of a PsiElement
I don't know how to explain the problem in the title post.
I have this AST:

PsiUpperSymbol is a PsiNamedElement, and I have a PsiUpperSymbolReference class with a resolve() method that works when I use the 'go to' action or the 'find usages' action on A1. because the definition and the usage are both PsiUpperSymbol.
But I want to resolve the PsiUpperSymbol A to the PsiFile A.
How can I do that when the the reference is not of the same type ?
thanks
Please sign in to leave a comment.
Sorry, I don't understand the problem. It's usually incorrect when references have the same type as declarations, they're normally very different from each other. Your PsiReference#resolve method should return the PsiElement corresponding to the declaration you want to navigate to.