mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
Remove unnecessary 'ts.' qualifications (#17163)
This commit is contained in:
@@ -248,7 +248,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
getTextChangeRange() {
|
||||
return ts.createTextChangeRange(ts.createTextSpan(this.pos, this.deleteLen),
|
||||
return createTextChangeRange(createTextSpan(this.pos, this.deleteLen),
|
||||
this.insertedText ? this.insertedText.length : 0);
|
||||
}
|
||||
}
|
||||
@@ -337,21 +337,21 @@ namespace ts.server {
|
||||
getTextChangesBetweenVersions(oldVersion: number, newVersion: number) {
|
||||
if (oldVersion < newVersion) {
|
||||
if (oldVersion >= this.minVersion) {
|
||||
const textChangeRanges: ts.TextChangeRange[] = [];
|
||||
const textChangeRanges: TextChangeRange[] = [];
|
||||
for (let i = oldVersion + 1; i <= newVersion; i++) {
|
||||
const snap = this.versions[this.versionToIndex(i)];
|
||||
for (const textChange of snap.changesSincePreviousVersion) {
|
||||
textChangeRanges.push(textChange.getTextChangeRange());
|
||||
}
|
||||
}
|
||||
return ts.collapseTextChangeRangesAcrossMultipleVersions(textChangeRanges);
|
||||
return collapseTextChangeRangesAcrossMultipleVersions(textChangeRanges);
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return ts.unchangedTextChangeRange;
|
||||
return unchangedTextChangeRange;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
export class LineIndexSnapshot implements ts.IScriptSnapshot {
|
||||
export class LineIndexSnapshot implements IScriptSnapshot {
|
||||
constructor(readonly version: number, readonly cache: ScriptVersionCache, readonly index: LineIndex, readonly changesSincePreviousVersion: ReadonlyArray<TextChange> = emptyArray) {
|
||||
}
|
||||
|
||||
@@ -377,10 +377,10 @@ namespace ts.server {
|
||||
return this.index.root.charCount();
|
||||
}
|
||||
|
||||
getChangeRange(oldSnapshot: ts.IScriptSnapshot): ts.TextChangeRange {
|
||||
getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange {
|
||||
if (oldSnapshot instanceof LineIndexSnapshot && this.cache === oldSnapshot.cache) {
|
||||
if (this.version <= oldSnapshot.version) {
|
||||
return ts.unchangedTextChangeRange;
|
||||
return unchangedTextChangeRange;
|
||||
}
|
||||
else {
|
||||
return this.cache.getTextChangesBetweenVersions(oldSnapshot.version, this.version);
|
||||
@@ -539,7 +539,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
static linesFromText(text: string) {
|
||||
const lineMap = ts.computeLineStarts(text);
|
||||
const lineMap = computeLineStarts(text);
|
||||
|
||||
if (lineMap.length === 0) {
|
||||
return { lines: <string[]>[], lineMap };
|
||||
|
||||
Reference in New Issue
Block a user