feat(parser): change span for missing initializer in decleration#17134
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. |
CodSpeed Performance ReportMerging #17134 will not alter performanceComparing Summary
Footnotes
|
f953392 to
f2fc66d
Compare
f8b9ebf to
41f6781
Compare
f2fc66d to
be1a82d
Compare
23ce59c to
a1b3267
Compare
be1a82d to
93a5f9e
Compare
a1b3267 to
bf33966
Compare
93a5f9e to
32b9c4b
Compare
bf33966 to
6b746c6
Compare
32b9c4b to
16728ff
Compare
16728ff to
d751de8
Compare
d751de8 to
ffe9ae2
Compare
6b746c6 to
4a7309f
Compare
4a7309f to
c194742
Compare
ffe9ae2 to
3ee71b0
Compare
Merge activity
|
There was a problem hiding this comment.
Pull request overview
This PR improves error reporting for missing initializers in variable declarations by narrowing the span to highlight only the identifier name instead of the entire declaration including type annotations. This makes error messages more precise and focused.
Key Changes:
- Simplified span calculation for missing initializer errors in const declarations
- Simplified span calculation for missing initializer errors in using declarations
- Updated test snapshots to reflect the shorter, more focused error spans
Reviewed changes
Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
crates/oxc_parser/src/js/declaration.rs |
Modified error span for missing initializers in both check_missing_initializer() and parse_using_declaration() to use only the identifier span instead of merging identifier and type annotation spans |
tasks/coverage/snapshots/parser_typescript.snap |
Updated 26 test case snapshots showing the new shorter error spans that highlight only the identifier in missing initializer errors |
tasks/coverage/snapshots/parser_babel.snap |
Updated 2 test case snapshots showing the new shorter error spans for const declarations without initializers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c194742 to
a15e183
Compare

No description provided.