How to create multiple IntentionActions?
Answered
Implementing IntentionAction and adding it to plugin.xml creates one yellow bulb intention. I'm taking the following project as an example: https://github.com/JetBrains/intellij-sdk-docs/tree/master/code_samples/conditional_operator_intention.
However, I couldn't find a way to create many intentions.
Please help.
Please sign in to leave a comment.
I'm not sure what the problem is - you can provide as many different IntentionActions as you need in your plugin?
Thanks for replying.
I figured out how to create a single intention, I did exactly as the example.I can also create many IntentionActions, but I have to define each one of them in the plugin.xml. The problem is - I don't know how many of them I'll need to create.
My goal is - I want to dynamically create IntentionActions. In other words - When the user clicks on alt+enter, the code will figure out which IntentionAction to create, according to some criteria. The text of the IntentionActions will depend on where the user clicked.
Is that functionality possible?
Please see sample http://www.jetbrains.org/intellij/sdk/docs/tutorials/code_intentions.html
Maybe you want to create an inspection and provide a dynamic list of quickfixes (similar to intention) instead? http://www.jetbrains.org/intellij/sdk/docs/reference_guide/custom_language_support/code_inspections_and_intentions.html and http://www.jetbrains.org/intellij/sdk/docs/tutorials/code_inspections.html
Thanks! It helped!