@Override
  public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement psiElement, @NotNull ProcessingContext context) {
    final DomManagerImpl domManager = DomManagerImpl.getDomManager(psiElement.getProject());

    final DomInvocationHandler handler;
    if (psiElement instanceof XmlTag) {
      handler = domManager.getDomHandler((XmlTag)psiElement);
    }
    else if (psiElement instanceof XmlAttributeValue && psiElement.getParent() instanceof XmlAttribute) {
      handler = domManager.getDomHandler((XmlAttribute)psiElement.getParent());
    }
    else {
      return PsiReference.EMPTY_ARRAY;
    }

    if (handler == null || !GenericDomValue.class.isAssignableFrom(handler.getRawType())) {
      return PsiReference.EMPTY_ARRAY;
    }

    InjectedLanguageManager injectedLanguageManager = InjectedLanguageManager.getInstance(psiElement.getProject());

    if (psiElement instanceof XmlTag) {
      for (XmlText text : ((XmlTag)psiElement).getValue().getTextElements()) {
        if (injectedLanguageManager.hasInjections(text)) {
          return PsiReference.EMPTY_ARRAY;
        }
      }
    }
    else if (injectedLanguageManager.hasInjections(psiElement)) {
      return PsiReference.EMPTY_ARRAY;
    }

    final GenericDomValue<?> domValue = (GenericDomValue<?>)handler.getProxy();
    final Referencing referencing = handler.getAnnotation(Referencing.class);
    final Object converter;
    if (referencing == null) {
      try (AccessToken ignored = ReferenceProvidersRegistry.suppressAssertNotContributingReferences()) {
        converter = WrappingConverter.getDeepestConverter(domValue.getConverter(), domValue);
      }
    }
    else {
      converter = ConverterManagerImpl.getOrCreateConverterInstance(referencing.value());
    }

    PsiReference[] references;
    try (AccessToken ignored = ReferenceProvidersRegistry.suppressAssertNotContributingReferences()) {
      references = createReferences(domValue, (XmlElement)psiElement, converter, handler, domManager);
    }

    if (ApplicationManager.getApplication().isUnitTestMode()) {
      for (PsiReference reference : references) {
        if (!reference.isSoft()) {
          LOG.error("dom reference should be soft: " + reference + " (created by " + converter + ")");
        }
      }
    }
    if (references.length > 0) {
      if (converter instanceof EnumConverter && !((EnumConverter<?>)converter).isExhaustive()) {
        // will be handled by core XML
        return PsiReference.EMPTY_ARRAY;
      }
      context.put(XmlEnumeratedValueReferenceProvider.SUPPRESS, Boolean.TRUE);
    }
    return references;
  }
@Override
  public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement psiElement, @NotNull ProcessingContext context)