Merge pull request #27082 from Microsoft/watchAPIAndProjectReferences

Fix tsc watch and watch API for a project that has project references
This commit is contained in:
Sheetal Nandi
2018-09-14 17:58:42 -07:00
committed by GitHub
13 changed files with 106 additions and 55 deletions
+3 -2
View File
@@ -1175,9 +1175,10 @@ namespace ts {
const rootFileNames = hostCache.getRootFileNames();
const hasInvalidatedResolution: HasInvalidatedResolution = host.hasInvalidatedResolution || returnFalse;
const projectReferences = hostCache.getProjectReferences();
// If the program is already up-to-date, we can reuse it
if (isProgramUptoDate(program, rootFileNames, hostCache.compilationSettings(), path => hostCache!.getVersion(path), fileExists, hasInvalidatedResolution, !!host.hasChangedAutomaticTypeDirectiveNames)) {
if (isProgramUptoDate(program, rootFileNames, hostCache.compilationSettings(), path => hostCache!.getVersion(path), fileExists, hasInvalidatedResolution, !!host.hasChangedAutomaticTypeDirectiveNames, projectReferences)) {
return;
}
@@ -1240,7 +1241,7 @@ namespace ts {
options: newSettings,
host: compilerHost,
oldProgram: program,
projectReferences: hostCache.getProjectReferences()
projectReferences
};
program = createProgram(options);