boolean (@NotNull SearchRequestCollector collector, @NotNull Processor<? super PsiReference> processor) { Map<SearchRequestCollector, Processor<? super PsiReference>> collectors = new HashMap<>(); collectors.put(collector, processor); ProgressIndicator progress = getOrCreateIndicator(); if (appendCollectorsFromQueryRequests(progress, collectors) == QueryRequestsRunResult.STOPPED) { return false; } do { Map<TextIndexQuery, Collection<RequestWithProcessor>> globals = new HashMap<>(); List<Computable<Boolean>> customs = new ArrayList<>(); Set<RequestWithProcessor> locals = new LinkedHashSet<>(); Map<RequestWithProcessor, Processor<? super PsiElement>> localProcessors = new HashMap<>(); distributePrimitives(collectors, locals, globals, customs, localProcessors); if (!processGlobalRequestsOptimized(globals, progress, localProcessors)) { return false; } for (RequestWithProcessor local : locals) { progress.checkCanceled(); if (!processSingleRequest(local.request, local.refProcessor)) { return false; } } for (Computable<Boolean> custom : customs) { progress.checkCanceled(); if (!custom.compute()) { return false; } } QueryRequestsRunResult result = appendCollectorsFromQueryRequests(progress, collectors); if (result == QueryRequestsRunResult.STOPPED) { return false; } else if (result == QueryRequestsRunResult.UNCHANGED) { return true; } } while (true); }