boolean (@NotNull PsiElement e1, @NotNull PsiElement e2) { PsiFile containingFile = e1.getContainingFile(); if (containingFile != e2.getContainingFile()) { throw new IllegalArgumentException(); } Document document = containingFile.getViewProvider().getDocument(); return document != null && document.getLineNumber(e1.getTextOffset()) == document.getLineNumber(e2.getTextOffset()); }