Skip to content

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Nov 13, 2025

Revert all changes in the formatter that were introduced in #13902, as none of them are the ideal solution for the change in the formatter.

@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 13, 2025
Copy link
Member Author

Dunqing commented Nov 13, 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 13, 2025

CodSpeed Performance Report

Merging #15675 will not alter performance

Comparing 11-12-refactor_formatter_revert_all_changes_from_removing_astkind_argument (4682dc9) with main (85c27c8)1

Summary

✅ 33 untouched
⏩ 4 skipped2

Footnotes

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

  2. 4 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 force-pushed the 11-12-refactor_formatter_revert_all_changes_from_removing_astkind_argument branch from 9b611c8 to 1815d8d Compare November 14, 2025 15:59
@github-actions github-actions bot added the A-ast-tools Area - AST tools label Nov 14, 2025
@Dunqing Dunqing force-pushed the 11-12-refactor_formatter_revert_all_changes_from_removing_astkind_argument branch from 1815d8d to 4682dc9 Compare November 17, 2025 05:08
@Dunqing
Copy link
Member Author

Dunqing commented Nov 17, 2025

@taearls, I am sad to say I am going to revert them, as I found that even the changes fixed all of the prettier tests. However, they are not the ideal way, and they introduced more problems. So, to avoid wasting time correcting them one by one, I decided to revert them and re-fix them. If you are interested in how I fix them, see #15676. Anyway, I really appreciate your work! This is not an easy task, but you already did a good job!

@Dunqing Dunqing marked this pull request as ready for review November 17, 2025 05:20
Copilot AI review requested due to automatic review settings November 17, 2025 05:20
Copilot finished reviewing on behalf of Dunqing November 17, 2025 05:21
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 reverts all formatter changes from #13902 that removed AstKind::Argument. The reversion causes significant test regressions across multiple test suites, introducing formatting issues and incomplete implementations marked with TODO comments.

Key Changes:

  • Reverts changes to argument handling, parenthesization logic, and type parameters
  • Removes optimizations for nested call/new expressions
  • Adds multiple TODO comments indicating incomplete functionality
  • Causes major test regressions: TypeScript compatibility drops from 90.38% to 83.25%, JavaScript from 93.37% to 72.94%

Reviewed Changes

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

Show a summary per file
File Description
tasks/prettier_conformance/snapshots/prettier.ts.snap.md Test compatibility regression: 90.38% → 83.25% (43 new failures)
tasks/prettier_conformance/snapshots/prettier.js.snap.md Test compatibility regression: 93.37% → 72.94% (154 new failures)
tasks/coverage/snapshots/formatter_typescript.snap Minor regression: 99.88% → 99.66% (21 new mismatches, 11 new parse errors)
tasks/coverage/snapshots/formatter_test262.snap Major regression: 99.98% → 98.66% (588 new failures)
tasks/coverage/snapshots/formatter_babel.snap Minor regression: 99.22% → 99.18% (1 new mismatch)
crates/oxc_formatter/src/write/call_arguments.rs Removes compact formatting logic and argument analysis optimizations
crates/oxc_formatter/src/write/arrow_function_expression.rs Reverts arrow chain building logic and comment handling
crates/oxc_formatter/src/parentheses/expression.rs Removes extensive parenthesization logic for arguments
crates/oxc_formatter/src/utils/mod.rs Removes is_expression_used_as_call_argument helper
Multiple test fixture snapshots Show unwanted parentheses being added to function arguments

💡 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 17, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 17, 2025

Merge activity

…ent` (#15675)

Revert all changes in the formatter that were introduced in #13902, as none of them are the ideal solution for the change in the formatter.
@graphite-app graphite-app bot force-pushed the 11-12-refactor_formatter_revert_all_changes_from_removing_astkind_argument branch from 4682dc9 to 0bba124 Compare November 17, 2025 07:54
@graphite-app graphite-app bot merged commit 0bba124 into main Nov 17, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 11-12-refactor_formatter_revert_all_changes_from_removing_astkind_argument branch November 17, 2025 08:01
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 17, 2025
@taearls
Copy link
Contributor

taearls commented Nov 17, 2025

@taearls, I am sad to say I am going to revert them, as I found that even the changes fixed all of the prettier tests. However, they are not the ideal way, and they introduced more problems. So, to avoid wasting time correcting them one by one, I decided to revert them and re-fix them. If you are interested in how I fix them, see #15676. Anyway, I really appreciate your work! This is not an easy task, but you already did a good job!

I understand. No worries! Your changes are much cleaner and better integrated into the existing architecture, so I get it. I'll keep these patterns in mind for future work. Thanks for sharing

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

3 participants