Skip to content

Commit a24aa6f

Browse files
committed
Update LKG
1 parent d92c78a commit a24aa6f

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed

bin/tsserver.js

+6
Original file line numberDiff line numberDiff line change
@@ -31502,6 +31502,12 @@ var ts;
3150231502
var newSourceFile = ts.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
3150331503
setSourceFileFields(newSourceFile, scriptSnapshot, version);
3150431504
newSourceFile.nameTable = undefined;
31505+
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
31506+
if (sourceFile.scriptSnapshot.dispose) {
31507+
sourceFile.scriptSnapshot.dispose();
31508+
}
31509+
sourceFile.scriptSnapshot = undefined;
31510+
}
3150531511
return newSourceFile;
3150631512
}
3150731513
}

bin/typescript.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,8 @@ declare module "typescript" {
13751375
* not happen and the entire document will be re - parsed.
13761376
*/
13771377
getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange;
1378+
/** Releases all resources held by this script snapshot */
1379+
dispose?(): void;
13781380
}
13791381
module ScriptSnapshot {
13801382
function fromString(text: string): IScriptSnapshot;

bin/typescript.js

+14
Original file line numberDiff line numberDiff line change
@@ -36867,6 +36867,13 @@ var ts;
3686736867
// after incremental parsing nameTable might not be up-to-date
3686836868
// drop it so it can be lazily recreated later
3686936869
newSourceFile.nameTable = undefined;
36870+
// dispose all resources held by old script snapshot
36871+
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
36872+
if (sourceFile.scriptSnapshot.dispose) {
36873+
sourceFile.scriptSnapshot.dispose();
36874+
}
36875+
sourceFile.scriptSnapshot = undefined;
36876+
}
3687036877
return newSourceFile;
3687136878
}
3687236879
}
@@ -41947,6 +41954,13 @@ var ts;
4194741954
var decoded = JSON.parse(encoded);
4194841955
return ts.createTextChangeRange(ts.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength);
4194941956
};
41957+
ScriptSnapshotShimAdapter.prototype.dispose = function () {
41958+
// if scriptSnapshotShim is a COM object then property check becomes method call with no arguments
41959+
// 'in' does not have this effect
41960+
if ("dispose" in this.scriptSnapshotShim) {
41961+
this.scriptSnapshotShim.dispose();
41962+
}
41963+
};
4195041964
return ScriptSnapshotShimAdapter;
4195141965
})();
4195241966
var LanguageServiceShimHostAdapter = (function () {

bin/typescriptServices.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,8 @@ declare module ts {
13751375
* not happen and the entire document will be re - parsed.
13761376
*/
13771377
getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange;
1378+
/** Releases all resources held by this script snapshot */
1379+
dispose?(): void;
13781380
}
13791381
module ScriptSnapshot {
13801382
function fromString(text: string): IScriptSnapshot;

bin/typescriptServices.js

+14
Original file line numberDiff line numberDiff line change
@@ -36867,6 +36867,13 @@ var ts;
3686736867
// after incremental parsing nameTable might not be up-to-date
3686836868
// drop it so it can be lazily recreated later
3686936869
newSourceFile.nameTable = undefined;
36870+
// dispose all resources held by old script snapshot
36871+
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
36872+
if (sourceFile.scriptSnapshot.dispose) {
36873+
sourceFile.scriptSnapshot.dispose();
36874+
}
36875+
sourceFile.scriptSnapshot = undefined;
36876+
}
3687036877
return newSourceFile;
3687136878
}
3687236879
}
@@ -41947,6 +41954,13 @@ var ts;
4194741954
var decoded = JSON.parse(encoded);
4194841955
return ts.createTextChangeRange(ts.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength);
4194941956
};
41957+
ScriptSnapshotShimAdapter.prototype.dispose = function () {
41958+
// if scriptSnapshotShim is a COM object then property check becomes method call with no arguments
41959+
// 'in' does not have this effect
41960+
if ("dispose" in this.scriptSnapshotShim) {
41961+
this.scriptSnapshotShim.dispose();
41962+
}
41963+
};
4195041964
return ScriptSnapshotShimAdapter;
4195141965
})();
4195241966
var LanguageServiceShimHostAdapter = (function () {

0 commit comments

Comments
 (0)