private static void registerExternalFixes(@NotNull PsiReference reference,
                                            @NotNull PsiElement psiElement,
                                            @NotNull String shortReferenceName,
                                            @NotNull Module currentModule,
                                            @NotNull DependencyScope scope,
                                            @NotNull List<? super @NotNull IntentionAction> registrar,
                                            @NotNull List<? super @NotNull LocalQuickFix> result) {
    JavaPsiFacade facade = JavaPsiFacade.getInstance(currentModule.getProject());
    String fullReferenceText = reference.getCanonicalText();
    ThreeState refToAnnotation = isReferenceToAnnotation(psiElement);
    for (ExternalLibraryResolver resolver : ExternalLibraryResolver.EP_NAME.getExtensionList()) {
      ExternalClassResolveResult resolveResult = resolver.resolveClass(shortReferenceName, refToAnnotation, currentModule);
      OrderEntryFix fix = null;
      if (resolveResult != null &&
          facade.findClass(resolveResult.getQualifiedClassName(), currentModule.getModuleWithDependenciesAndLibrariesScope(true)) == null) {
        final ExternalLibraryDescriptor descriptor = resolveResult.getLibraryDescriptor();
        final DependencyScope useScope = Objects.requireNonNullElse(descriptor.getPreferredScope(), scope);
        fix = new AddExtLibraryDependencyFix(reference, currentModule, descriptor, useScope, resolveResult.getQualifiedClassName());
      }
      else if (!fullReferenceText.equals(shortReferenceName) &&
               facade.findClass(fullReferenceText, currentModule.getModuleWithDependenciesAndLibrariesScope(true)) == null) {
        ExternalLibraryDescriptor descriptor = resolver.resolvePackage(fullReferenceText);
        if (descriptor != null) {
          final DependencyScope useScope = Objects.requireNonNullElse(descriptor.getPreferredScope(), scope);
          fix = new AddExtLibraryDependencyFix(reference, currentModule, descriptor, useScope, null);
        }
      }
      if (fix != null) {
        registrar.add(fix);
        result.add(fix);
      }
    }
  }
private static void registerExternalFixes(@NotNull PsiReference reference,
                                            @NotNull PsiElement psiElement,
                                            @NotNull String shortReferenceName,
                                            @NotNull Module currentModule,
                                            @NotNull DependencyScope scope,
                                            @NotNull List<? super @NotNull IntentionAction> registrar,
                                            @NotNull List<? super @NotNull LocalQuickFix> result)