A position in the editor.

Hierarchy

  • Position

Index

Constructors

constructor

  • new Position(lineNumber: number, column: number): Position

Properties

column

column: number

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

lineNumber

lineNumber: number

line number (starts at 1)

Methods

clone

delta

  • delta(deltaLineNumber?: number, deltaColumn?: number): Position
  • Derive a new position from this position.

    Parameters

    • Optional deltaLineNumber: number

      line number delta

    • Optional deltaColumn: number

      column delta

    Returns Position

equals

isBefore

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

    Parameters

    Returns boolean

isBeforeOrEqual

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

    Parameters

    Returns boolean

toString

  • toString(): string
  • Convert to a human-readable representation.

    Returns string

with

  • with(newLineNumber?: number, newColumn?: number): Position
  • Create a new postion from this position.

    Parameters

    • Optional newLineNumber: number

      new line number

    • Optional newColumn: number

      new column

    Returns Position

Static compare

Static equals

Static isBefore

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

    Parameters

    Returns boolean

Static isBeforeOrEqual

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

    Parameters

    Returns boolean

Static isIPosition

  • isIPosition(obj: any): boolean
  • Test if obj is an IPosition.

    Parameters

    • obj: any

    Returns boolean

Static lift