Custom Language plugin file traversal

Greetings!

I am working on a custom language plugin. First off I want to say that it is great that you have exposed such a rich feature set. Additionally the plugin development has been fairly straightforward so far.

My current problem is that I am trying to resolve a reference to another file in the tree. I'm able to make a ContentIterator and traverse the files (as VirtualFiles), but how do I obtain the PsIFileBase associated with that file so I can traverse the PSI? Or is there some other mechanism I should use to be able to get into the PSI for that file?

Thanks!
-Andrew

1 comment
Comment actions Permalink

Hello AMellinger,

I am working on a custom language plugin. First off I want to say
that it is great that you have exposed such a rich feature set.
Additionally the plugin development has been fairly straightforward so
far.

My current problem is that I am trying to resolve a reference to
another file in the tree. I'm able to make a ContentIterator and
traverse the files (as VirtualFiles), but how do I obtain the
PsIFileBase associated with that file so I can traverse the PSI? Or
is there some other mechanism I should use to be able to get into the
PSI for that file?


PsiManager.getInstance(project).findFile(VirtualFile)

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.