@Override
  public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
    PsiClassPattern keyedExtensionCollectorInheritor = psiClass().inheritorOf(false, KeyedExtensionCollector.class.getName());

    registerUastReferenceProvider(
      registrar,
      injectionHostUExpression()
        .sourcePsiFilter(psi -> PsiUtil.isPluginProject(psi.getProject()))
        .andOr(
          uExpression().callParameter(0,
                                      callExpression().constructor(psiClass().inheritorOf(true, BaseExtensionPointName.class.getName()))),

          uExpression().methodCallParameter(0,
                                            psiMethod().withName("create").withParameterCount(1)
                                              .definedInClass(psiClass().withQualifiedName(
                                                string().oneOf(ExtensionPointName.class.getName(),
                                                               ExtensionPointName.Companion.getClass().getCanonicalName())))),

          uExpression().callParameter(0,
                                      callExpression().constructor(keyedExtensionCollectorInheritor)),
          uExpression().callParameter(0,
                                      callExpression().withMethodName("super").withResolvedMethod(
                                        psiMethod().constructor(true).definedInClass(keyedExtensionCollectorInheritor),
                                        false))
        ),

      new UastInjectionHostReferenceProvider() {
        @Override
        public PsiReference @NotNull [] getReferencesForInjectionHost(@NotNull UExpression uExpression,
                                                                      @NotNull PsiLanguageInjectionHost host,
                                                                      @NotNull ProcessingContext context) {
          return new PsiReference[]{new ExtensionPointDeclarationReference(host)};
        }
      }, PsiReferenceRegistrar.DEFAULT_PRIORITY);
  }
@Override
  public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar)