Skip to content

refactor(formatter): use AstNode::parent method instead of accessing the parent field directly#18427

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-23-refactor_formatter_use_astnode_parent_method_instead_of_accessing_the_parent_field_directly
Jan 23, 2026
Merged

refactor(formatter): use AstNode::parent method instead of accessing the parent field directly#18427
graphite-app[bot] merged 1 commit intomainfrom
01-23-refactor_formatter_use_astnode_parent_method_instead_of_accessing_the_parent_field_directly

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Jan 23, 2026

Prepare for #18428

Additionally, I think this is a good change. Considering there are grand_parent and ancestor methods in the AstNode, this change maintains consistency in accessing related information.

@github-actions github-actions bot added A-formatter Area - Formatter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Jan 23, 2026
Copy link
Member Author

Dunqing commented Jan 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 hot fixes, skip the queue and merge this PR next

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

codspeed-hq bot commented Jan 23, 2026

Merging this PR will not alter performance

✅ 38 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing 01-23-refactor_formatter_use_astnode_parent_method_instead_of_accessing_the_parent_field_directly (05b457c) with 01-21-perf_formatter_reduce_astnode_size_by_8_bytes_using_following_span_start (d40fc7e)

Open in CodSpeed

Footnotes

  1. 7 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.

@Dunqing Dunqing changed the title refactor(formatter): use AstNode::parent method instead of accessing the parent field directly refactor(formatter): use AstNode::parent method instead of accessing the parent field directly Jan 23, 2026
@Dunqing Dunqing marked this pull request as ready for review January 23, 2026 04:59
Copy link
Member

@leaysgur leaysgur left a comment

Choose a reason for hiding this comment

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

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Jan 23, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 23, 2026

Merge activity

…g the `parent` field directly (#18427)

Prepare for #18428

Additionally, I think this is a good change. Considering there are `grand_parent` and `ancestor` methods in the AstNode, this change maintains consistency in accessing related information.
@graphite-app graphite-app bot force-pushed the 01-21-perf_formatter_reduce_astnode_size_by_8_bytes_using_following_span_start branch from d40fc7e to 194d384 Compare January 23, 2026 06:12
@graphite-app graphite-app bot requested a review from overlookmotel as a code owner January 23, 2026 06:12
@graphite-app graphite-app bot force-pushed the 01-23-refactor_formatter_use_astnode_parent_method_instead_of_accessing_the_parent_field_directly branch from 05b457c to b2cf35c Compare January 23, 2026 06:12
Base automatically changed from 01-21-perf_formatter_reduce_astnode_size_by_8_bytes_using_following_span_start to main January 23, 2026 06:18
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 23, 2026
@graphite-app graphite-app bot merged commit b2cf35c into main Jan 23, 2026
22 checks passed
@graphite-app graphite-app bot deleted the 01-23-refactor_formatter_use_astnode_parent_method_instead_of_accessing_the_parent_field_directly branch January 23, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter 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

Comments