refactor(ast_tools): remove special-case logic for NodeId from ContentEq generator#21677
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Pull request overview
Refactors the ContentEq derive generator in ast_tools to remove hard-coded skipping of node_id fields, instead relying on the type-level #[content_eq(skip)] attribute on NodeId so Cell<NodeId> fields are handled uniformly via existing skip logic.
Changes:
- Removed the
field.name() != "node_id"special-case filter from theContentEqstruct derive generator. - Added
#[content_eq(skip)]toNodeIdso any fields whose innermost type isNodeIdare excluded by the generator’s existing “skip types marked withcontent_eq(skip)” logic.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tasks/ast_tools/src/derives/content_eq.rs | Removes node_id name-based skipping; relies on existing type-level skip filtering. |
| crates/oxc_syntax/src/node.rs | Marks NodeId with #[content_eq(skip)] to exclude it from generated content equality. |
a30b94f to
786fcd5
Compare
fe4ed7c to
00d9078
Compare
Merge activity
|
00d9078 to
150d25b
Compare
…tentEq` generator (#21677) Simplify `ContentEq` generator in `ast_tools`. Previously it had "special case" code for `NodeId`. Instead, add a `#[content_eq(skip)]` attr to `NodeId` type, and then `node_id: Cell<NodeId>` fields can be treated the same as any other field. Does not alter generated code, only the means by which it's generated.
786fcd5 to
ed660cf
Compare
150d25b to
28e97e7
Compare
…tentEq` generator (#21677) Simplify `ContentEq` generator in `ast_tools`. Previously it had "special case" code for `NodeId`. Instead, add a `#[content_eq(skip)]` attr to `NodeId` type, and then `node_id: Cell<NodeId>` fields can be treated the same as any other field. Does not alter generated code, only the means by which it's generated.
ed660cf to
f30e3c2
Compare
28e97e7 to
30d2660
Compare
…tentEq` generator (#21677) Simplify `ContentEq` generator in `ast_tools`. Previously it had "special case" code for `NodeId`. Instead, add a `#[content_eq(skip)]` attr to `NodeId` type, and then `node_id: Cell<NodeId>` fields can be treated the same as any other field. Does not alter generated code, only the means by which it's generated.
f30e3c2 to
ea3bfd8
Compare
…tentEq` generator (#21677) Simplify `ContentEq` generator in `ast_tools`. Previously it had "special case" code for `NodeId`. Instead, add a `#[content_eq(skip)]` attr to `NodeId` type, and then `node_id: Cell<NodeId>` fields can be treated the same as any other field. Does not alter generated code, only the means by which it's generated.
30d2660 to
06fa11e
Compare
ea3bfd8 to
aad7d98
Compare

Simplify
ContentEqgenerator inast_tools.Previously it had "special case" code for
NodeId. Instead, add a#[content_eq(skip)]attr toNodeIdtype, and thennode_id: Cell<NodeId>fields can be treated the same as any other field.Does not alter generated code, only the means by which it's generated.