A position within a text document.

This is a JS-exposed model type (dh.lsp.Position) that closely follows the Language Server Protocol position shape.

Hierarchy

  • Position

Constructors

Properties

character: number

The zero-based character offset within the line.

line: number

The zero-based line offset.

Methods

  • Checks if this position is greater than or equal to end (lexicographically by line then character).

    Parameters

    • end: Position

      the position to compare against

    Returns boolean

    true if this position is after or equal to end

  • Checks if this position is strictly greater than end (lexicographically by line then character).

    Parameters

    • end: Position

      the position to compare against

    Returns boolean

    true if this position is after end

  • Checks if this position is less than or equal to start (lexicographically by line then character).

    Parameters

    • start: Position

      the position to compare against

    Returns boolean

    true if this position is before or equal to start

  • Checks if this position is strictly less than start (lexicographically by line then character).

    Parameters

    • start: Position

      the position to compare against

    Returns boolean

    true if this position is before start