protected static @Nullable PsiReference findReferenceAt(@Nullable PsiFile psiFile, int offset) {
    if (psiFile == null) return null;
    int offsetInElement = offset;
    PsiElement child = psiFile.getFirstChild();
    while (child != null) {
      int length = child.getTextLength();
      if (length <= offsetInElement) {
        offsetInElement -= length;
        child = child.getNextSibling();
        continue;
      }
      return child.findReferenceAt(offsetInElement);
    }
    return null;
  }
protected static @Nullable PsiReference findReferenceAt(@Nullable PsiFile psiFile, int offset)