TextLine

interface TextLine(source)

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

TextLine objects are immutable. When a document changes, previously retrieved lines will not represent the latest state.

Online Documentation

Properties

Link copied to clipboard
abstract external val firstNonWhitespaceCharacterIndex: 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.

Link copied to clipboard
abstract external val isEmptyOrWhitespace: Boolean

Whether this line is whitespace only, shorthand for TextLine.firstNonWhitespaceCharacterIndex === TextLine.text.length.

Link copied to clipboard
abstract external val lineNumber: Int

The zero-based line number.

Link copied to clipboard
abstract external val range: Range

The range this line covers without the line separator characters.

Link copied to clipboard
abstract external val rangeIncludingLineBreak: Range

The range this line covers with the line separator characters.

Link copied to clipboard
abstract external val text: String

The text of this line without the line separator characters.