Repository navigation
fix: handle UTF-16 diagnostic columns - #36028
Merged
nathanwhit merged 2 commits intoJul 21, 2026
Merged
Conversation
nathanwhit
marked this pull request as ready for review
July 14, 2026 02:24
This comment was marked as spam.
This comment was marked as spam.
bartlomieju
pushed a commit
that referenced
this pull request
Jul 23, 2026
- interpret runtime and TypeScript diagnostic columns as UTF-16 code-unit offsets - preserve tabs and spacing when building source-line underlines - omit an underline or show the existing warning when a position is not a valid source boundary V8 and TypeScript report source columns in UTF-16 code units, while Rust strings are UTF-8 and iterate by Unicode scalar value. Treating the reported column as a scalar index produces incorrect source-line formatting for non-BMP characters and can prevent the original diagnostic from being displayed. - `./tools/format.js` - `cargo fmt --check --package deno_runtime --package deno` - `CARGO_TARGET_DIR=target cargo test -p deno_runtime fmt_errors --lib -- --nocapture` - `CARGO_TARGET_DIR=target cargo test -p deno tsc::diagnostics -- --nocapture` - `CARGO_TARGET_DIR=target cargo build --bin deno` - runtime and `deno check` smokes with non-BMP source lines
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.
Summary
Why
V8 and TypeScript report source columns in UTF-16 code units, while Rust strings are UTF-8 and iterate by Unicode scalar value. Treating the reported column as a scalar index produces incorrect source-line formatting for non-BMP characters and can prevent the original diagnostic from being displayed.
Validation
./tools/format.jscargo fmt --check --package deno_runtime --package denoCARGO_TARGET_DIR=target cargo test -p deno_runtime fmt_errors --lib -- --nocaptureCARGO_TARGET_DIR=target cargo test -p deno tsc::diagnostics -- --nocaptureCARGO_TARGET_DIR=target cargo build --bin denodeno checksmokes with non-BMP source lines