int (@NotNull final M method) { final PsiFile file = method.getContainingFile(); Document document = PsiDocumentManager.getInstance(myProject).getDocument(file); return document.getLineStartOffset(document.getLineNumber(method.getTextRange().getStartOffset())); }