How do you create a sub-item for an intention? For example "Fix all ... in file" for a given IntentionAction.

Answered

I have a bunch of intentions defined and want to have a "Fix all '...' in file" intention available as a sub-item for some of the intentions.

Can this be registered programatically by an intention or do I need to create another All In File intention for each existing intention?

Effectively, each intention gets an "Edit intention settings" and "Disable ... ". I would like to add an intention which will be applied to all matching elements in the file by delegating to the "parent" intention action.

0
2 comments

Hi Vladimir,

This should be done as inspection then, not intention. The 'fix all' will appear automatically. In order to avoid highlighting, you may want to register inspection with "No highlighting, only fix" severity (and in the plugin.xml it corresponds to INFORMATION constant)

Anna

0

Thanks Anna.

I can change these into inspections with an added benefit of having them available to users to validate their style requirements.

 

 

0

Please sign in to leave a comment.