mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Do not trigger the failed lookup location invalidation for creation of program emit files
Handles #20934
This commit is contained in:
@@ -667,7 +667,8 @@ namespace ts {
|
||||
dropDiagnosticsProducingTypeChecker,
|
||||
getSourceFileFromReference,
|
||||
sourceFileToPackageName,
|
||||
redirectTargetsSet
|
||||
redirectTargetsSet,
|
||||
isEmittedFile
|
||||
};
|
||||
|
||||
verifyCompilerOptions();
|
||||
@@ -2343,6 +2344,20 @@ namespace ts {
|
||||
hasEmitBlockingDiagnostics.set(toPath(emitFileName), true);
|
||||
programDiagnostics.add(diag);
|
||||
}
|
||||
|
||||
function isEmittedFile(file: string) {
|
||||
if (options.noEmit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return forEachEmittedFile(getEmitHost(), ({ jsFilePath, declarationFilePath }) =>
|
||||
isSameFile(jsFilePath, file) ||
|
||||
(declarationFilePath && isSameFile(declarationFilePath, file)));
|
||||
}
|
||||
|
||||
function isSameFile(file1: string, file2: string) {
|
||||
return comparePaths(file1, file2, currentDirectory, !host.useCaseSensitiveFileNames()) === Comparison.EqualTo;
|
||||
}
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
|
||||
Reference in New Issue
Block a user