void (@NotNull Project project) { Application app = ApplicationManager.getApplication(); if (app.isHeadlessEnvironment() || app.isUnitTestMode()) { return; } List<VirtualFile> changedFiles = findVirtualFiles(myChangedFiles); if (!changedFiles.isEmpty()) { EditAction.editFilesAndShowErrors(project, changedFiles); } List<VirtualFile> createdFiles = findVirtualFiles(myCreatedFiles); if (!containsFilesUnderVcs(createdFiles, project)) { return; } ApplicationManager.getApplication().invokeLater(() -> { Collection<VirtualFile> selected = AbstractVcsHelper.getInstance(project) .selectFilesToProcess(createdFiles, VcsBundle.message("dialog.title.files.created"), VcsBundle.message("label.select.files.to.be.added.to.version.control"), null, null, VcsShowConfirmationOption.STATIC_SHOW_CONFIRMATION); if (selected != null && !selected.isEmpty()) { ChangeListManagerEx changeListManager = ChangeListManagerEx.getInstanceEx(project); changeListManager.addUnversionedFiles(null, new ArrayList<>(selected)); } }, ModalityState.nonModal(), project.getDisposed()); }