void () { if (myProject.isDefault() || !TrustedProjects.isTrusted(myProject)) return; if (myRootDetectionIndicator != null) myRootDetectionIndicator.cancel(); if (!VcsUtil.shouldDetectVcsMappingsFor(myProject)) return; myRootDetectionIndicator = BackgroundTaskUtil.executeAndTryWait(indicator -> { List<VcsDirectoryMapping> unregisteredRoots = VcsRootErrorsFinder.getInstance(myProject).getOrFind().stream() .filter(error -> error.getType() == VcsRootError.Type.UNREGISTERED_ROOT) .map(error -> error.getMapping()) .toList(); return () -> { if (indicator.isCanceled()) return; myLoadingPanel.stopLoading(); if (!unregisteredRoots.isEmpty()) { myModel.addRow(MapInfo.SEPARATOR); for (VcsDirectoryMapping mapping : unregisteredRoots) { myModel.addRow(MapInfo.unregistered(mapping)); } } }; }, () -> myLoadingPanel.startLoading(), POSTPONE_MAPPINGS_LOADING_PANEL, false); }