Class LineMap

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(_computeLineStarts: () => number[], length: number): LineMap

Parameters

  • _computeLineStarts: () => number[]
  • length: number

Returns

LineMap

Properties

private _computeLineStarts: any

private _lineStarts: any

public static empty: LineMap

private length: any

Methods

public equals(other: LineMap): boolean

Parameters

Returns

boolean

public fillLineAndCharacterFromPosition(position: number, lineAndCharacter: ILineAndCharacter)

Parameters

public getLineAndCharacterFromPosition(position: number): LineAndCharacter

Parameters

  • position: number

Returns

LineAndCharacter

public getLineNumberFromPosition(position: number): number

Parameters

  • position: number

Returns

number

public getLineStartPosition(lineNumber: number): number

Parameters

  • lineNumber: number

Returns

number

public getPosition(line: number, character: number): number

Parameters

  • line: number
  • character: number

Returns

number

public lineCount(): number

Returns

number

public lineStarts(): Array<number>

Returns

Array<number>

public toJSON(key: any): { lineStarts: number[]; length: number; }

Parameters

  • key: any

Returns

{ lineStarts: number[]; length: number; }