mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
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:
13 files changed
+106
-55
No files matched your search
@@ -914,7 +914,8 @@ namespace ts {
|
||||
program, newRootFileNames, newOptions,
|
||||
path => program.getSourceFileByPath(path)!.version, /*fileExists*/ returnFalse,
|
||||
/*hasInvalidatedResolution*/ returnFalse,
|
||||
/*hasChangedAutomaticTypeDirectiveNames*/ false
|
||||
/*hasChangedAutomaticTypeDirectiveNames*/ false,
|
||||
/*projectReferences*/ undefined
|
||||
);
|
||||
assert.isTrue(actual);
|
||||
}
|
||||
|
||||
@@ -388,6 +388,13 @@ let x: string = 10;`);
|
||||
verifyIncrementalErrors({ preserveWatchOutput: true, watch: true }, /*disabledConsoleClear*/ true);
|
||||
});
|
||||
});
|
||||
// TODO: write tests reporting errors but that will have more involved work since file
|
||||
|
||||
it("tsc-watch works with project references", () => {
|
||||
// Build the composite project
|
||||
const host = createSolutionInWatchMode(allFiles);
|
||||
|
||||
createWatchOfConfigFile(tests[0].path, host);
|
||||
checkOutputErrorsInitial(host, emptyArray);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -20,7 +20,7 @@ namespace ts.tscWatch {
|
||||
checkArray(`Program rootFileNames`, program.getRootFileNames(), expectedFiles);
|
||||
}
|
||||
|
||||
function createWatchOfConfigFile(configFileName: string, host: WatchedSystem, maxNumberOfFilesToIterateForInvalidation?: number) {
|
||||
export function createWatchOfConfigFile(configFileName: string, host: WatchedSystem, maxNumberOfFilesToIterateForInvalidation?: number) {
|
||||
const compilerHost = createWatchCompilerHostOfConfigFile(configFileName, {}, host);
|
||||
compilerHost.maxNumberOfFilesToIterateForInvalidation = maxNumberOfFilesToIterateForInvalidation;
|
||||
const watch = createWatchProgram(compilerHost);
|
||||
|
||||
Reference in new issue
Block a user