Skip to content

fix(formatter): preserve nested lambda body columns - #1803

Merged
Lorenzobattistela merged 2 commits into
bendlang:mainfrom
toprameen:fix-nested-lambda-formatting
Oct 21, 2026
Merged

Lorenzobattistela merged 2 commits into
bendlang:mainfrom
toprameen:fix-nested-lambda-formatting

Conversation

@toprameen

Copy link
Copy Markdown
Contributor

Formatting an inline lambda inside parentheses or a call argument can move its continued statements to different columns and make valid Bend source fail to parse. The formatter now pins nested lambda bodies and their semicolon continuations, and expires those pins at their enclosing delimiter or argument boundary. Generic commas and ordinary delimiter indentation retain their existing behavior.

Three regressions extend the existing formatting/idempotence and real-CLI preservation tests, with controls for following arguments and closing delimiters. Local npm tests pass 33/33, the repository gate passes 54/54, and actual LSP edits preserve the programs’ execution. The same regression tests fail against the unchanged formatter.

@toprameen
toprameen marked this pull request as ready for review October 21, 2026 00:51
@Lorenzobattistela
Lorenzobattistela merged commit 48408ab into bendlang:main Oct 21, 2026
1 check passed
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.

2 participants