registering intentions

Hi

I tried to add an intention through

IntentionManager manager = IntentionManager.getInstance(fProject);
String[] otherCategory = new String[]{"Other"};
manager.registerIntentionAndMetaData(new FooIntention(), otherCategory);

...and the intention itself works fine but I get the assertion below.

ERROR - onfig.IntentionManagerSettings - Assertion failed: Intention description directory not found: 'Foo'
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78)
at com.intellij.codeInsight.intention.impl.config.IntentionManagerSettings.registerIntentionMetaData(IntentionManagerSettings.java:7)
at com.intellij.codeInsight.intention.impl.config.IntentionManagerImpl.registerIntentionAndMetaData(IntentionManagerImpl.java:26)
at com.intellij.codeInsight.intention.impl.config.IntentionManagerImpl.registerIntentionAndMetaData(IntentionManagerImpl.java:38)
at nu.studer.idea.intention.SimpleIntentions.projectOpened(SimpleIntentions.java:26)

How can I avoid this assertion? I couldn't find any documentation in 5.0.2 on intention description directories.

Thanks for any help on this.

--Etienne

6 comments

Hello etienne,

There are descriptions for each intention in Intention Settings Dialog. Thus
you have to create directory with name corresponding to FamilyName of your
intention. This directory should contain description.html, before.java.template
and after.java.template. And the directory itself should be placed in intentionDescriptions
resource root.

Thank you.

-


Anna Kozlova
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"


0

Hi Anna

Thanks for your precise explanation. It now works fine.

To further improve documentation, maybe the 'conditionalOperatorConvertor' sample plugin could be extended to also include such an intention description folder (or I could do it and the send the files).

--Etienne

0

The IntentionPowerPack plugin has such folders (about fifty of them) and is included in the DevKit.

--Dave Griffith

0

I know, and the IPP sources really help a lot. But 50 intentions do not necessarily make it easier to recognize the pattern for someone completely new to intention plugins. And since the DevKit comes with a small sample intention plugin, why not make it complete by adding the html and template files.

0

Hello etienne,

e> To further improve documentation, maybe the
e> 'conditionalOperatorConvertor' sample plugin could be extended to
e> also include such an intention description folder (or I could do it
e> and the send the files).

Please file a JIRA request for this.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Hi Dmitry

Okay, I did:
http://www.jetbrains.net/jira/browse/IDEA-6328

Including an 'implementation' of the request.

--Etienne

0

Please sign in to leave a comment.