public static <K, V> boolean doProcessValuesInScope(@NotNull ID<K, V> indexId,
                                                      @NotNull K dataKey,
                                                      boolean ensureValueProcessedOnce,
                                                      @NotNull GlobalSearchScope scope,
                                                      @Nullable IdFilter idFilter,
                                                      FileBasedIndex.@NotNull ValueProcessor<? super V> processor) {
    Project project = scope.getProject();
    InThisThreadProcessor threadProcessor = new InThisThreadProcessor();
    ConcurrentHashMap<V, Boolean> visitedValues = ensureValueProcessedOnce ? new ConcurrentHashMap<>() : null;
    Function<VirtualFile, ? extends Map<K, V>> indexer = getIndexer(indexId, project, false);
    return processFilesInScope(indexId, scope, false, idFilter, file -> {
      Map<K, V> map = indexer.apply(file);
      V value = map == null ? null : map.get(dataKey);
      if (value == null) return true;
      if (ensureValueProcessedOnce && visitedValues.put(value, true) != null) return true;
      return threadProcessor.process(() -> processor.process(file, value));
    }) && threadProcessor.processQueue();
  }
public static <K, V> boolean doProcessValuesInScope(@NotNull ID<K, V> indexId,
                                                      @NotNull K dataKey,
                                                      boolean ensureValueProcessedOnce,
                                                      @NotNull GlobalSearchScope scope,
                                                      @Nullable IdFilter idFilter,
                                                      FileBasedIndex.@NotNull ValueProcessor<? super V> processor)