fix(check): don't interleave errors with "Check" lines in a workspace#35687
Merged
Conversation
When type checking a workspace with multiple folders, the diagnostics iterator printed a "Check ..." line and ran tsc per folder, and the caller emitted that folder's errors immediately after each iteration step. This meant errors from one folder were printed in the middle of the "Check ..." lines of the following folders. Drain the diagnostics iterator first (which prints all the "Check ..." lines and runs tsc for every folder), then emit warnings and errors, so all the "Check ..." lines appear before any diagnostics. Closes #30322
The number of folders to be checked is known up front, so reserve the exact capacity for the drained diagnostics vector instead of growing it incrementally.
bartlomieju
enabled auto-merge (squash)
July 1, 2026 20:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #30322.
When type checking a workspace with multiple folders,
deno checkcouldprint type errors in the middle of the
Check ...output lines:Root cause
TypeChecker::check()consumes a lazy, per-folder diagnostics iterator.Each call to the iterator's
next()prints that folder'sCheck ...lineand runs
tsc, while the caller emitted that folder's errors immediatelyafter each iteration step. In a multi-folder workspace this meant errors
from one folder were printed in the middle of the
Check ...lines of thefollowing folders.
Fix
Drain the diagnostics iterator first (which prints all the
Check ...lines and runs
tscfor every folder), then emit warnings and errors, soall the
Check ...lines appear before any diagnostics:Tests
Three existing spec tests encoded the old interleaved order; their
.outfiles are updated to the correct grouped order:
check/check_workspacecheck/workspacecheck/workspace_compiler_option_types