-
-
Notifications
You must be signed in to change notification settings - Fork 773
feat(parser): improve diagnostic messages for merge conflicts #15443
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): improve diagnostic messages for merge conflicts #15443
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. |
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 PR adds Git merge conflict marker detection to the parser, providing enhanced error messages when conflict markers (<<<<<<<, =======, >>>>>>>, |||||||) are encountered instead of generic "Unexpected token" errors.
- Implements merge conflict marker detection in the parser with support for diff3 format
- Adds comprehensive error messages with context-aware help text
- Includes test coverage for both valid code with markers in strings/comments and actual conflict markers
Reviewed Changes
Copilot reviewed 2 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_parser/src/error_handler.rs | Implements is_merge_conflict_marker() and find_merge_conflict_markers() methods for detecting all Git conflict marker patterns |
| crates/oxc_parser/src/diagnostics.rs | Adds merge_conflict_marker() diagnostic function with detailed help messages for different conflict scenarios |
| tasks/coverage/misc/pass/diff-markers-in-strings.js | Tests that markers in strings, templates, and comments don't trigger false positives |
| tasks/coverage/misc/fail/diff-markers.js | Tests actual conflict marker detection in various contexts |
| tasks/coverage/snapshots/*.snap | Updates test coverage metrics and adds expected diagnostic output for conflict markers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ea1c6fa to
5603a5e
Compare
CodSpeed Performance ReportMerging #15443 will not alter performanceComparing Summary
Footnotes |
5603a5e to
ffb2d9d
Compare
ffb2d9d to
02218ae
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Merge activity
|
Adds detection and improved error messages for version control merge conflicts encountered in the parser. This is based upon rustc's implementation.
da6cf0f to
8951953
Compare

Adds detection and improved error messages for version control merge conflicts encountered in the parser.
This is based upon rustc's implementation.