AbstractPerformFixesTask (@NotNull Project project, @NlsContexts.DialogTitle @NotNull String presentationText, @NotNull List<? extends ProblemDescriptor> descriptions, @Nullable Class<?> quickfixClass, boolean startInWriteAction, boolean markGlobal) { final boolean isBatch = quickfixClass != null && BatchQuickFix.class.isAssignableFrom(quickfixClass); final AbstractPerformFixesTask fixesTask = isBatch ? new PerformBatchFixesTask(project, descriptions.toArray(ProblemDescriptor.EMPTY_ARRAY), quickfixClass) : new PerformFixesTask(project, descriptions, quickfixClass); CommandProcessor.getInstance().executeCommand(project, () -> { if (markGlobal) CommandProcessor.getInstance().markCurrentCommandAsGlobal(project); if (quickfixClass != null && startInWriteAction) { ((ApplicationImpl)ApplicationManager.getApplication()) .runWriteActionWithCancellableProgressInDispatchThread(presentationText, project, null, fixesTask::doRun); } else { final SequentialModalProgressTask progressTask = new SequentialModalProgressTask(project, presentationText, true); progressTask.setMinIterationTime(200); progressTask.setTask(fixesTask); ProgressManager.getInstance().run(progressTask); } }, presentationText, null); return fixesTask; }