Remove unused IScriptSnapshot.getLineStartPositions

This commit is contained in:
Mohamed Hegazy 2015-01-28 10:48:21 -08:00
parent fe836c5639
commit e503f38272
4 changed files with 0 additions and 37 deletions

View File

@ -237,9 +237,6 @@ module FourSlash {
getLength: () => {
return sourceText.length;
},
getLineStartPositions: () => {
return <number[]>[];
},
getChangeRange: (oldSnapshot: ts.IScriptSnapshot) => {
return <ts.TextChangeRange>undefined;
}

View File

@ -72,14 +72,6 @@ module Harness.LanguageService {
return this.textSnapshot.length;
}
public getLineStartPositions(): string {
if (this.lineMap === null) {
this.lineMap = ts.computeLineStarts(this.textSnapshot);
}
return JSON.stringify(this.lineMap);
}
public getChangeRange(oldScript: ts.ScriptSnapshotShim): string {
var oldShim = <ScriptSnapshotShim>oldScript;
var range = this.scriptInfo.getTextChangeRangeBetweenVersions(oldShim.version, this.version);

View File

@ -74,13 +74,6 @@ module ts {
/** Gets the length of this script snapshot. */
getLength(): number;
/**
* This call returns the array containing the start position of every line.
* i.e."[0, 10, 55]". TODO: consider making this optional. The language service could
* always determine this (albeit in a more expensive manner).
*/
getLineStartPositions(): number[];
/**
* Gets the TextChangeRange that describe how the text changed between this text and
* an older version. This information is used by the incremental parser to determine
@ -106,14 +99,6 @@ module ts {
return this.text.length;
}
public getLineStartPositions(): number[] {
if (!this._lineStartPositions) {
this._lineStartPositions = computeLineStarts(this.text);
}
return this._lineStartPositions;
}
public getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange {
// Text-based snapshots do not support incremental parsing. Return undefined
// to signal that to the caller.

View File

@ -25,9 +25,6 @@ module ts {
/** Gets the length of this script snapshot. */
getLength(): number;
/** This call returns the JSON-encoded array of the type: number[] */
getLineStartPositions(): string;
/**
* Returns a JSON-encoded value of the type:
* { span: { start: number; length: number }; newLength: number }
@ -192,14 +189,6 @@ module ts {
return this.scriptSnapshotShim.getLength();
}
public getLineStartPositions(): number[] {
if (this.lineStartPositions == null) {
this.lineStartPositions = JSON.parse(this.scriptSnapshotShim.getLineStartPositions());
}
return this.lineStartPositions;
}
public getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange {
var oldSnapshotShim = <ScriptSnapshotShimAdapter>oldSnapshot;
var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim);