I need to use PsiManager but I'm getting the following error in my dependencies Follow
Answered
1:18 μ.μ. Plugin error
Plugin ... requires plugin 'com.intellij.modules.java' to be installed
These are all my dependencies. The second one seems to have the problem.
However in IntelliJ IDEA works fine when I run the plugin.
The error happens when I install it in my PhpStorm and restart to be enabled
PhPStorm 2021.1.4
<depends>com.intellij.modules.lang</depends> <!-- 1st -->
<depends>com.intellij.modules.java</depends> <!-- for psi -->
Please sign in to leave a comment.
I just figured out that the issue was that I used com.intellij.modules.java to get list of methods (PsiMethod) which are supported in java only.
But how can I give support to multiple IDEs to get list of java/kotlin/python/ruby/ts/es6/js/php classes, functions and/or methods? as seen in Structure tool window. I need names and line positions as well.
Here I can see the available dependings that can be used as optional for each ide. But what is the PsiMethod, PsiFunction and PsiClass for each language?
https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html#modules-specific-to-functionality
Hi Alex,
The easiest way to get class names for these elements is to use PsiViewer to inspect a PSI structure for files in languages of your interest. Please see:
https://plugins.jetbrains.com/docs/intellij/explore-api.html#31-use-internal-mode-and-psiviewer
on how to enable it.
Also, take a look at other sections in Part VIII - Product Specific section, eg.:
Thanks again,
but I am very confused.
I have used PSIViewer and I see the classes of each psi element, but I dont understand how to get access to them while I am developing.
For example how do I get access to package containing KtClass ? what library should I import to my plugin,
and how to get access also to
com.jetbrains.php.lang.psi.elements.impl.MethodImpl
class com.intellij.lang.ecmascript6.psi.impl.ES6ClassImpl
class com.intellij.lang.javascript.psi.impl.JSFunctionImpl
com.intellij.lang.javascript.psi.ecma6.impl.TypeScriptFunctionImpl
com.jetbrains.cldr.lang.psi.impl.OCFunctionDefinitionImpl
Hi Alex,
Let's do it step by step for PHP then.
gradle-intellij-plugin
properties should be configured, so you have to include these values in yourbuild.gradle.kts
file (if you created your project from the template, you should change proper properties ingradle.properties
file):plugin.xml
file:And that's it, PHP classes will be available in your project.
my plugin is not Gradle-based and is written in java.
Is grandle necessary? because I have never used it before...
Hi Alex,
Gradle is highly recommended for plugin development. Please see:
If you still want to use your approach (I assume it's DevKit), please follow these steps to set up plugin dependencies: https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html#2-project-setup (Notice "DevKit" tab).