refactor(ast_tools): remove special-case logic for NodeId from get_id generator#21674
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
Refactors the get_id code generator in ast_tools to remove the special-case NodeId handling by treating NodeId the same as other ID types and emitting getters/setters via a unified path.
Changes:
- Adds
NodeIdto the set of ID types handled by the shared getter/setter generation logic. - Updates generator logic to support both
Cell<T>andCell<Option<T>>ID fields (optionality-aware docs and bodies). - Regenerates
crates/oxc_ast/src/generated/get_id.rsaccordingly (method ordering + updated docstrings).
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tasks/ast_tools/src/generators/get_id.rs | Removes node_id special-casing and generates getters/setters for NodeId through the same pipeline as other IDs. |
| crates/oxc_ast/src/generated/get_id.rs | Regenerated output reflecting the unified generation (including updated NodeId docs and method placement). |
6d2b863 to
c79befa
Compare
fe9b1f7 to
7e96340
Compare
This was referenced Apr 23, 2026
Contributor
Merge activity
|
7e96340 to
58b3e46
Compare
graphite-app Bot
pushed a commit
that referenced
this pull request
Apr 23, 2026
…_id` generator (#21674) Simplify `get_id` generator in `ast_tools`. Instead of separate code to handle generating `node_id` and `set_node_id` methods, just treat `NodeId` the same as `ScopeId`, `SymbolId` and `ReferenceId`, and reuse the same code.
c79befa to
634486d
Compare
Base automatically changed from
om/02-14-refactor_ast_tools_include_nodeid_in_ast_schema
to
main
April 23, 2026 15:43
graphite-app Bot
pushed a commit
that referenced
this pull request
Apr 23, 2026
…_id` generator (#21674) Simplify `get_id` generator in `ast_tools`. Instead of separate code to handle generating `node_id` and `set_node_id` methods, just treat `NodeId` the same as `ScopeId`, `SymbolId` and `ReferenceId`, and reuse the same code.
634486d to
c4a29bb
Compare
…_id` generator (#21674) Simplify `get_id` generator in `ast_tools`. Instead of separate code to handle generating `node_id` and `set_node_id` methods, just treat `NodeId` the same as `ScopeId`, `SymbolId` and `ReferenceId`, and reuse the same code.
c4a29bb to
66f735a
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
get_idgenerator inast_tools.Instead of separate code to handle generating
node_idandset_node_idmethods, just treatNodeIdthe same asScopeId,SymbolIdandReferenceId, and reuse the same code.