feat(prettier): fill printing CallExpression implementation#11299
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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 Instrumentation Performance ReportMerging #11299 will degrade performances by 11.62%Comparing Summary
Benchmarks breakdown
|
87bbf78 to
3eb38cc
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR implements the missing pieces for printing CallExpression in the formatter, addresses parent-stack accuracy, and updates conformance snapshots.
- Adds a dedicated
call_argumentsmodule and removes the blanketVec<Argument>formatter - Introduces
current()onParentStackand uses it in a newis_long_curried_callhelper - Supplies an overload for arrow functions with custom options and wires up member-chain utilities
- Updates TypeScript and JavaScript conformance snapshots to reflect new output
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_formatter/src/write/mod.rs | Added call_arguments submodule and related imports |
| crates/oxc_formatter/src/write/arrow_function_expression.rs | Added new_with_options constructor for arrow funcs |
| crates/oxc_formatter/src/utils/mod.rs | Imported ParentStack; added is_long_curried_call |
| crates/oxc_formatter/src/utils/member_chain/simple_argument.rs | Introduced SimpleArgument logic for call heuristics |
| crates/oxc_formatter/src/formatter/parent_stack.rs | Added current accessor alongside parent |
| crates/oxc_formatter/src/formatter/formatter.rs | Exposed current_kind helper |
| tasks/prettier_conformance/snapshots/prettier.ts.snap.md | Updated TS conformance snapshot |
| tasks/prettier_conformance/snapshots/prettier.js.snap.md | Updated JS conformance snapshot |
Comments suppressed due to low confidence (1)
crates/oxc_formatter/src/write/arrow_function_expression.rs:166
- The new
new_with_optionsconstructor isn’t covered by any unit or integration tests yet. Add tests to verify formatting variations when custom options are provided.
pub fn new_with_options(
Merge activity
|
Printing a call expression correctly is mostly done, except for printing comments. Not many tests have passed because there is a problem with `ParentStack`. Some places use `ParentStack` to check the current parent, which may be incorrect. The issue is that some printing implementations do not call `push`/`pop`, meaning the recorded parent node is not accurate—it only reflects the last pushed record. I’ve attempted to solve this problem in #11339.
1d29850 to
50a98cf
Compare

Printing a call expression correctly is mostly done, except for printing comments. Not many tests have passed because there is a problem with
ParentStack. Some places useParentStackto check the current parent, which may be incorrect. The issue is that some printing implementations do not callpush/pop, meaning the recorded parent node is not accurate—it only reflects the last pushed record. I’ve attempted to solve this problem in #11339.