Query<PsiClass> (@NotNull SearchParameters parameters) { if (!parameters.isCheckDeep()) { Query<PsiClass> directQuery = DirectClassInheritorsSearch .search(new DirectClassInheritorsSearch.SearchParameters(parameters.getClassToProcess(), parameters.getScope(), parameters.isIncludeAnonymous(), true) { @Override public boolean shouldSearchInLanguage(@NotNull Language language) { return parameters.shouldSearchInLanguage(language); } @Override public ClassInheritorsSearch.SearchParameters getOriginalParameters() { return parameters; } }); if (parameters.getNameCondition() != Conditions.<String>alwaysTrue()) { directQuery = new FilteredQuery<>(directQuery, psiClass -> parameters.getNameCondition() .value(ReadAction.compute(psiClass::getName))); } return AbstractQuery.wrapInReadAction(directQuery); } return INSTANCE.createUniqueResultsQuery(parameters, psiClass -> ReadAction.compute(() -> SmartPointerManager.getInstance(psiClass.getProject()).createSmartPsiElementPointer(psiClass))); }