go to definition by url and offset

Answered

Hello guys, I am developing a new plugin, I need a function that takes two parameters, the first one is the url to a given file and the second one is the offset of given reference, that function will return the location of the defined reference, is there something I can use ? so that I do not recreate another compiler for my use case...
thank you a lot :D
 

1 comment
Comment actions Permalink

Use PsiViewer to understand the structure of the source, then look for PsiReference and resolve() will take you to the declaration (http://www.jetbrains.org/intellij/sdk/docs/reference_guide/custom_language_support/references_and_resolve.html)

Then you can use resolved PsiElement#getTextOffset/getContainingFile etc.

0

Please sign in to leave a comment.