TextRange (GrClassInitializer initializer) { final PsiModifierList modifierList = initializer.getModifierList(); final GrOpenBlock block = initializer.getBlock(); final TextRange textRange = modifierList.getTextRange(); LOG.assertTrue(textRange != null, initializer.getClass() + ":" + initializer.getText()); int startOffset = textRange.getStartOffset(); int endOffset = block.getLBrace().getTextRange().getEndOffset() + 1; return new TextRange(startOffset, endOffset); }