TextRange (@NotNull final PsiElement container) { PsiMethod method = (PsiMethod)container; final TextRange textRange = method.getModifierList().getTextRange(); int startOffset = textRange != null ? textRange.getStartOffset():method.getTextOffset(); int endOffset = method.getThrowsList().getTextRange().getEndOffset(); return new TextRange(startOffset, endOffset); }