Merge pull request #359 from Microsoft/cleanup

Wire cleanupSemanticCache
This commit is contained in:
Mohamed Hegazy 2014-08-04 19:06:18 -07:00
commit 97987b1c3e

View file

@ -1299,7 +1299,7 @@ module ts {
if (programUpToDate()) {
return;
}
var compilationSettings = hostCache.compilationSettings();
// Now, remove any files from the compiler that are no longer in the host.
@ -1372,6 +1372,15 @@ module ts {
typeChecker = program.getTypeChecker();
}
/// Clean up any semantic caches that are not needed.
/// The host can call this method if it wants to jettison unused memory.
/// We will just dump the typeChecker and recreate a new one. this should have the effect of destroying all the semantic caches.
function cleanupSemanticCache(): void {
if (program) {
typeChecker = program.getTypeChecker();
}
}
function dispose(): void {
if (program) {
forEach(program.getSourceFiles(),
@ -2180,7 +2189,7 @@ module ts {
return {
dispose: dispose,
refresh: () => { },
cleanupSemanticCache: () => { },
cleanupSemanticCache: cleanupSemanticCache,
getSyntacticDiagnostics: getSyntacticDiagnostics,
getSemanticDiagnostics: getSemanticDiagnostics,
getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics,