Skip to content

Comments

refactor(formatter): adjust implementations of Function and ArrowFunctionExpression#16035

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-24-refactor_formatter_adjust_implementations_of_function_and_arrowfunctionexpression
Nov 25, 2025
Merged

refactor(formatter): adjust implementations of Function and ArrowFunctionExpression#16035
graphite-app[bot] merged 1 commit intomainfrom
11-24-refactor_formatter_adjust_implementations_of_function_and_arrowfunctionexpression

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Nov 24, 2025

Pure refactor, I am going to remove Format::fmt_with_options

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

Dunqing commented Nov 24, 2025


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 Nov 24, 2025

CodSpeed Performance Report

Merging #16035 will not alter performance

Comparing 11-24-refactor_formatter_adjust_implementations_of_function_and_arrowfunctionexpression (e1f3d4d) with main (862bdf7)1

Summary

✅ 38 untouched
⏩ 7 skipped2

Footnotes

  1. No successful run was found on main (a446e2c) during the generation of this report, so 862bdf7 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

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

@graphite-app graphite-app bot changed the base branch from 11-24-refactor_formatter_replace_format_once_with_format_with_where_possible to graphite-base/16035 November 24, 2025 09:02
@graphite-app graphite-app bot force-pushed the graphite-base/16035 branch from c76ff3c to 66bab34 Compare November 24, 2025 09:08
@graphite-app graphite-app bot force-pushed the 11-24-refactor_formatter_adjust_implementations_of_function_and_arrowfunctionexpression branch from d922b54 to 76fddc3 Compare November 24, 2025 09:08
@graphite-app graphite-app bot changed the base branch from graphite-base/16035 to main November 24, 2025 09:09
@graphite-app graphite-app bot force-pushed the 11-24-refactor_formatter_adjust_implementations_of_function_and_arrowfunctionexpression branch from 76fddc3 to b478d7f Compare November 24, 2025 09:09
@Dunqing Dunqing force-pushed the 11-24-refactor_formatter_adjust_implementations_of_function_and_arrowfunctionexpression branch from b478d7f to e1f3d4d Compare November 25, 2025 06:21
@Dunqing Dunqing marked this pull request as ready for review November 25, 2025 07:59
Copilot AI review requested due to automatic review settings November 25, 2025 07:59
Copy link
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

This PR refactors the formatter implementations for Function and ArrowFunctionExpression in preparation for removing Format::fmt_with_options. The changes establish a cleaner pattern where formatting types provide explicit constructor methods and a public format() method, with the Format trait implementation delegating to this method.

Key changes:

  • Introduced new() and new_with_options() constructors for FormatFunction and FormatJsArrowFunctionExpression
  • Added public format() methods that contain the actual formatting logic
  • Renamed call_arg_layout field to the more descriptive call_argument_layout throughout the codebase

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
crates/oxc_formatter/src/write/mod.rs Removed FormatWrite implementation for ArrowFunctionExpression (moved to dedicated file)
crates/oxc_formatter/src/write/function.rs Reorganized code: moved FormatWrite impl to top, added new/new_with_options/format methods, updated Format trait to delegate to format()
crates/oxc_formatter/src/write/arrow_function_expression.rs Added FormatWrite impl (moved from mod.rs), added new/new_with_options/format methods, renamed call_arg_layout to call_argument_layout, updated Format trait to delegate to format()
crates/oxc_formatter/src/write/call_arguments.rs Updated all call sites to use new constructors instead of fmt_with_options(), fixed field name from call_arg_layout to call_argument_layout

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 25, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 25, 2025

Merge activity

…tionExpression (#16035)

Pure refactor, I am going to remove `Format::fmt_with_options`
@graphite-app graphite-app bot force-pushed the 11-24-refactor_formatter_adjust_implementations_of_function_and_arrowfunctionexpression branch from e1f3d4d to a4b70c3 Compare November 25, 2025 09:55
@graphite-app graphite-app bot merged commit a4b70c3 into main Nov 25, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 11-24-refactor_formatter_adjust_implementations_of_function_and_arrowfunctionexpression branch November 25, 2025 10:00
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 25, 2025
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
…tionExpression (oxc-project#16035)

Pure refactor, I am going to remove `Format::fmt_with_options`
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.

1 participant