mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
Script infos while opening/closing shouldnt mark project as dirty if the contents dont change
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
/// <reference path="..\services\services.ts" />
|
||||
/// <reference path="session.ts" />
|
||||
|
||||
/*@internal*/
|
||||
namespace ts.server {
|
||||
const lineCollectionCapacity = 4;
|
||||
|
||||
@@ -285,24 +286,6 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
// reload whole script, leaving no change history behind reload
|
||||
reload(script: string) {
|
||||
this.currentVersion++;
|
||||
this.changes = []; // history wiped out by reload
|
||||
const snap = new LineIndexSnapshot(this.currentVersion, this, new LineIndex());
|
||||
|
||||
// delete all versions
|
||||
for (let i = 0; i < this.versions.length; i++) {
|
||||
this.versions[i] = undefined;
|
||||
}
|
||||
|
||||
this.versions[this.currentVersionToIndex()] = snap;
|
||||
const lm = LineIndex.linesFromText(script);
|
||||
snap.index.load(lm.lines);
|
||||
|
||||
this.minVersion = this.currentVersion;
|
||||
}
|
||||
|
||||
getSnapshot(): IScriptSnapshot { return this._getSnapshot(); }
|
||||
|
||||
private _getSnapshot(): LineIndexSnapshot {
|
||||
@@ -843,4 +826,4 @@ namespace ts.server {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user