private static void ensureUpToDate(@NotNull ID<?, ?> indexId) {
    SlowOperations.assertSlowOperationsAreAllowed();
    ApplicationManager.getApplication().assertReadAccessAllowed();
    NoAccessDuringPsiEvents.checkCallContext(indexId);
    ProgressManager.checkCanceled();
    if (!IndexUpToDateCheckIn.isUpToDateCheckEnabled()) return;
    if (FileBasedIndex.getInstance() instanceof FileBasedIndexImpl index) {
      index.getChangedFilesCollector().processFilesToUpdateInReadAction();
    }
  }
private static void ensureUpToDate(@NotNull ID<?, ?> indexId)