private static @Nullable PsiElement findElementAtInRoot(PsiElement root, int offset) {
    if (root instanceof PsiFile) {
      return ((PsiFile)root).getViewProvider().findElementAt(offset, root.getLanguage());
    }
    return root.findElementAt(offset);
  }
private static @Nullable PsiElement findElementAtInRoot(PsiElement root, int offset)