Skip to content

feat(parser): change span for missing initializer in decleration#17134

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/12-19-feat_parser_change_span_for_missing_initializer_in_decleration
Dec 22, 2025
Merged

feat(parser): change span for missing initializer in decleration#17134
graphite-app[bot] merged 1 commit intomainfrom
c/12-19-feat_parser_change_span_for_missing_initializer_in_decleration

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Dec 19, 2025

No description provided.

Copy link
Contributor Author

camc314 commented Dec 19, 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.

@camc314 camc314 marked this pull request as ready for review December 19, 2025 15:54
@github-actions github-actions bot added A-parser Area - Parser C-enhancement Category - New feature or request labels Dec 19, 2025
@camc314 camc314 self-assigned this Dec 19, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 19, 2025

CodSpeed Performance Report

Merging #17134 will not alter performance

Comparing c/12-19-feat_parser_change_span_for_missing_initializer_in_decleration (c194742) with main (3984750)1

Summary

✅ 42 untouched
⏩ 3 skipped2

Footnotes

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

  2. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camc314 camc314 force-pushed the c/12-19-feat_parser_add_diagnostic_for_parameters_with_question_mark_and_initializer branch from f953392 to f2fc66d Compare December 19, 2025 22:08
@camc314 camc314 force-pushed the c/12-19-feat_parser_change_span_for_missing_initializer_in_decleration branch from f8b9ebf to 41f6781 Compare December 19, 2025 22:08
@camc314 camc314 force-pushed the c/12-19-feat_parser_add_diagnostic_for_parameters_with_question_mark_and_initializer branch from f2fc66d to be1a82d Compare December 19, 2025 22:11
@camc314 camc314 force-pushed the c/12-19-feat_parser_change_span_for_missing_initializer_in_decleration branch 2 times, most recently from 23ce59c to a1b3267 Compare December 21, 2025 14:53
@camc314 camc314 force-pushed the c/12-19-feat_parser_add_diagnostic_for_parameters_with_question_mark_and_initializer branch from be1a82d to 93a5f9e Compare December 21, 2025 14:53
@camc314 camc314 force-pushed the c/12-19-feat_parser_change_span_for_missing_initializer_in_decleration branch from a1b3267 to bf33966 Compare December 22, 2025 09:05
@camc314 camc314 force-pushed the c/12-19-feat_parser_add_diagnostic_for_parameters_with_question_mark_and_initializer branch from 93a5f9e to 32b9c4b Compare December 22, 2025 09:05
@camc314 camc314 force-pushed the c/12-19-feat_parser_change_span_for_missing_initializer_in_decleration branch from bf33966 to 6b746c6 Compare December 22, 2025 09:57
@camc314 camc314 force-pushed the c/12-19-feat_parser_add_diagnostic_for_parameters_with_question_mark_and_initializer branch from 32b9c4b to 16728ff Compare December 22, 2025 09:57
@graphite-app graphite-app bot force-pushed the c/12-19-feat_parser_add_diagnostic_for_parameters_with_question_mark_and_initializer branch from 16728ff to d751de8 Compare December 22, 2025 10:12
@graphite-app graphite-app bot force-pushed the c/12-19-feat_parser_add_diagnostic_for_parameters_with_question_mark_and_initializer branch from d751de8 to ffe9ae2 Compare December 22, 2025 10:12
@graphite-app graphite-app bot force-pushed the c/12-19-feat_parser_change_span_for_missing_initializer_in_decleration branch from 6b746c6 to 4a7309f Compare December 22, 2025 10:12
@graphite-app graphite-app bot changed the base branch from c/12-19-feat_parser_add_diagnostic_for_parameters_with_question_mark_and_initializer to graphite-base/17134 December 22, 2025 10:24
@camc314 camc314 force-pushed the c/12-19-feat_parser_change_span_for_missing_initializer_in_decleration branch from 4a7309f to c194742 Compare December 22, 2025 10:25
@camc314 camc314 force-pushed the graphite-base/17134 branch from ffe9ae2 to 3ee71b0 Compare December 22, 2025 10:25
@camc314 camc314 changed the base branch from graphite-base/17134 to c/12-19-feat_parser_add_diagnostic_for_parameters_with_question_mark_and_initializer December 22, 2025 10:25
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Dec 22, 2025
Copy link
Contributor Author

camc314 commented Dec 22, 2025

Merge activity

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 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.

Base automatically changed from c/12-19-feat_parser_add_diagnostic_for_parameters_with_question_mark_and_initializer to main December 22, 2025 10:30
@graphite-app graphite-app bot force-pushed the c/12-19-feat_parser_change_span_for_missing_initializer_in_decleration branch from c194742 to a15e183 Compare December 22, 2025 10:37
@graphite-app graphite-app bot merged commit a15e183 into main Dec 22, 2025
21 checks passed
@graphite-app graphite-app bot deleted the c/12-19-feat_parser_change_span_for_missing_initializer_in_decleration branch December 22, 2025 10:43
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants