Merge pull request #21281 from Microsoft/isEmittedFileCheckInInvalidateResolution

Check if the file added is emitted file after validating extensions
This commit is contained in:
Sheetal Nandi 2018-01-19 13:04:28 -08:00 committed by GitHub
commit 8c0454027b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -473,11 +473,6 @@ 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 &&
@ -581,6 +576,10 @@ namespace ts {
if (!isPathWithDefaultFailedLookupExtension(fileOrDirectoryPath) && !customFailedLookupPaths.has(fileOrDirectoryPath)) {
return false;
}
// Ignore emits from the program
if (isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) {
return false;
}
// Resolution need to be invalidated if failed lookup location is same as the file or directory getting created
isChangedFailedLookupLocation = location => resolutionHost.toPath(location) === fileOrDirectoryPath;
}