static <K, V> @Nullable Boolean processValuesInScope(@NotNull ID<K, V> indexId,
                                                       @NotNull K dataKey,
                                                       boolean ensureValueProcessedOnce,
                                                       @NotNull GlobalSearchScope scope,
                                                       @Nullable IdFilter idFilter,
                                                       @NotNull FileBasedIndex.ValueProcessor<? super V> processor) {
    if (indexId == FilenameIndex.NAME && FileBasedIndexExtension.USE_VFS_FOR_FILENAME_INDEX) {
      ensureUpToDate(indexId);
      IntOpenHashSet ids = new IntOpenHashSet();
      FSRecords.processFilesWithNames(Set.of((String)dataKey), id -> {
        ids.add(id);
        return true;
      });
      PersistentFS fs = PersistentFS.getInstance();
      IntIterator iterator = ids.iterator();
      while (iterator.hasNext()) {
        int id = iterator.nextInt();
        if (idFilter != null && !idFilter.containsFileId(id)) continue;
        VirtualFile file = fs.findFileById(id);
        if (file == null || !scope.contains(file)) continue;
        if (!processor.process(file, null)) return false;
        if (ensureValueProcessedOnce) break;
      }
      return true;
    }
    else if (indexId == FileTypeIndex.NAME && Registry.is("indexing.filetype.over.vfs")) {
      InThisThreadProcessor threadProcessor = new InThisThreadProcessor();
      Ref<Boolean> stoppedByVal = ensureValueProcessedOnce ? Ref.create(false) : null;
      if (!processFilesInScope(indexId, scope, true, idFilter, file -> {
        if (!Objects.equals(dataKey, file.getFileType())) return true;
        if (!threadProcessor.process(() -> processor.process(file, null))) return false;
        if (ensureValueProcessedOnce) {
          stoppedByVal.set(true);
          return false;
        }
        return true;
      }) && !(ensureValueProcessedOnce && stoppedByVal.get())) return false;
      return threadProcessor.processQueue();
    }
    else if (indexId == IdIndex.NAME && Registry.is("indexing.id.over.vfs")) {
      return doProcessValuesInScope(indexId, dataKey, ensureValueProcessedOnce, scope, idFilter, processor);
    }
    return null;
  }
static <K, V> @Nullable Boolean processValuesInScope(@NotNull ID<K, V> indexId,
                                                       @NotNull K dataKey,
                                                       boolean ensureValueProcessedOnce,
                                                       @NotNull GlobalSearchScope scope,
                                                       @Nullable IdFilter idFilter,
                                                       @NotNull FileBasedIndex.ValueProcessor<? super V> processor)