Skip to content

refactor(ast_tools): remove special-case logic for NodeId from ContentEq generator#21677

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

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

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Apr 23, 2026

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.

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_contenteq_generator (aad7d98) with om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_dummy_generator (06fa11e)

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:58
Copilot AI review requested due to automatic review settings April 23, 2026 12:58
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 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 the ContentEq struct derive generator.
  • Added #[content_eq(skip)] to NodeId so any fields whose innermost type is NodeId are excluded by the generator’s existing “skip types marked with content_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.

@overlookmotel overlookmotel added C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior A-ast-tools Area - AST tools labels Apr 23, 2026
@overlookmotel overlookmotel force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator branch from a30b94f to 786fcd5 Compare April 23, 2026 13:56
@overlookmotel overlookmotel force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_dummy_generator branch from fe4ed7c to 00d9078 Compare April 23, 2026 13:56
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented Apr 23, 2026

Merge activity

@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_dummy_generator branch from 00d9078 to 150d25b Compare April 23, 2026 15:36
graphite-app Bot pushed a commit that referenced this pull request Apr 23, 2026
…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.
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator branch from 786fcd5 to ed660cf Compare April 23, 2026 15:37
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_dummy_generator branch from 150d25b to 28e97e7 Compare April 23, 2026 15:46
graphite-app Bot pushed a commit that referenced this pull request Apr 23, 2026
…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.
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator branch from ed660cf to f30e3c2 Compare April 23, 2026 15:47
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_dummy_generator branch from 28e97e7 to 30d2660 Compare April 23, 2026 17:20
graphite-app Bot pushed a commit that referenced this pull request Apr 23, 2026
…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.
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator branch from f30e3c2 to ea3bfd8 Compare April 23, 2026 17:21
…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.
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_dummy_generator branch from 30d2660 to 06fa11e Compare April 23, 2026 17:29
@graphite-app graphite-app Bot force-pushed the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator branch from ea3bfd8 to aad7d98 Compare April 23, 2026 17:29
Base automatically changed from om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_dummy_generator to main April 23, 2026 18:41
@graphite-app graphite-app Bot merged commit aad7d98 into main Apr 23, 2026
37 checks passed
@graphite-app graphite-app Bot deleted the om/02-14-refactor_ast_tools_remove_special-case_logic_for_nodeid_from_contenteq_generator branch April 23, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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