Skip to content

refactor(ast_tools): remove special-case logic for NodeId from get_id generator#21674

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_get_id_generator
Apr 23, 2026
Merged

refactor(ast_tools): remove special-case logic for NodeId from get_id generator#21674
graphite-app[bot] merged 1 commit intomainfrom
om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_get_id_generator

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Apr 23, 2026

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.

Copy link
Copy Markdown
Member Author

overlookmotel commented Apr 23, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of 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.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 23, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_get_id_generator (66f735a) with main (bc6ade5)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@overlookmotel overlookmotel self-assigned this Apr 23, 2026
@overlookmotel overlookmotel marked this pull request as ready for review April 23, 2026 12:52
Copilot AI review requested due to automatic review settings April 23, 2026 12:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 NodeId to the set of ID types handled by the shared getter/setter generation logic.
  • Updates generator logic to support both Cell<T> and Cell<Option<T>> ID fields (optionality-aware docs and bodies).
  • Regenerates crates/oxc_ast/src/generated/get_id.rs accordingly (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).

Comment thread tasks/ast_tools/src/generators/get_id.rs Outdated
Comment thread tasks/ast_tools/src/generators/get_id.rs
@overlookmotel overlookmotel added C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior A-ast-tools Area - AST tools A-ast Area - AST labels Apr 23, 2026
@overlookmotel overlookmotel force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_get_id_generator branch from 6d2b863 to c79befa Compare April 23, 2026 13:56
@overlookmotel overlookmotel force-pushed the om/02-14-refactor_ast_tools_include_nodeid_in_ast_schema branch from fe9b1f7 to 7e96340 Compare April 23, 2026 13:56
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented Apr 23, 2026

Merge activity

  • Apr 23, 3:33 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Apr 23, 4:14 PM UTC: This pull request was removed from the Graphite merge queue because the batch it was included in timed out. Please re-enqueue the PR to retry merge.
  • Apr 23, 5:18 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Apr 23, 5:26 PM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_include_nodeid_in_ast_schema branch from 7e96340 to 58b3e46 Compare April 23, 2026 15:34
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.
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_get_id_generator branch from c79befa to 634486d Compare April 23, 2026 15:35
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.
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_get_id_generator branch from 634486d to c4a29bb Compare April 23, 2026 15:45
…_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.
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_get_id_generator branch from c4a29bb to 66f735a Compare April 23, 2026 17:19
@graphite-app graphite-app Bot merged commit 66f735a into main Apr 23, 2026
36 checks passed
@graphite-app graphite-app Bot deleted the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_get_id_generator branch April 23, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST A-ast-tools Area - AST tools C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants