-
-
Notifications
You must be signed in to change notification settings - Fork 723
feat(parser): add more helps to parser errors #15186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(parser): add more helps to parser errors #15186
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
I like this. |
CodSpeed Performance ReportMerging #15186 will not alter performanceComparing Summary
Footnotes |
a958218 to
205aab6
Compare
c722f56 to
8172503
Compare
8172503 to
643683b
Compare
643683b to
0b45396
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request enhances error messages throughout the parser by adding helpful suggestions to diagnostic messages. The main goal is to improve the developer experience by providing actionable guidance when parsing errors occur.
Key changes:
- Added help messages to over 30+ different error diagnostics
- Fixed typo: "thew" → "the" in new.target error messages
- Fixed typo: "missinginitializer" → "missing_initializer" in function name
- Fixed typo: "Try insert" → "Try inserting" for semicolon insertion help
- Added
REGEXP_FLAGS_LISTconstant for consistent flag validation messaging - Enhanced several error diagnostics with contextual labels for better clarity
Reviewed Changes
Copilot reviewed 10 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_parser/src/diagnostics.rs | Added help messages to 30+ error diagnostics and improved message clarity |
| crates/oxc_semantic/src/checker/javascript.rs | Added help messages for 'arguments' usage errors and new.target errors, fixed typo |
| crates/oxc_parser/src/js/class.rs | Enhanced extends/implements clause error messages with dual labels |
| crates/oxc_parser/src/js/declaration.rs | Fixed function name typo |
| crates/oxc_ast/src/ast/literal.rs | Added REGEXP_FLAGS_LIST constant for validation messages |
| tasks/coverage/snapshots/*.snap | Updated snapshots to reflect new error messages |
| napi/parser/test/parse.test.ts | Updated test expectations for new error messages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
Added more helps to parser errors to make it easier to understand how the error can be resolved.
0b45396 to
682dca2
Compare

Added more helps to parser errors to make it easier to understand how the error can be resolved.