IntentionAndQuickFixAction (String actionId, ExtensionPoint extensionPoint) { final AnAction action = ActionManager.getInstance().getAction(actionId); assert action != null : actionId; String name = DevKitBundle.message("inspections.plugin.xml.dynamic.plugin.analyze.extension.point", action.getTemplateText(), extensionPoint.getEffectiveQualifiedName()); return new IntentionAndQuickFixAction() { @Override public @NotNull IntentionPreviewInfo generatePreview(@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) { return IntentionPreviewInfo.EMPTY; } @Nls(capitalization = Nls.Capitalization.Sentence) @NotNull @Override public String getName() { return name; } @Nls(capitalization = Nls.Capitalization.Sentence) @NotNull @Override public String getFamilyName() { return Objects.requireNonNull(action.getTemplateText()); } @Override public void applyFix(@NotNull Project project, PsiFile file, @Nullable Editor editor) { assert editor != null; action.actionPerformed(AnActionEvent.createFromDataContext(ActionPlaces.UNKNOWN, null, EditorUtil.getEditorDataContext(editor))); } }; }