@Override
  public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element, final @NotNull ProcessingContext context) {
    final PsiElement parent = element.getParent();
    if (!(parent instanceof XmlAttribute)) return PsiReference.EMPTY_ARRAY;
    final String attrName = ((XmlAttribute)parent).getName();

    return switch (attrName) {
      case VALUE_ATTR_NAME -> PsiReference.EMPTY_ARRAY;
      case NAME_ATTR_NAME -> new PsiReference[]{new NameReference(element)};
      case MEMBER_TYPES_ATTR_NAME -> {
        final List<PsiReference> result = new ArrayList<>(1);
        final String text = element.getText();
        int lastIndex = 1;
        final int testLength = text.length();
        for (int i = 1; i < testLength; ++i) {
          if (Character.isWhitespace(text.charAt(i))) {
            if (lastIndex != i) result.add(new TypeOrElementOrAttributeReference(element, new TextRange(lastIndex, i)));
            lastIndex = i + 1;
          }
        }
        if (lastIndex != testLength - 1) {
          result.add(new TypeOrElementOrAttributeReference(element, new TextRange(lastIndex, testLength - 1)));
        }
        yield result.toArray(PsiReference.EMPTY_ARRAY);
      }
      default -> {
        final PsiReference prefix = createSchemaPrefixReference(element);
        final PsiReference ref = createTypeOrElementOrAttributeReference(element, prefix == null ? null : prefix.getCanonicalText());
        yield prefix == null ? new PsiReference[]{ref} : new PsiReference[]{ref, prefix};
      }
    };
  }
@Override
  public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element, final @NotNull ProcessingContext context)