Child pages
  • Diana Plugin Migration Guide
Skip to end of metadata
Go to start of metadata

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.

before
after
before
after

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.

before
after

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.

before
after

Search methods removed from PsiSearchHelper

before
after

PSI stuff removed from Project

before
after

ProjectJdk collapsed into Sdk

Compiler-related methods removed from ModuleRootManager

before
after

Execution API refactoring

Charset API refactoring

before
after

PeerFactory deprecated

before
after

HighlighterColors split

before
after

KeymapExtension API refactored

VFS decoupled from Module

before
after

ModuleServiceManager separated from ServiceManager

before
after
  • No labels

12 Comments

  1. JavaDirectoryService.getInstance(directory.getProject()).getPackage(directory)
    should be
    JavaDirectoryService.getInstance().getPackage(directory)

  2. 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

  3. HighlighterColors.JAVA_KEYWORD -> SyntaxHighlighterColors.KEYWORD should be added as well.

  4. com.intellij.openapi.vfs.VfsUtil.getModuleForFile() has been (re)moved:

    ->

  5. It might also be worth to add this:

    ->

    This one took a while to figure out.

    1. Added last 3 items, thanks.

  6. Anonymous

    com.intellij.openapi.vcs.checkin.CheckinEnvironment has a new method

     > keepChangeListAfterCommit

    Not sure what to return to have the same behaviour as Demetra ?

  7. Does anybody know the substitute method for UsageViewImplUtil.runProcessWithProgress( )

  8. 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:

    "1. Missing GraphWrapperUtil"
    "2. Missing addModuleRootListener(...)"

    I do really appreciate any help.

    Thank you!

    1. 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.