int (PsiElement element) { final Document document = element.getContainingFile().getViewProvider().getDocument(); assert document != null; return document.getLineNumber(element.getTextRange().getStartOffset()); }