refactor(semantic): remove unnecessary code#18096
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.
Pull request overview
This PR removes a custom visit_ts_enum_body implementation from SemanticBuilder to rely on the default implementation from the Visit trait. The PR description states the custom implementation is identical to the default, but this is actually a bug fix as the removed custom implementation was missing a visit_span call that the default implementation includes.
Changes:
- Removed custom
visit_ts_enum_bodymethod fromSemanticBuilderinbuilder.rs
Comments suppressed due to low confidence (1)
crates/oxc_semantic/src/builder.rs:1
- The removed custom implementation was missing a
visit_span(&body.span)call that exists in the defaultwalk_ts_enum_bodyimplementation. While removing this code is correct (allowing the default implementation to be used), the PR description is misleading as it states the implementations are 'identical' when in fact the custom implementation had a bug (missing span visit). The removal is actually a bug fix, not just removal of unnecessary code. Consider updating the PR description to clarify this is fixing a missing span visit rather than just removing duplicate code.
//! Semantic Builder
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
Follow-on after #18058. `visit_ts_enum_body` method added to `SemanticBuilder` in that PR is unnecessary, as it's identical to the default implementation provided by `Visit` trait. Remove it.
8e94bb7 to
4a312a0
Compare

Follow-on after #18058.
visit_ts_enum_bodymethod added toSemanticBuilderin that PR is unnecessary, as it's identical to the default implementation provided byVisittrait. Remove it.