public static boolean onSameLine(@NotNull PsiElement e1, @NotNull PsiElement e2) {
    PsiFile firstFile = e1.getContainingFile();
    PsiFile secondFile = e2.getContainingFile();
    if (firstFile == null || secondFile == null) return false;
    Document document = firstFile.getFileDocument();
    if (document != secondFile.getFileDocument()) return false;
    return document.getLineNumber(e1.getTextOffset()) == document.getLineNumber(e2.getTextOffset());
  }
public static boolean onSameLine(@NotNull PsiElement e1, @NotNull PsiElement e2)