void (@NotNull List<? extends ReplacementInfo> infos, @NotNull ProgressIndicator indicator) { indicator.setIndeterminate(false); try { final int size = infos.size(); VirtualFile lastFile = null; for (int i = 0; i < size; i++) { indicator.checkCanceled(); indicator.setFraction((float)(i + 1) / size); final ReplacementInfo info = infos.get(i); final PsiElement element = info.getMatch(0); if (element == null) { continue; } final VirtualFile vFile = element.getContainingFile().getVirtualFile(); if (vFile != null && !vFile.equals(lastFile)) { indicator.setText2(vFile.getPresentableUrl()); lastFile = vFile; } ProgressManager.getInstance().executeNonCancelableSection(() -> { final PsiElement affectedElement = doReplace(info); if (affectedElement != lastAffectedElement) { if (lastAffectedElement != null) reformatAndPostProcess(lastAffectedElement); lastAffectedElement = affectedElement; } }); } } finally { ProgressManager.getInstance().executeNonCancelableSection(() -> reformatAndPostProcess(lastAffectedElement)); } }