Plugins run in the IDE, how do I load the classes of other plugins?

Answered

My plugin runs in an IDE. Assuming this IDE has both my plugin and a YAML plugin installed simultaneously, can my plugin load classes from the YAML plugin without explicitly importing the YAML plugin?

0
3 comments

To use classes from other plugins, a dependency must declared explicitly. See https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html for detailed instructions.

0

My plugin is built on IntelliJ IDEA 2022.1.4. For example, if I want to use JsonPath functionality, I can simply call it directly (as the JsonPath-related classes are still part of the IDEA SDK in that version).

However, when the plugin is used on later versions, JsonPath has been extracted from IDEA. Therefore, I can't utilize JsonPath functionality in newer versions. Furthermore, I seem unable to explicitly declare the JsonPath plugin in 2022.1.4.

I'm wondering if there's a way to achieve version compatibility for this issue?

0

The only way is to build and release distinct versions of your plugin, each targeting specific IDE range and necessary setup/dependency declaration in plugin.xml.

https://plugins.jetbrains.com/docs/intellij/api-changes-list-2023.html#json-path-plugin-20232 

0

Please sign in to leave a comment.