Extending ImplicitPropertyUsageProvider on a plugin crashes the IDE
Answered
Hello,
This is my first attempt on making an Intellij plugin.
Its goal is to search in all java files in a project for properties strings and to mark them as used.
Idea already does something like that, but it does not support different patterns. Ex: {@@property.name}
I found out about the class ImplicitPropertyUsageProvider and tried implementing it. The IDE shows the loading screen and "disappears". Its process is still open.
Impl: https://paste.md-5.net/ojepuzuyud.java
plugin.xml: https://paste.md-5.net/ududimacuv.xml
Logs: Upload id: 2020_09_07_YKSFfJGkEHcPMBBP (files: idea.log.1 and 2 more)
Maybe I am doing a heavy operation?
Please sign in to leave a comment.
Your plugin.xml must have something like
<extensions defaultExtensionNs="com.intellij">
<properties.implicitPropertyUsageProvider implementation="your.class.name"/>
</extensions>
See https://jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_extensions.html
Yann Cebron
It gives me this error:
Element properties.ImplicitPropertyUsageProvider is not allowed here
You must also add dependency on Properties plugin to be able to use this extension point.
https://jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html
Plugin ID
Yann Cebron
plugin.xml: https://paste.md-5.net/huxuderogi.xml
The element error on plugin.xml is gone, but the IDE still won't boot after I install the plugin.
What is error in idea.log?
https://pastebin.com/4WE2YyYB
I can't see anything obviously related to your plugin. Please share full sources of your plugin to reproduce.
Source: https://github.com/RoinujNosde/ACFPropertiesUsagesProvider
Found the problem!
I was importing the Properties plugin manually. Using setPlugins("properties") fixes it.
Thank you for the support!