Repository navigation
fix(core): show line, column and code frame in parse and transform errors - #850
Merged
Merged
Conversation
…rors `join_errors` attached the source but formatted each diagnostic with `to_string()`, which prints only the message, so `Failed to parse` and `Failed to transform` gave no way to find the error in a large file. Render each diagnostic with oxc's colorless graphical report instead: a `path:line:column` header (the decoded path, not the `file:` URL) and the offending lines, without wrapping the message. Closes #839 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c00809f52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The code frame prints every line it shows whole, so a syntax error in a minified file copied the entire multi-megabyte line into the error. When a frame line exceeds 1000 bytes, or the frame exceeds 10 KB, render the message with an `at path:line:column` location instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Closes #839
Problem
join_errorsattached the source withwith_source_codebut formatted each diagnostic withto_string(), which prints only the message.Failed to parseandFailed to transformtherefore gave no line, column or code frame:Fix
Each diagnostic now renders with oxc's
GraphicalReportHandler, using the colorlessGraphicalTheme::none()theme:path:line:column. The path is decoded from the load hook'sfile:URL, sosub dir/m#1.tsshows as written and stays clickable in editors and terminals.usize::MAX). A long message stays on one line, so searching for it still works. The default 80-column wrap splittargeting ECMAScript modulesand broke an existing test.The first line keeps its old form,
Failed to parse <url>:, with the reports following it:Tests
file:URL name, and that messages are not wrapped.packages/integrate-vitest/__tests__/diagnostics.spec.ts: covers an ESM parse error, a CommonJSrequireparse error, a path containing a space, and a transform error (TS(1203)).Verification (macOS arm64, Node 24.22)
cargo test --all-features,cargo clippy --all-targets --all-features -- -D warnings,vp run test(209 passed) andvp run lintall pass.🤖 Generated with Claude Code