Get file PSI in jps plugin thread
已回答
In my builder in jps thread, i have a file path.
How can i get the psi of the file here?
I have tried with:
VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByPath(filePath);
But it throws "java.lang.ClassNotFoundException: com.intellij.util.messages.Topic
请先登录再写评论。
Please clarify what you want to achieve
The language of the file (not java) i am working on, it can be such that its filename is not same as content module/class name.
In jps builder, we have listed all the source files, and have a module/class name stored in the project module.
So, i would like to be able to open each file, gets its associated psi tree info, and get the psi module/class declaration identifier to match.
If not able to do the above, i assume the only method left then is perform psi matching in ide process first, and then pass the result to jps builder via a data key value method instead?
JPS has no access to PSI/VFS, so you'll need to pass such data between the two worlds
Thanks for this clarification.
Addendum:
It is possible to pass initial data in the form of BuilderParameters: all userData from com.intellij.openapi.compiler.CompileScope is available in the JPS build as a BuildParameter from org.jetbrains.jps.incremental.CompileContext.getBuilderParameter()