void (@NotNull Project project, @NotNull List<CommonProblemDescriptor[]> descriptors, @NotNull GlobalInspectionContextImpl context, Set<? super PsiElement> ignoredElements) { final String templatePresentationText = getTemplatePresentation().getText(); assert templatePresentationText != null; Ref<@Nls String> messageRef = Ref.create(); CommandProcessor.getInstance().executeCommand(project, () -> { CommandProcessor.getInstance().markCurrentCommandAsGlobal(project); boolean startInWriteAction = startInWriteAction(); PerformFixesTask performFixesTask = new PerformFixesTask(project, descriptors, ignoredElements, context); if (startInWriteAction) { ((ApplicationImpl)ApplicationManager.getApplication()) .runWriteActionWithCancellableProgressInDispatchThread(templatePresentationText, project, null, performFixesTask::doRun); } else { final SequentialModalProgressTask progressTask = new SequentialModalProgressTask(project, templatePresentationText, true); progressTask.setMinIterationTime(200); progressTask.setTask(performFixesTask); ProgressManager.getInstance().run(progressTask); messageRef.set(performFixesTask.getResultMessage(templatePresentationText)); } }, templatePresentationText, null); String message = messageRef.get(); if (message != null) { BATCH_QUICK_FIX_MESSAGES.createNotification(message, NotificationType.WARNING) .notify(project); } }