<!-- Generated by community/.ai/render-guides.mjs; edit community/.agents/skills/actions/SKILL.md -->
Actions
Documentation
- Action System - Architecture and usage of the action system
Best Practices
- NEVER instantiate Presentation in action constructors - Use no-argument constructors
- Use AnActionEvent#getCoroutineScope for launching suspending computations -
actionPerformed runs synchronously with event invocation and may freeze the IDE.
- Follow the convention:
1. Set the id attribute for the action in plugin.xml
2. Optionally set the icon attribute if an icon is needed
3. Set text and description in the message bundle (e.g., GitBundle.properties):
action.<action-id>.text=Translated Action Textaction.<action-id>.description=Translated Action Description
Good example:
Kotlin:
class MyAction : AnAction()
plugin.xml:
<action id="My.Action.Id"
class="my.package.MyAction"
icon="my.package.MyIcons.ICON"/>