Represents a line of text, such as a line of source code.

TextLine objects are immutable. When a {@link TextDocument document} changes, previously retrieved lines will not represent the latest state.

Fields

read onlytext:String

The text of this line without the line separator characters.

read onlyrangeIncludingLineBreak:Range

The range this line covers with the line separator characters.

read onlyrange:Range

The range this line covers without the line separator characters.

read onlylineNumber:Int

The zero-based line number.

read onlyisEmptyOrWhitespace:Bool

Whether this line is whitespace only, shorthand for {@link TextLine.firstNonWhitespaceCharacterIndex} === {@link TextLine.text TextLine.text.length}.

read onlyfirstNonWhitespaceCharacterIndex:Int

The offset of the first character which is not a whitespace character as defined by /\s/. Note that if a line is all whitespace the length of the line is returned.