@NotNull
  private List<IndexableFilesIterator> doGetIndexingIterators() {
    EntityStorage entityStorage = WorkspaceModel.getInstance(project).getCurrentSnapshot();
    List<IndexableFilesIterator> iterators = new ArrayList<>();

    for (Module module : ModuleManager.getInstance(project).getModules()) {
      iterators.addAll(IndexableEntityProviderMethods.INSTANCE.createModuleContentIterators(module));
    }

    Set<IndexableSetOrigin> libraryOrigins = new HashSet<>();

    WorkspaceIndexingRootsBuilder.Companion.Settings settings = new WorkspaceIndexingRootsBuilder.Companion.Settings();
    settings.setCollectExplicitRootsForModules(false);
    settings.setRetainCondition(contributor -> contributor.getStorageKind() == EntityStorageKind.MAIN);
    WorkspaceIndexingRootsBuilder builder =
      WorkspaceIndexingRootsBuilder.Companion.registerEntitiesFromContributors(entityStorage, settings);
    WorkspaceIndexingRootsBuilder.Iterators iteratorsFromRoots = builder.getIteratorsFromRoots(libraryOrigins, entityStorage);
    iterators.addAll(iteratorsFromRoots.getContentIterators());
    iterators.addAll(iteratorsFromRoots.getExternalIterators());

    List<Sdk> sdks = new ArrayList<>();
    ModuleDependencyIndex moduleDependencyIndex = ModuleDependencyIndex.getInstance(project);
    for (Sdk sdk : ProjectJdkTable.getInstance().getAllJdks()) {
      if (moduleDependencyIndex.hasDependencyOn(sdk)) {
        sdks.add(sdk);
      }
    }
    if (sdks.isEmpty()) {
      Sdk projectSdk = ProjectRootManager.getInstance(project).getProjectSdk();
      if (projectSdk != null) {
        sdks.add(projectSdk);
      }
    }
    for (Sdk sdk : sdks) {
      ProgressManager.checkCanceled();
      iterators.addAll(IndexableEntityProviderMethods.INSTANCE.createIterators(sdk));
    }

    LibraryTablesRegistrar tablesRegistrar = LibraryTablesRegistrar.getInstance();
    Sequence<LibraryTable> libs = SequencesKt.asSequence(tablesRegistrar.getCustomLibraryTables().iterator());
    libs = SequencesKt.plus(libs, tablesRegistrar.getLibraryTable());
    for (LibraryTable libraryTable : SequencesKt.asIterable(libs)) {
      for (Library library : libraryTable.getLibraries()) {
        ProgressManager.checkCanceled();
        if (moduleDependencyIndex.hasDependencyOn(library)) {
          for (IndexableFilesIterator iterator : Companion.createIteratorList(library)) {
            if (libraryOrigins.add(iterator.getOrigin())) {
              iterators.add(iterator);
            }
          }
        }
      }
    }

    boolean addedFromDependenciesIndexedStatusService = false;
    if (DependenciesIndexedStatusService.shouldBeUsed()) {
      DependenciesIndexedStatusService cacheService = DependenciesIndexedStatusService.getInstance(project);
      if (cacheService.shouldSaveStatus()) {
        addedFromDependenciesIndexedStatusService = true;
        ProgressManager.checkCanceled();
        iterators.addAll(cacheService.saveLibsAndInstantiateLibraryIterators());
        iterators.addAll(iteratorsFromRoots.getCustomIterators());
        ProgressManager.checkCanceled();
        iterators.addAll(cacheService.saveIndexableSetsAndInstantiateIterators());
        cacheService.saveExcludePolicies();
      }
    }

    if (!addedFromDependenciesIndexedStatusService) {
      for (AdditionalLibraryRootsProvider provider : AdditionalLibraryRootsProvider.EP_NAME.getExtensionList()) {
        for (SyntheticLibrary library : provider.getAdditionalProjectLibraries(project)) {
          iterators.add(new SyntheticLibraryIndexableFilesIteratorImpl(library));
        }
      }

      iterators.addAll(iteratorsFromRoots.getCustomIterators());

      for (IndexableSetContributor contributor : IndexableSetContributor.EP_NAME.getExtensionList()) {
        iterators.add(new IndexableSetContributorFilesIterator(contributor, project));
        iterators.add(new IndexableSetContributorFilesIterator(contributor));
      }
    }
    return iterators;
  }
@NotNull
  private List<IndexableFilesIterator> doGetIndexingIterators()