NoClassDefFoundError with "psiMethod"

Answered

I was trying to use the "psi demo example" in github in my plugin

https://github.com/JetBrains/intellij-sdk-docs/blob/master/code_samples/psi_demo/src/main/java/org/intellij/sdk/psi/PsiNavigationDemoAction.java

It compiles, ok but when executing I have :

2020-07-24 18:08:16,338 [ 11440] ERROR - llij.ide.plugins.PluginManager - com/intellij/psi/PsiMethod
java.lang.NoClassDefFoundError: com/intellij/psi/PsiMethod

I'm using Intellij ultimate 2020.1 (Build #IU-201.8743.12)

Any clues ?

 

8 comments
Comment actions Permalink

I have the same problem with "PsiClass" or "PsiClassImpl" or "PsiMethodImpl"

But "PsiNamedElement" or "PsiNameIdentifierOwner" works ok

For the PsiClass, if in the debugger I do "vPsiClass.getClass()", I will have :

"com.intellij.lang.ecmascript6.psi.impl.ES6ClassImpl"

I tried to "import it", but com.intellij.lang doesn't have a "ecmascript6" ???

0
Comment actions Permalink

Do you have the following dependency set in your plugin.xml?

<depends>com.intellij.modules.java</depends>
 
0
Comment actions Permalink

My "depends" entry was

<depends>com.intellij.modules.platform</depends>


So I changed to the one you suggested. Now my code execute correctly, but it doesn"t find any "current method" or "current class", I'm using ES6 JavaScript

 

0
Comment actions Permalink

ES6ClassImpl is available in the JavaScript plugin. You have to add the dependency to the JavaScript plugin both in your Gradle and plugin.xml. Keep in mind, that it's available in IntelliJ Ultimate only:

intellij {
type = "IU"
setPlugins("JavaScript")
}
0
Comment actions Permalink

Sorry but how to I add 

intellij {
type = "IU"
setPlugins("JavaScript")
}

to my plugin.xml ?

For Gradle i'm not using it 

 

0
Comment actions Permalink

The above snippet should be applied to the Gradle configuration.

0
Comment actions Permalink

What about plugin.xml ?

0
Comment actions Permalink

As mentioned above - dependency is called JavaScript for both.

0

Please sign in to leave a comment.