-
-
Notifications
You must be signed in to change notification settings - Fork 726
Fix incorrect parser diagnostic message for duplicate export modifier #15879
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
base: main
Are you sure you want to change the base?
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. |
Co-authored-by: camc314 <[email protected]>
|
@copilot continue |
- Changed diagnostic from "export modifier must precede declare modifier" to "export modifier already seen" - Skip adding duplicate export modifier to the modifiers list to avoid secondary validation error - Add test case for duplicate export modifier - Handle empty modifiers case when all modifiers are skipped Co-authored-by: camc314 <[email protected]>
Completed the fix for the duplicate export modifier diagnostic message in commit 4ed6304. The parser now correctly reports The fix also eliminates the secondary validation error by skipping the duplicate export modifier from being added to the modifiers list. |
|
@copilot run |
- Updated parser_misc.snap to include new test case - Updated parser_typescript.snap to reflect correct diagnostic message Co-authored-by: camc314 <[email protected]>
Completed in commit 61c94ea. Coverage tests and entire test suite run successfully. Snapshots updated:
All tests pass including parser_misc (119/119 negative tests), parser_test262 (99.98%), parser_babel (98.20%), and parser_typescript (99.88%). |
Fix incorrect parser diagnostic message for duplicate export modifier
crates/oxc_parser/src/modifiers.rseat_modifiers_before_declarationfunctionChanges Made
Modified the
eat_modifiers_before_declarationfunction incrates/oxc_parser/src/modifiers.rsto:exportmodifier appears after an export declaration is already startedTS(1030): 'export' modifier already seen.instead of the incorrectTS(1029): 'export' modifier must precede 'declare' modifier.Added test case:
tasks/coverage/misc/fail/duplicate-export-modifier.tsUpdated snapshots:
tasks/coverage/snapshots/parser_misc.snap- Added new test case entrytasks/coverage/snapshots/parser_typescript.snap- Updated diagnostic messages for duplicate export modifiersBefore
After
Testing
Fixes #15870
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.