A position in the editor.

Constructors

  • Parameters

    • lineNumber: number
    • column: number

    Returns Position

Properties

column: number

column (the first character in a line is between column 1 and column 2)

lineNumber: number

line number (starts at 1)

Methods

  • Clone this position.

    Returns Position

  • Derive a new position from this position.

    Parameters

    • Optional deltaLineNumber: number

      line number delta

    • Optional deltaColumn: number

      column delta

    Returns Position

  • Test if this position equals other position

    Parameters

    Returns boolean

  • Test if this position is before other position. If the two positions are equal, the result will be false.

    Parameters

    Returns boolean

  • Test if this position is before other position. If the two positions are equal, the result will be true.

    Parameters

    Returns boolean

  • Convert to a human-readable representation.

    Returns string

  • Create a new position from this position.

    Parameters

    • Optional newLineNumber: number

      new line number

    • Optional newColumn: number

      new column

    Returns Position

  • A function that compares positions, useful for sorting

    Parameters

    Returns number

  • Test if position a equals position b

    Parameters

    Returns boolean

  • Test if position a is before position b. If the two positions are equal, the result will be false.

    Parameters

    Returns boolean

  • Test if position a is before position b. If the two positions are equal, the result will be true.

    Parameters

    Returns boolean

  • Test if obj is an IPosition.

    Parameters

    • obj: any

    Returns obj is IPosition

  • Create a Position from an IPosition.

    Parameters

    Returns Position