mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-12 04:17:34 -06:00
Remove unused IScriptSnapshot.getLineStartPositions
This commit is contained in:
parent
fe836c5639
commit
e503f38272
@ -237,9 +237,6 @@ module FourSlash {
|
||||
getLength: () => {
|
||||
return sourceText.length;
|
||||
},
|
||||
getLineStartPositions: () => {
|
||||
return <number[]>[];
|
||||
},
|
||||
getChangeRange: (oldSnapshot: ts.IScriptSnapshot) => {
|
||||
return <ts.TextChangeRange>undefined;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user