Skip to main content

actions

Implement or change IntelliJ `AnAction` actions and registrations.

Aller à l'installation

Informations de source

Dépôt
JetBrains/intellij-community
Dernière activité de la source
23 juillet 2026 à 15:01
Langue détectée de SKILL.md
anglais
Étoiles
20 445
Forks
6 009

Options d'installation

Le prompt qui vérifie d'abord la source est sélectionné par défaut. Vous pouvez passer à une commande directe ou télécharger une copie locale.

Vérifiez les fichiers source

Lisez SKILL.md et les fichiers associés affichés par SkillsMP avant de décider de l'installer.

Affichage de SKILL.md

SKILL.md
Instructions source · Aperçu en lecture seule
name
actions
description
Implement or change IntelliJ `AnAction` actions and registrations.
<!-- Generated by community/.ai/render-guides.mjs; edit community/.agents/skills/actions/SKILL.md --> # Actions Guidelines for implementing IntelliJ actions (`AnAction`). ## Documentation - [Action System](../../../../docs/IntelliJ-Platform/4_man/Action-System.md) - Architecture and usage of the action system ## Best Practices - **NEVER instantiate Presentation in action constructors** - Use no-argument constructors - **Define text, description, and icon in plugin.xml** - Not in constructor parameters - **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 Text` - `action.<action-id>.description=Translated Action Description` **Good example:** Kotlin: ```kotlin class MyAction : AnAction() ``` plugin.xml: ```xml <action id="My.Action.Id" class="my.package.MyAction" icon="my.package.MyIcons.ICON"/> ``` Bundle.properties: ```properties action.My.Action.Id.text=My Action action.My.Action.Id.description=Description of my action ```
Voir sur GitHub