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
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Mar 24, 2008

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

    1. Mar 24, 2008

      Fixed, thanks.

  2. Mar 26, 2008

    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. Mar 27, 2008

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

  4. Mar 27, 2008

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

    ->

  5. Mar 27, 2008

    It might also be worth to add this:

    ->

    This one took a while to figure out.

    1. Mar 28, 2008

      Added last 3 items, thanks.

  6. Apr 14, 2008

    Anonymous

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

     > keepChangeListAfterCommit

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

    1. Apr 14, 2008

      return true;

  7. Apr 26, 2010

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