@Override
  public CompilerRef asCompilerRef(@NotNull PsiElement element, @NotNull NameEnumerator names) throws IOException {
    if (mayBeVisibleOutsideOwnerFile(element)) {
      if (element instanceof PsiField field) {
        final PsiClass aClass = field.getContainingClass();
        if (aClass == null || aClass instanceof PsiAnonymousClass) return null;
        final String jvmOwnerName = ClassUtil.getJVMClassName(aClass);
        final String name = field.getName();
        if (jvmOwnerName == null) return null;
        final int ownerId = names.tryEnumerate(jvmOwnerName);
        final int nameId = names.tryEnumerate(name);
        return new CompilerRef.JavaCompilerFieldRef(ownerId, nameId);
      }
      else if (element instanceof PsiMethod method) {
        final PsiClass aClass = method.getContainingClass();
        if (aClass == null || aClass instanceof PsiAnonymousClass) return null;
        final String jvmOwnerName = ClassUtil.getJVMClassName(aClass);
        if (jvmOwnerName == null) return null;
        final String name = method.isConstructor() ? "<init>" : method.getName();
        final int parametersCount = method.getParameterList().getParametersCount();
        final int ownerId = names.tryEnumerate(jvmOwnerName);
        final int nameId = names.tryEnumerate(name);
        return new CompilerRef.JavaCompilerMethodRef(ownerId, nameId, parametersCount);
      }
      else if (element instanceof PsiClass) {
        final String jvmClassName = ClassUtil.getJVMClassName((PsiClass)element);
        if (jvmClassName != null) {
          final int nameId = names.tryEnumerate(jvmClassName);
          return new CompilerRef.JavaCompilerClassRef(nameId);
        }
      }
    }
    return null;
  }
@Override
  public CompilerRef asCompilerRef(@NotNull PsiElement element, @NotNull NameEnumerator names)