Skip to content

fix(check): don't interleave errors with "Check" lines in a workspace#35687

Merged
bartlomieju merged 2 commits into
mainfrom
fix/check-workspace-interleaved-output
Jul 1, 2026
Merged

fix(check): don't interleave errors with "Check" lines in a workspace#35687
bartlomieju merged 2 commits into
mainfrom
fix/check-workspace-interleaved-output

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

Fixes #30322.

When type checking a workspace with multiple folders, deno check could
print type errors in the middle of the Check ... output lines:

Check ...
Check ...
Error ...
Check ...
Check ...

Root cause

TypeChecker::check() consumes a lazy, per-folder diagnostics iterator.
Each call to the iterator's next() prints that folder's Check ... line
and runs tsc, while the caller emitted that folder's errors immediately
after each iteration step. In a multi-folder workspace this meant errors
from one folder were printed in the middle of the Check ... lines of the
following folders.

Fix

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:

Check ...
Check ...
Check ...
Error ...

Tests

Three existing spec tests encoded the old interleaved order; their .out
files are updated to the correct grouped order:

  • check/check_workspace
  • check/workspace
  • check/workspace_compiler_option_types

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
bartlomieju enabled auto-merge (squash) July 1, 2026 20:17
@bartlomieju
bartlomieju merged commit abc920a into main Jul 1, 2026
136 checks passed
@bartlomieju
bartlomieju deleted the fix/check-workspace-interleaved-output branch July 1, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deno check in a workspace can output check errors in the middle of the output

1 participant