void (@NotNull ProjectScanningHistoryImpl scanningHistory, @NotNull CheckCancelOnlyProgressIndicator indicator, @NotNull IndexingProgressReporter progressReporter, @NotNull Ref<StatusMark> markRef) { LOG.info("Started scanning for indexing of " + myProject.getName() + ". Reason: " + myIndexingReason); indicator.onPausedStateChanged(paused -> { if (paused) { scanningHistory.suspendStages(Instant.now()); } else { scanningHistory.stopSuspendingStages(Instant.now()); } }); if (myStartSuspended) { freezeUntilAllowed(); } progressReporter.setIndeterminate(true); progressReporter.setText(IndexingBundle.message("progress.indexing.scanning")); PerformanceWatcher.Snapshot snapshot = PerformanceWatcher.takeSnapshot(); Disposable scanningLifetime = Disposer.newDisposable(); try { if (!shouldScanInSmartMode()) { DumbModeProgressTitle.getInstance(myProject) .attachProgressTitleText(IndexingBundle.message("progress.indexing.scanning.title"), scanningLifetime); } scan(snapshot, scanningHistory, indicator, progressReporter, markRef); } finally { Disposer.dispose(scanningLifetime); } if (isFullIndexUpdate()) { // the full VFS refresh makes sense only after it's loaded, i.e., after scanning files to index is finished myProject.getService(InitialVfsRefreshService.class).scheduleInitialVfsRefresh(); } }