TextRange (@NotNull Document document, int nLine) { int startOffset = document.getLineStartOffset(nLine); int endOffset = document.getLineEndOffset(nLine); return new TextRange(startOffset, endOffset); }