private PsiReference @NotNull [] getReferencesImpl(@NotNull PsiReferenceService.Hints hints) {
    final ASTNode startTagName = XmlChildRole.START_TAG_NAME_FINDER.findChild(myTag.getNode());
    if (startTagName == null) return PsiReference.EMPTY_ARRAY;
    final ASTNode endTagName = XmlChildRole.CLOSING_TAG_NAME_FINDER.findChild(myTag.getNode());
    List<PsiReference> refs = new SmartList<>();
    String prefix = myTag.getNamespacePrefix();

    boolean inStartTag = hints.offsetInElement == null || childContainsOffset(startTagName.getPsi(), hints.offsetInElement);
    if (inStartTag) {
      TagNameReference startTagRef = TagNameReference.createTagNameReference(myTag, startTagName, true);
      if (startTagRef != null) {
        refs.add(startTagRef);
      }
      if (!prefix.isEmpty()) {
        refs.addAll(createPrefixReferences(startTagName, prefix, startTagRef));
      }
    }
    boolean inEndTag =
      endTagName != null && (hints.offsetInElement == null || childContainsOffset(endTagName.getPsi(), hints.offsetInElement));
    if (inEndTag) {
      TagNameReference endTagRef = TagNameReference.createTagNameReference(myTag, endTagName, false);
      if (endTagRef != null) {
        refs.add(endTagRef);
      }
      prefix = getNamespacePrefix(endTagName.getText());
      if (StringUtil.isNotEmpty(prefix)) {
        refs.addAll(createPrefixReferences(endTagName, prefix, endTagRef));
      }
    }

    if (hints.offsetInElement == null || inStartTag || inEndTag || isInsideXmlText(hints.offsetInElement)) {
      Collections.addAll(refs, ReferenceProvidersRegistry.getReferencesFromProviders(myTag, hints));
    }

    Integer offset = hints.offsetInElement;
    if (offset != null) {
      return PsiDynaReference.filterByOffset(refs.toArray(PsiReference.EMPTY_ARRAY), offset);
    }

    return refs.toArray(PsiReference.EMPTY_ARRAY);
  }
private PsiReference @NotNull [] getReferencesImpl(@NotNull PsiReferenceService.Hints hints)