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

java.lang.Throwable

 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:115)

 at com.intellij.lang.Language.<init>(Language.java:80)

 at com.intellij.lang.Language.<init>(Language.java:65)

 at com.intellij.lang.Language.<init>(Language.java:61)

 at com.jetbrains.php.lang.PhpLanguage.<init>(PhpLanguage.java:13)

 at com.jetbrains.php.lang.PhpLanguage.<clinit>(PhpLanguage.java:10)

 at com.jetbrains.php.lang.psi.PhpElementType.<init>(PhpElementType.java:24)

 at com.jetbrains.php.lang.lexer.PhpTokenTypes.<clinit>(PhpTokenTypes.java:28)

 at com.xyz.intention.XYZ.isAvailable(XYZ.java:53)

Line 53 of XYZ.java is the following:


IElementType el_type = PhpTokenTypes.STRING_LITERAL;

Do you guys have any idea what I'm doing wrong?
2 comments
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.

0
Comment actions Permalink

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

0

Please sign in to leave a comment.