added unittest for watching @types (#11027)

added unittest for watching @types

* remove debugger statement, fix linter issues
This commit is contained in:
Vladimir Matveev
2016-09-22 14:17:19 -07:00
committed by GitHub
parent 3c4786d542
commit 1fd0a8ca7d
3 changed files with 57 additions and 9 deletions
+7 -7
View File
@@ -3154,6 +3154,13 @@ namespace ts {
}
}
const typeRootsVersion = host.getTypeRootsVersion ? host.getTypeRootsVersion() : 0;
if (lastTypesRootVersion !== typeRootsVersion) {
log("TypeRoots version has changed; provide new program");
program = undefined;
lastTypesRootVersion = typeRootsVersion;
}
// Get a fresh cache of the host information
let hostCache = new HostCache(host, getCanonicalFileName);
@@ -3221,13 +3228,6 @@ namespace ts {
};
}
const typeRootsVersion = host.getTypeRootsVersion ? host.getTypeRootsVersion() : 0;
if (lastTypesRootVersion !== typeRootsVersion) {
log("TypeRoots version has changed; provide new program");
program = undefined;
lastTypesRootVersion = typeRootsVersion;
}
const documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings);
const newProgram = createProgram(hostCache.getRootFileNames(), newSettings, compilerHost, program);