Skip to content

Commit e503f38

Browse files
committed
Remove unused IScriptSnapshot.getLineStartPositions
1 parent fe836c5 commit e503f38

File tree

4 files changed

+0
-37
lines changed

4 files changed

+0
-37
lines changed

src/harness/fourslash.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,6 @@ module FourSlash {
237237
getLength: () => {
238238
return sourceText.length;
239239
},
240-
getLineStartPositions: () => {
241-
return <number[]>[];
242-
},
243240
getChangeRange: (oldSnapshot: ts.IScriptSnapshot) => {
244241
return <ts.TextChangeRange>undefined;
245242
}

src/harness/harnessLanguageService.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,6 @@ module Harness.LanguageService {
7272
return this.textSnapshot.length;
7373
}
7474

75-
public getLineStartPositions(): string {
76-
if (this.lineMap === null) {
77-
this.lineMap = ts.computeLineStarts(this.textSnapshot);
78-
}
79-
80-
return JSON.stringify(this.lineMap);
81-
}
82-
8375
public getChangeRange(oldScript: ts.ScriptSnapshotShim): string {
8476
var oldShim = <ScriptSnapshotShim>oldScript;
8577
var range = this.scriptInfo.getTextChangeRangeBetweenVersions(oldShim.version, this.version);

src/services/services.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ module ts {
7474
/** Gets the length of this script snapshot. */
7575
getLength(): number;
7676

77-
/**
78-
* This call returns the array containing the start position of every line.
79-
* i.e."[0, 10, 55]". TODO: consider making this optional. The language service could
80-
* always determine this (albeit in a more expensive manner).
81-
*/
82-
getLineStartPositions(): number[];
83-
8477
/**
8578
* Gets the TextChangeRange that describe how the text changed between this text and
8679
* an older version. This information is used by the incremental parser to determine
@@ -106,14 +99,6 @@ module ts {
10699
return this.text.length;
107100
}
108101

109-
public getLineStartPositions(): number[] {
110-
if (!this._lineStartPositions) {
111-
this._lineStartPositions = computeLineStarts(this.text);
112-
}
113-
114-
return this._lineStartPositions;
115-
}
116-
117102
public getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange {
118103
// Text-based snapshots do not support incremental parsing. Return undefined
119104
// to signal that to the caller.

src/services/shims.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ module ts {
2525
/** Gets the length of this script snapshot. */
2626
getLength(): number;
2727

28-
/** This call returns the JSON-encoded array of the type: number[] */
29-
getLineStartPositions(): string;
30-
3128
/**
3229
* Returns a JSON-encoded value of the type:
3330
* { span: { start: number; length: number }; newLength: number }
@@ -192,14 +189,6 @@ module ts {
192189
return this.scriptSnapshotShim.getLength();
193190
}
194191

195-
public getLineStartPositions(): number[] {
196-
if (this.lineStartPositions == null) {
197-
this.lineStartPositions = JSON.parse(this.scriptSnapshotShim.getLineStartPositions());
198-
}
199-
200-
return this.lineStartPositions;
201-
}
202-
203192
public getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange {
204193
var oldSnapshotShim = <ScriptSnapshotShimAdapter>oldSnapshot;
205194
var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim);

0 commit comments

Comments
 (0)