void (@NotNull final VirtualFile chosenFile) { String oldText = myDirectoryTextField.getText(); super.onFileChosen(chosenFile); AbstractVcs vcs = myVCSComboBox.getItem(); if (oldText.isEmpty() && vcs != null) { new Task.Backgroundable(myProject, VcsBundle.message("settings.vcs.mapping.status.looking.for.vcs.administrative.area"), true) { private VcsDescriptor probableVcs = null; @Override public void run(@NotNull ProgressIndicator indicator) { List<VcsDescriptor> allVcss = Arrays.asList(myVcsManager.getAllVcss()); probableVcs = getIfSingle(allVcss.stream().filter(descriptor -> descriptor.probablyUnderVcs(chosenFile))); } @Override public void onSuccess() { if (probableVcs != null) { myVCSComboBox.setSelectedItem(probableVcs); } } }.queue(); } }