Skip to content

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Oct 31, 2025

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

Copy link
Member Author

sapphi-red commented Oct 31, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added A-parser Area - Parser A-semantic Area - Semantic A-ast Area - AST C-enhancement Category - New feature or request labels Oct 31, 2025
@graphite-app graphite-app bot changed the base branch from 10-31-fix_tasks_coverage_skip_some_babel_tests_on_windows_as_well to graphite-base/15186 October 31, 2025 06:45
@Boshen
Copy link
Member

Boshen commented Oct 31, 2025

I like this.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 31, 2025

CodSpeed Performance Report

Merging #15186 will not alter performance

Comparing 10-31-feat_parser_add_more_helps_to_parser_errors (0b45396) with main (85fb8e8)1

Summary

✅ 37 untouched

Footnotes

  1. No successful run was found on main (205aab6) during the generation of this report, so 85fb8e8 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@graphite-app graphite-app bot force-pushed the graphite-base/15186 branch from a958218 to 205aab6 Compare October 31, 2025 06:52
@graphite-app graphite-app bot force-pushed the 10-31-feat_parser_add_more_helps_to_parser_errors branch from c722f56 to 8172503 Compare October 31, 2025 06:52
@graphite-app graphite-app bot changed the base branch from graphite-base/15186 to main October 31, 2025 06:52
@graphite-app graphite-app bot force-pushed the 10-31-feat_parser_add_more_helps_to_parser_errors branch from 8172503 to 643683b Compare October 31, 2025 06:53
@sapphi-red sapphi-red force-pushed the 10-31-feat_parser_add_more_helps_to_parser_errors branch from 643683b to 0b45396 Compare October 31, 2025 06:58
@github-actions github-actions bot added A-linter Area - Linter A-transformer Area - Transformer / Transpiler labels Oct 31, 2025
@sapphi-red sapphi-red requested a review from Boshen October 31, 2025 07:03
@sapphi-red sapphi-red marked this pull request as ready for review October 31, 2025 07:03
Copilot AI review requested due to automatic review settings October 31, 2025 07:03
Copy link
Contributor

Copilot AI left a 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_LIST constant 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.

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Oct 31, 2025
Copy link
Member

Boshen commented Oct 31, 2025

Merge activity

Added more helps to parser errors to make it easier to understand how the error can be resolved.
@graphite-app graphite-app bot force-pushed the 10-31-feat_parser_add_more_helps_to_parser_errors branch from 0b45396 to 682dca2 Compare October 31, 2025 07:10
@graphite-app graphite-app bot merged commit 682dca2 into main Oct 31, 2025
21 checks passed
@graphite-app graphite-app bot deleted the 10-31-feat_parser_add_more_helps_to_parser_errors branch October 31, 2025 07:16
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST A-linter Area - Linter A-parser Area - Parser A-semantic Area - Semantic A-transformer Area - Transformer / Transpiler C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants