@NotNull
  @Override
  public List<CompilerRef> getHierarchyRestrictedToLibraryScope(@NotNull CompilerRef baseRef,
                                                                @NotNull PsiElement basePsi,
                                                                @NotNull NameEnumerator names, @NotNull GlobalSearchScope libraryScope)
    throws IOException {
    @Nullable PsiClass value =
      basePsi instanceof PsiClass ? (PsiClass)basePsi : ReadAction.compute(() -> (PsiMember)basePsi).getContainingClass();
    final PsiClass baseClass = Objects.requireNonNull(value);

    final List<CompilerRef> overridden = new ArrayList<>();
    final IOException[] exception = new IOException[]{null};
    Processor<PsiClass> processor = c -> {
      if (c.hasModifierProperty(PsiModifier.PRIVATE)) return true;
      String qName = ReadAction.compute(() -> c.getQualifiedName());
      if (qName == null) return true;
      try {
        final int nameId = names.tryEnumerate(qName);
        overridden.add(baseRef.override(nameId));
      }
      catch (IOException e) {
        exception[0] = e;
        return false;
      }
      return true;
    };
    ClassInheritorsSearch.search(baseClass, libraryScope, true).forEach(processor);
    if (exception[0] != null) {
      throw exception[0];
    }
    return overridden;
  }
@NotNull
  @Override
  public List<CompilerRef> getHierarchyRestrictedToLibraryScope(@NotNull CompilerRef baseRef,
                                                                @NotNull PsiElement basePsi,
                                                                @NotNull NameEnumerator names, @NotNull GlobalSearchScope libraryScope)