public static void updateAddedFiles(List<? extends PsiFile> added, @NotNull List<? extends PsiFile> originals) {
    if (added.isEmpty()) return;
    Project project = added.get(0).getProject();
    DumbService dumbService = DumbService.getInstance(project);
    if (Registry.is("run.refactorings.under.progress")) {
      ApplicationManagerEx.getApplicationEx().runWriteActionWithCancellableProgressInDispatchThread(
        RefactoringBundle.message("progress.title.update.added.files"), project, null, pi -> dumbService.runWithAlternativeResolveEnabled(() -> UpdateAddedFileProcessor.updateAddedFiles(added, originals)));
    }
    else {
      WriteAction.run(() -> dumbService.runWithAlternativeResolveEnabled(() -> UpdateAddedFileProcessor.updateAddedFiles(added, originals)));
    }
  }
public static void updateAddedFiles(List<? extends PsiFile> added, @NotNull List<? extends PsiFile> originals)