BatchExecutionResult (@NotNull final Project project, @NotNull final GlobalInspectionContextImpl context, final CommonProblemDescriptor @NotNull [] descriptors, @NotNull final Set<? super PsiElement> ignoredElements) { if (myFix instanceof BatchQuickFix) { final List<PsiElement> collectedElementsToIgnore = new ArrayList<>(); final Runnable refreshViews = () -> { DaemonCodeAnalyzer.getInstance(project).restart(); for (CommonProblemDescriptor descriptor : descriptors) { ignore(ignoredElements, descriptor, getWorkingQuickFix(descriptor.getFixes()) != null, context); } final RefManager refManager = context.getRefManager(); final RefElement[] refElements = new RefElement[collectedElementsToIgnore.size()]; for (int i = 0, collectedElementsToIgnoreSize = collectedElementsToIgnore.size(); i < collectedElementsToIgnoreSize; i++) { refElements[i] = refManager.getReference(collectedElementsToIgnore.get(i)); } removeElements(refElements, project, myToolWrapper); }; Runnable fixApplicator = () -> ((BatchQuickFix)myFix).applyFix(project, descriptors, collectedElementsToIgnore, refreshViews); if (myFix.startInWriteAction()) { WriteCommandAction.writeCommandAction(project).run(() -> { fixApplicator.run(); }); } else { fixApplicator.run(); } return ModCommandExecutor.Result.SUCCESS; } boolean restart = false; BatchExecutionResult result = ModCommandExecutor.Result.NOTHING; for (CommonProblemDescriptor descriptor : descriptors) { if (descriptor == null) continue; final QuickFix<?>[] fixes = descriptor.getFixes(); if (fixes != null) { final QuickFix fix = getWorkingQuickFix(fixes); if (fix != null) { if (fix instanceof ModCommandQuickFix modCommandQuickFix) { ProblemDescriptor problemDescriptor = (ProblemDescriptor)descriptor; ModCommand command = modCommandQuickFix.perform(project, problemDescriptor); result = result.compose( ModCommandExecutor.getInstance().executeInBatch(ActionContext.from(problemDescriptor), command)); } else { //CCE here means QuickFix was incorrectly inherited, is there a way to signal (plugin) it is wrong? fix.applyFix(project, descriptor); result = ModCommandExecutor.Result.SUCCESS; } restart = true; ignore(ignoredElements, descriptor, true, context); } } } if (restart) { DaemonCodeAnalyzer.getInstance(project).restart(); } return result; }