@Override
  public @Nullable PsiReference getReference() {
    if (myReference != null) {
      final PsiElement element = myReference.getElement();
      if (element.isValid()) {
        if (myReferenceRangeMarker == null) {
          return myReference;
        }

        final PsiReference reference = checkReferenceRange(element, start -> myReference);

        if (reference != null) {
          return reference;
        }
      }
    }

    if (myReferenceRangeMarker == null) return null;
    final PsiElement element = getElement();
    if (element == null || !element.isValid()) {
      return null;
    }
    return checkReferenceRange(element, start -> element.findReferenceAt(start));
  }
@Override
  public @Nullable PsiReference getReference()