Skip to content

Conversation

@adrian-gierakowski
Copy link

@adrian-gierakowski adrian-gierakowski commented Nov 20, 2025

Modified src/generation/generate.rs to return false for Node::ArrowExpr in allows_inline_multi_line unless the arrow function body is a block statement. This prevents arrow functions with expression bodies from being formatted inline when they overflow, ensuring consistent multi-line formatting for function arguments. Verified with regression tests.

NOTE: this PR was created with the assistance from an AI agent, see original PR on my for which was created by the agent: adrian-gierakowski#2

Fixes #753
Fixes #686

adrian-gierakowski and others added 3 commits November 20, 2025 12:40
This change modifies `allows_inline_multi_line` to restrict arrow functions with expression bodies from being inline multi-line. This ensures that if such an arrow function overflows the line width, it forces the parent call expression to break its arguments onto multiple lines, rather than allowing a partial split that results in inconsistent formatting.

Fixes dprint#753
Fixes dprint#686
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inconsistent formatting of multi-argument function calls when memberExpression.linePerExpression: true Formatting is unstable (not idempotent)

1 participant