File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1299,7 +1299,7 @@ module ts {
1299
1299
if ( programUpToDate ( ) ) {
1300
1300
return ;
1301
1301
}
1302
-
1302
+
1303
1303
var compilationSettings = hostCache . compilationSettings ( ) ;
1304
1304
1305
1305
// Now, remove any files from the compiler that are no longer in the host.
@@ -1372,6 +1372,15 @@ module ts {
1372
1372
typeChecker = program . getTypeChecker ( ) ;
1373
1373
}
1374
1374
1375
+ /// Clean up any semantic caches that are not needed.
1376
+ /// The host can call this method if it wants to jettison unused memory.
1377
+ /// We will just dump the typeChecker and recreate a new one. this should have the effect of destroying all the semantic caches.
1378
+ function cleanupSemanticCache ( ) : void {
1379
+ if ( program ) {
1380
+ typeChecker = program . getTypeChecker ( ) ;
1381
+ }
1382
+ }
1383
+
1375
1384
function dispose ( ) : void {
1376
1385
if ( program ) {
1377
1386
forEach ( program . getSourceFiles ( ) ,
@@ -2180,7 +2189,7 @@ module ts {
2180
2189
return {
2181
2190
dispose : dispose ,
2182
2191
refresh : ( ) => { } ,
2183
- cleanupSemanticCache : ( ) => { } ,
2192
+ cleanupSemanticCache : cleanupSemanticCache ,
2184
2193
getSyntacticDiagnostics : getSyntacticDiagnostics ,
2185
2194
getSemanticDiagnostics : getSemanticDiagnostics ,
2186
2195
getCompilerOptionsDiagnostics : getCompilerOptionsDiagnostics ,
You can’t perform that action at this time.
0 commit comments