When checking sourceFile is from external library, use sourceFile.resolvedPath since thats how the source files are queried and thats the real path

Fixes #32086
This commit is contained in:
Sheetal Nandi
2019-06-28 10:14:33 -07:00
parent b32afb55d1
commit 4f802e7205
2 changed files with 76 additions and 1 deletions

View File

@@ -1395,7 +1395,7 @@ namespace ts {
const filePath = newSourceFile.path;
addFileToFilesByName(newSourceFile, filePath, newSourceFile.resolvedPath);
// Set the file as found during node modules search if it was found that way in old progra,
if (oldProgram.isSourceFileFromExternalLibrary(oldProgram.getSourceFileByPath(filePath)!)) {
if (oldProgram.isSourceFileFromExternalLibrary(oldProgram.getSourceFileByPath(newSourceFile.resolvedPath)!)) {
sourceFilesFoundSearchingNodeModules.set(filePath, true);
}
}