List<PsiClass> (final String name, final GlobalSearchScope scope, final boolean srcOnly) { TopLevelFQNames names = getScriptTopLevelNames(); if (names != null) { String topLevelName = toTopLevelName(name); if (!names.names.contains(topLevelName)) { return Collections.emptyList(); } } GlobalSearchScope actualScope = srcOnly ? new GrSourceFilterScope(scope) : scope; return ContainerUtil.map( StubIndex.getElements(GrFullScriptNameStringIndex.KEY, name, myProject, actualScope, GroovyFile.class), o -> Objects.requireNonNull(o.getScriptClass())); }