List<PsiClass> (String name, GlobalSearchScope scope, boolean inSource) { TopLevelFQNames names = ReadAction.compute(() -> getTopLevelNames()); if (names != null) { String topLevelName = toTopLevelName(name); if (!names.names.contains(topLevelName)) { return Collections.emptyList(); } } if (DumbService.getInstance(myProject).isAlternativeResolveEnabled()) { return Collections.emptyList(); } GlobalSearchScope actualScope = inSource ? new GrSourceFilterScope(scope) : scope; return ReadAction.compute(() -> { List<PsiClass> result = new ArrayList<>(); result.addAll(StubIndex.getElements(GrFullClassNameStringIndex.KEY, name, myProject, actualScope, PsiClass.class)); result.addAll(getScriptClassesByFQName(name, scope, inSource)); return result; }); }