Skip to content

Commit

Permalink
Update LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
mhegazy committed Jul 15, 2015
1 parent d92c78a commit a24aa6f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/tsserver.js
Expand Up @@ -31502,6 +31502,12 @@ var ts;
var newSourceFile = ts.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
setSourceFileFields(newSourceFile, scriptSnapshot, version);
newSourceFile.nameTable = undefined;
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
if (sourceFile.scriptSnapshot.dispose) {
sourceFile.scriptSnapshot.dispose();
}
sourceFile.scriptSnapshot = undefined;
}
return newSourceFile;
}
}
Expand Down
2 changes: 2 additions & 0 deletions bin/typescript.d.ts
Expand Up @@ -1375,6 +1375,8 @@ declare module "typescript" {
* not happen and the entire document will be re - parsed.
*/
getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange;
/** Releases all resources held by this script snapshot */
dispose?(): void;
}
module ScriptSnapshot {
function fromString(text: string): IScriptSnapshot;
Expand Down
14 changes: 14 additions & 0 deletions bin/typescript.js
Expand Up @@ -36867,6 +36867,13 @@ var ts;
// after incremental parsing nameTable might not be up-to-date
// drop it so it can be lazily recreated later
newSourceFile.nameTable = undefined;
// dispose all resources held by old script snapshot
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
if (sourceFile.scriptSnapshot.dispose) {
sourceFile.scriptSnapshot.dispose();
}
sourceFile.scriptSnapshot = undefined;
}
return newSourceFile;
}
}
Expand Down Expand Up @@ -41947,6 +41954,13 @@ var ts;
var decoded = JSON.parse(encoded);
return ts.createTextChangeRange(ts.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength);
};
ScriptSnapshotShimAdapter.prototype.dispose = function () {
// if scriptSnapshotShim is a COM object then property check becomes method call with no arguments
// 'in' does not have this effect
if ("dispose" in this.scriptSnapshotShim) {
this.scriptSnapshotShim.dispose();
}
};
return ScriptSnapshotShimAdapter;
})();
var LanguageServiceShimHostAdapter = (function () {
Expand Down
2 changes: 2 additions & 0 deletions bin/typescriptServices.d.ts
Expand Up @@ -1375,6 +1375,8 @@ declare module ts {
* not happen and the entire document will be re - parsed.
*/
getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange;
/** Releases all resources held by this script snapshot */
dispose?(): void;
}
module ScriptSnapshot {
function fromString(text: string): IScriptSnapshot;
Expand Down
14 changes: 14 additions & 0 deletions bin/typescriptServices.js
Expand Up @@ -36867,6 +36867,13 @@ var ts;
// after incremental parsing nameTable might not be up-to-date
// drop it so it can be lazily recreated later
newSourceFile.nameTable = undefined;
// dispose all resources held by old script snapshot
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
if (sourceFile.scriptSnapshot.dispose) {
sourceFile.scriptSnapshot.dispose();
}
sourceFile.scriptSnapshot = undefined;
}
return newSourceFile;
}
}
Expand Down Expand Up @@ -41947,6 +41954,13 @@ var ts;
var decoded = JSON.parse(encoded);
return ts.createTextChangeRange(ts.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength);
};
ScriptSnapshotShimAdapter.prototype.dispose = function () {
// if scriptSnapshotShim is a COM object then property check becomes method call with no arguments
// 'in' does not have this effect
if ("dispose" in this.scriptSnapshotShim) {
this.scriptSnapshotShim.dispose();
}
};
return ScriptSnapshotShimAdapter;
})();
var LanguageServiceShimHostAdapter = (function () {
Expand Down

0 comments on commit a24aa6f

Please sign in to comment.