ProjectScanningHistory (@NotNull CheckCancelOnlyProgressIndicator indicator, @NotNull IndexingProgressReporter progressReporter) { ProjectScanningHistoryImpl scanningHistory = new ProjectScanningHistoryImpl(myProject, myIndexingReason, myScanningType); myIndex.loadIndexes(); myIndex.filesUpdateStarted(myProject, isFullIndexUpdate()); IndexDiagnosticDumper.getInstance().onScanningStarted(scanningHistory); Ref<StatusMark> markRef = new Ref<>(); try { ProjectScanningHistoryImpl.Companion.startDumbModeBeginningTracking(myProject, scanningHistory); ((GistManagerImpl)GistManager.getInstance()).runWithMergingDependentCacheInvalidations(() -> { scanAndUpdateUnindexedFiles(scanningHistory, indicator, progressReporter, markRef); }); } catch (Throwable e) { scanningHistory.setWasInterrupted(); if (e instanceof ControlFlowException) { LOG.info("Cancelled indexing of " + myProject.getName()); } throw e; } finally { ProjectScanningHistoryImpl.Companion.finishDumbModeBeginningTracking(myProject); myIndex.filesUpdateFinished(myProject); if (DependenciesIndexedStatusService.shouldBeUsed() && IndexInfrastructure.hasIndices()) { DependenciesIndexedStatusService.getInstance(myProject) .indexingFinished(!scanningHistory.getTimes().getWasInterrupted(), markRef.get()); } IndexDiagnosticDumper.getInstance().onScanningFinished(scanningHistory); } return scanningHistory; }