refactor(ast_tools): remove special-case logic for NodeId from CloneIn generator#21675
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 23, 2026
Conversation
Member
Author
This was referenced Apr 23, 2026
Merging this PR will not alter performance
Comparing Footnotes
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies the CloneIn derive generator in tasks/ast_tools by removing hard-coded special-casing for node_id fields, and instead relies on NodeId being Default plus schema-driven #[clone_in(default)] handling.
Changes:
- Removed
node_idspecial-cases from theCloneIngenerator (bothclone_inandclone_in_with_semantic_idspaths). - Marked
NodeIdas#[clone_in(default)]and addedDefault/CloneInimpls for it. - Updated generated AST
CloneInimpls to useDefault::default()fornode_idand genericCloneIn::clone_in_with_semantic_idsfor semantic cloning.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tasks/ast_tools/src/derives/clone_in.rs | Removes special-case node_id handling and relies on schema-driven defaults + generic CloneIn calls. |
| crates/oxc_syntax/src/node.rs | Adds #[clone_in(default)], Default, and CloneIn for NodeId to support the generator change. |
| crates/oxc_ast/src/generated/derive_clone_in.rs | Regenerated output reflecting the new defaulting/copy behavior for node_id. |
6d2b863 to
c79befa
Compare
cabcc3c to
f368805
Compare
This was referenced Apr 23, 2026
Contributor
Merge activity
|
c79befa to
634486d
Compare
graphite-app Bot
pushed a commit
that referenced
this pull request
Apr 23, 2026
…neIn` generator (#21675) Simplify `CloneIn` generator in `ast_tools`. Previously it had "special case" code for `NodeId`. Instead, implement `CloneIn` and `Default` on `NodeId`, and then `node_id: Cell<NodeId>` fields can be treated the same as any other field.
f368805 to
d8fc207
Compare
634486d to
c4a29bb
Compare
graphite-app Bot
pushed a commit
that referenced
this pull request
Apr 23, 2026
…neIn` generator (#21675) Simplify `CloneIn` generator in `ast_tools`. Previously it had "special case" code for `NodeId`. Instead, implement `CloneIn` and `Default` on `NodeId`, and then `node_id: Cell<NodeId>` fields can be treated the same as any other field.
d8fc207 to
773bd50
Compare
c4a29bb to
66f735a
Compare
graphite-app Bot
pushed a commit
that referenced
this pull request
Apr 23, 2026
…neIn` generator (#21675) Simplify `CloneIn` generator in `ast_tools`. Previously it had "special case" code for `NodeId`. Instead, implement `CloneIn` and `Default` on `NodeId`, and then `node_id: Cell<NodeId>` fields can be treated the same as any other field.
773bd50 to
4ab852a
Compare
Base automatically changed from
om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_get_id_generator
to
main
April 23, 2026 17:26
…neIn` generator (#21675) Simplify `CloneIn` generator in `ast_tools`. Previously it had "special case" code for `NodeId`. Instead, implement `CloneIn` and `Default` on `NodeId`, and then `node_id: Cell<NodeId>` fields can be treated the same as any other field.
4ab852a to
94772d0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Simplify
CloneIngenerator inast_tools.Previously it had "special case" code for
NodeId. Instead, implementCloneInandDefaultonNodeId, and thennode_id: Cell<NodeId>fields can be treated the same as any other field.