Search in sources :

Example 1 with SpellCheckerQuickFix

use of com.intellij.spellchecker.quickfixes.SpellCheckerQuickFix in project intellij-community by JetBrains.

the class SpellingPopupActionGroup method extractActions.

private static void extractActions(List<HighlightInfo.IntentionActionDescriptor> descriptors, Map<Anchor, List<AnAction>> actions) {
    for (HighlightInfo.IntentionActionDescriptor actionDescriptor : descriptors) {
        IntentionAction action = actionDescriptor.getAction();
        if (action instanceof QuickFixWrapper) {
            QuickFixWrapper wrapper = (QuickFixWrapper) action;
            LocalQuickFix localQuickFix = wrapper.getFix();
            if (localQuickFix instanceof SpellCheckerQuickFix) {
                SpellCheckerQuickFix spellCheckerQuickFix = (SpellCheckerQuickFix) localQuickFix;
                Anchor anchor = spellCheckerQuickFix.getPopupActionAnchor();
                SpellCheckerIntentionAction popupAction = new SpellCheckerIntentionAction(action);
                List<AnAction> list = actions.get(anchor);
                if (list != null) {
                    list.add(popupAction);
                }
            }
        }
    }
}
Also used : SpellCheckerQuickFix(com.intellij.spellchecker.quickfixes.SpellCheckerQuickFix) IntentionAction(com.intellij.codeInsight.intention.IntentionAction) HighlightInfo(com.intellij.codeInsight.daemon.impl.HighlightInfo) LocalQuickFix(com.intellij.codeInspection.LocalQuickFix) QuickFixWrapper(com.intellij.codeInspection.ex.QuickFixWrapper)

Aggregations

HighlightInfo (com.intellij.codeInsight.daemon.impl.HighlightInfo)1 IntentionAction (com.intellij.codeInsight.intention.IntentionAction)1 LocalQuickFix (com.intellij.codeInspection.LocalQuickFix)1 QuickFixWrapper (com.intellij.codeInspection.ex.QuickFixWrapper)1 SpellCheckerQuickFix (com.intellij.spellchecker.quickfixes.SpellCheckerQuickFix)1