boolean (@NotNull final AllClassesSearch.SearchParameters queryParameters, @NotNull final Processor<? super PsiClass> consumer) { SearchScope scope = queryParameters.getScope(); if (SearchScope.isEmptyScope(scope)) { return true; } if (scope instanceof GlobalSearchScope) { PsiManager manager = PsiManager.getInstance(queryParameters.getProject()); return manager.runInBatchFilesMode(() -> processAllClassesInGlobalScope((GlobalSearchScope)scope, queryParameters, consumer)); } PsiElement[] scopeRoots = ((LocalSearchScope)scope).getScope(); for (final PsiElement scopeRoot : scopeRoots) { if (!processScopeRootForAllClasses(scopeRoot, consumer)) return false; } return true; }