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?

9 comments
Comment actions Permalink

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

0
Comment actions Permalink

Yann Cebron

<extensions defaultExtensionNs="com.intellij">
<properties.ImplicitPropertyUsageProvider
implementation="com.github.roinujnosde.acfpropertiesusagesprovider.extentionpoints.ACFImplicitPropertyUsageProvider"/>
</extensions>

 

It gives me this error:

Element properties.ImplicitPropertyUsageProvider is not allowed here

0
Comment actions Permalink

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

<depends>com.intellij.properties</depends>

 

 

 

0
Comment actions Permalink

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.

0
Comment actions Permalink

What is error in idea.log?

0
Comment actions Permalink

I can't see anything obviously related to your plugin. Please share full sources of your plugin to reproduce.

0
Comment actions Permalink

Found the problem!

I was importing the Properties plugin manually. Using setPlugins("properties") fixes it.

 

Thank you for the support!

0

Please sign in to leave a comment.