mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[mod-commands] IntentionWrapper#wrapToQuickFix: support ModCommand
GitOrigin-RevId: f5fd466009065e29884767ddd824ccfc53e24cdb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b262b8affe
commit
cfe07d0d77
@@ -4,6 +4,7 @@ package com.intellij.codeInspection;
|
||||
import com.intellij.codeInsight.intention.CustomizableIntentionActionDelegate;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.codeInsight.intention.preview.IntentionPreviewInfo;
|
||||
import com.intellij.modcommand.ModCommandAction;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.fileEditor.FileEditor;
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
@@ -104,6 +105,10 @@ public class IntentionWrapper implements LocalQuickFix, IntentionAction, ActionC
|
||||
public static LocalQuickFix wrapToQuickFix(@Nullable IntentionAction action, @NotNull PsiFile file) {
|
||||
if (action == null) return null;
|
||||
if (action instanceof LocalQuickFix) return (LocalQuickFix)action;
|
||||
ModCommandAction modCommandAction = action.asModCommandAction();
|
||||
if (modCommandAction != null) {
|
||||
return LocalQuickFix.from(modCommandAction);
|
||||
}
|
||||
return new IntentionWrapper(action);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user