Navigate to java from custom language
Answered
Hello,
In my custom language following structure is possible
Whereas the `field` may be either the public method (getField) or the public field (field) of class `MyClass`.
How I may implement "Navigate to" action for `field`?
Please sign in to leave a comment.
You need to return a PsiReference from getReference() of the PsiElement in your language with the PsiReference instance's resolve() method returning the PsiElement of the method or field of the class being referenced.
Then find usages and navigate to declaration will navigate to the element referenced.
If you want it to participate in the refactoring then you will need to provide an ElementManipulator for this element to allow content change for your element when the referenced element is renamed.
Also add the manipulator to the plugin.xml for example: