void (@Nullable String indexingReason, CheckCancelOnlyProgressIndicator indicator) { var service = myProject.getService(PerProjectIndexingQueue.class); if (shouldScanInSmartMode()) { // Switch to dumb mode and index service.flushNow(myIndexingReason); } else { // Already in dumb mode. Just invoke indexer service.flushNowSync(indexingReason, indicator.originalIndicatorOnlyToFlushIndexingQueueSynchronously()); } }