Do not trigger the failed lookup location invalidation for creation of program emit files

Handles #20934
This commit is contained in:
Sheetal Nandi
2018-01-11 11:52:46 -08:00
parent c5ed8646e1
commit 69bb5ea8f0
8 changed files with 53 additions and 8 deletions

View File

@@ -52,6 +52,7 @@ namespace ts {
getGlobalCache?(): string | undefined;
writeLog(s: string): void;
maxNumberOfFilesToIterateForInvalidation?: number;
getCurrentProgram(): Program;
}
interface DirectoryWatchesOfFailedLookup {
@@ -472,6 +473,11 @@ namespace ts {
resolutionHost.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
}
// Ignore emits from the program
if (isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectory)) {
return;
}
// If the files are added to project root or node_modules directory, always run through the invalidation process
// Otherwise run through invalidation only if adding to the immediate directory
if (!allFilesHaveInvalidatedResolution &&