private static @Nullable PsiElement fromReference(@NotNull Editor editor, int offset) {
    PsiReference ref = TargetElementUtil.findReference(editor, offset);
    if (ref == null) {
      return null;
    }
    if (ref instanceof PsiPolyVariantReference) {
      return ref.getElement();
    }
    return TargetElementUtil.getInstance().adjustReference(ref);
  }
private static @Nullable PsiElement fromReference(@NotNull Editor editor, int offset)