CharSequence (@NotNull Document document, int lineNumber, boolean includeEol) { int endOffset = document.getLineEndOffset(lineNumber); if (includeEol && endOffset < document.getTextLength()) { endOffset++; } return document.getImmutableCharSequence().subSequence(document.getLineStartOffset(lineNumber), endOffset); }