refactor(ast_tools): include NodeId in AST schema#21673
Merged
graphite-app[bot] merged 1 commit intoApr 23, 2026
Merged
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 ast_tools schema/codegen to treat NodeId like other AST-discoverable ID types by marking it with #[ast] and removing hard-coded “primitive” handling.
Changes:
- Annotate
NodeIdwith#[ast]so it can be discovered via AST schema parsing. - Remove
NodeIdspecial-casing from primitive handling in parsing and raw-transfer generators. - Update layout assertion generation to treat
NodeIdas a struct and regenerate related checked-in generated artifacts.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tasks/ast_tools/src/parse/parse.rs | Removes NodeId from the hard-coded primitive type list. |
| tasks/ast_tools/src/generators/raw_transfer_lazy.rs | Drops the primitive-specific skip for NodeId (no longer a primitive). |
| tasks/ast_tools/src/generators/raw_transfer.rs | Drops the primitive-specific skip for NodeId (no longer a primitive). |
| tasks/ast_tools/src/generators/assert_layouts.rs | Treats NodeId as a struct for layout calculation and updates imports accordingly. |
| crates/oxc_syntax/src/node.rs | Adds #[ast] to NodeId and imports the ast attribute. |
| crates/oxc_syntax/src/generated/assert_layouts.rs | Regenerated: adds NodeId layout assertions and required imports. |
| crates/oxc_ast_macros/src/generated/structs.rs | Regenerated: includes NodeId in the struct-details map. |
overlookmotel
force-pushed
the
om/02-14-refactor_ast_tools_include_nodeid_in_ast_schema
branch
from
April 23, 2026 13:56
fe9b1f7 to
7e96340
Compare
This was referenced Apr 23, 2026
Contributor
Merge activity
|
Simplify treatment of `NodeId` in `ast_tools` codegen. Add `#[ast]` attr to the type, and allow codegen to discover it, rather than hard-coding it into codegen as a "primitive" type. This matches how `SymbolId`, `ScopeId` and `ReferenceId` are treated. Does not alter generated code, only the means by which it's generated.
graphite-app
Bot
force-pushed
the
om/02-14-refactor_ast_tools_include_nodeid_in_ast_schema
branch
from
April 23, 2026 15:34
7e96340 to
58b3e46
Compare
graphite-app
Bot
deleted the
om/02-14-refactor_ast_tools_include_nodeid_in_ast_schema
branch
April 23, 2026 15:43
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 treatment of
NodeIdinast_toolscodegen.Add
#[ast]attr to the type, and allow codegen to discover it, rather than hard-coding it into codegen as a "primitive" type.This matches how
SymbolId,ScopeIdandReferenceIdare treated.Does not alter generated code, only the means by which it's generated.