private void createFilesLater(@NotNull List<ModuleInfo> moduleInfos) {
    final Runnable createFiles = () -> {
      if (myProject.isDisposed()) return;
      CommandProcessor.getInstance().executeCommand(myProject, () ->
        ApplicationManagerEx.getApplicationEx().runWriteActionWithCancellableProgressInDispatchThread(
          getCommandTitle(), myProject, null,
          indicator -> createFiles(myProject, moduleInfos, indicator)), getCommandTitle(), null);
    };

    if (CoreProgressManager.shouldKeepTasksAsynchronous()) {
      ApplicationManager.getApplication().invokeLater(createFiles);
    }
    else {
      ApplicationManager.getApplication().invokeAndWait(createFiles);
    }
  }
private void createFilesLater(@NotNull List<ModuleInfo> moduleInfos)