mirror of
https://github.com/denoland/deno.git
synced 2025-07-23 05:05:08 +00:00
fix(check): ensure diagnostics caused by changes in other files get invalidated between runs (#18541)
Regression caused by the performance improvement in #18329. Figuring this out was hard. It's luckily still fast after this change. Closes #18516
This commit is contained in:
parent
c162647020
commit
23b9be7b37
4 changed files with 90 additions and 69 deletions
|
@ -824,6 +824,23 @@ delete Object.prototype.__proto__;
|
|||
return sourceFile;
|
||||
})
|
||||
: undefined;
|
||||
|
||||
if (checkFiles != null) {
|
||||
// When calling program.getSemanticDiagnostics(...) with a source file, we
|
||||
// need to call this code first in order to get it to invalidate cached
|
||||
// diagnostics correctly. This is what program.getSemanticDiagnostics()
|
||||
// does internally when calling without any arguments.
|
||||
const checkFileNames = new Set(checkFiles.map((f) => f.fileName));
|
||||
while (
|
||||
program.getSemanticDiagnosticsOfNextAffectedFile(
|
||||
undefined,
|
||||
/* ignoreSourceFile */ (s) => !checkFileNames.has(s.fileName),
|
||||
)
|
||||
) {
|
||||
// keep going until there are no more affected files
|
||||
}
|
||||
}
|
||||
|
||||
const diagnostics = [
|
||||
...program.getConfigFileParsingDiagnostics(),
|
||||
...(checkFiles == null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue