IntelliJ IDEA 8.0 (codename "Diana") went through a major refactoring of the plugin API in order to decouple core platform functionality from Java support. This breaks compatibility for many third-party plugins. This page describes the major API changes and the steps required to correct them.
This list is not exhaustive; if you run into a problem which is not described here, feel free to ask for help on the OpenAPI forum.
Language split into extensions
The com.intellij.lang.Language class no longer contains getters for different sub-components of custom language support. Instead, these sub-components are now registered as independent extensions.
PsiElementVisitor and PsiRecursiveElementVisitor split
The PsiElementVisitor interface no longer includes members for visiting all Java, JSP and XML elements. Instead, separate classes (JavaElementVisitor, XmlElementVisitor and so on) are used for different languages.
Java dependencies extracted from core PSI classes
Java-related methods moved from PsiManager to JavaPsiFacade, from PsiDirectory to JavaDirectoryService, from CodeStyleManager to JavaCodeStyleManager. PsiElementFactory has been split into multiple factories for different languages.
12 Comments
Bas Leijdekkers
JavaDirectoryService.getInstance(directory.getProject()).getPackage(directory)
should be
JavaDirectoryService.getInstance().getPackage(directory)
Dmitry Jemerov
Fixed, thanks.
Sascha Weinreuter
The PsiElementVisitor changes are pretty evil because they tend to break existing code while it may still compile and even run without throwing obvious errors. I think this should be explicitly mentioned in the above section.
An even better solution might have been to intoduce a new "PsiElementVisitorBase" and make the old PsiElementVisitor final/deprecated. This would ensure that existing and now incorrect code neither compiles nor runs without throwing some obvious errors (IncompatibleClassChangeError?).
Sascha
Sascha Weinreuter
HighlighterColors.JAVA_KEYWORD
->SyntaxHighlighterColors.KEYWORD
should be added as well.Sascha Weinreuter
com.intellij.openapi.vfs.VfsUtil.getModuleForFile()
has been (re)moved:->
Sascha Weinreuter
It might also be worth to add this:
->
This one took a while to figure out.
Dmitry Jemerov
Added last 3 items, thanks.
Anonymous
com.intellij.openapi.vcs.checkin.CheckinEnvironment has a new method
> keepChangeListAfterCommit
Not sure what to return to have the same behaviour as Demetra ?
Dmitry Jemerov
return true;
thisum
Does anybody know the substitute method for UsageViewImplUtil.runProcessWithProgress( )
Osvaldo Andrade Neto
Hi guys,
After almost 8 years, i've decided to come back working on a new version of IntelliME Plugin and i realized some of the classes and methods are not available anymore. This page helped me a LOT but i do still have some issues in mind:
I do really appreciate any help.
Thank you!
Anna Kozlova
1. As far as I can see from the fragment you've posted you can use com.intellij.openapi.graph.builder.GraphBuilder#getNodeObject. I don't know what did the Util method though, sorry
2. Please use com.intellij.ProjectTopics#PROJECT_ROOTS instead of moduleRootlistener attachement.