Plugin seems to load twice

I'm developing my first IDEA (PhpStorm) plugin, but it seems to load twice when I hit Run.

I'm logging every caret position change to the console, but it logs twice each time.

Also, I'm getting the following error when I move the caret for the first time, and my code seems to break because of it:

[   9174]  ERROR -    #com.intellij.lang.Language - Language with ID 'PHP' is already registered: class com.jetbrains.php.lang.PhpLanguage


 at com.intellij.openapi.diagnostic.Logger.error(

 at com.intellij.lang.Language.<init>(

 at com.intellij.lang.Language.<init>(

 at com.intellij.lang.Language.<init>(

 at com.jetbrains.php.lang.PhpLanguage.<init>(

 at com.jetbrains.php.lang.PhpLanguage.<clinit>(

 at com.jetbrains.php.lang.psi.PhpElementType.<init>(

 at com.jetbrains.php.lang.lexer.PhpTokenTypes.<clinit>(


Line 53 of is the following:

IElementType el_type = PhpTokenTypes.STRING_LITERAL;

Do you guys have any idea what I'm doing wrong?
Comment actions Permalink

It looks like you've added the jars of the PHP plugin as a library to your module. Instead, you need to add them to the classpath of the IntelliJ IDEA SDK.

Comment actions Permalink

Thank you Dmitry, clearing the Library config indeed solved my problem.


Please sign in to leave a comment.