Skip to content

Indent text blocks in the main formatting pass - #1486

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1001065554
Oct 19, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_1001065554

Conversation

@copybara-service

Copy link
Copy Markdown

Indent text blocks in the main formatting pass

This fixes a pre-existing issue in text block formatting if --skip-reflowing-long-strings is disabled, which can be triggered by the recent changes to lambda formatting.

Fixes #19 (comment)

Previously, text block normalization and re-indentation ran only in StringWrapper, so callers that pass --skip-reflowing-long-strings moved the opening """ delimiter without updating the indentation of the text block body.

Move text block line normalization into JavaInputAstVisitor and emit multi-line tokens via LayoutBuilder.multilineToken and Doc.Lines, which LayoutSolver indents to the current line's indentation.

@cushon cushon mentioned this pull request Oct 19, 2026
This fixes a pre-existing issue in text block formatting if `--skip-reflowing-long-strings` is disabled, which can be triggered by the recent changes to lambda formatting.

Fixes #19 (comment)

Previously, text block normalization and re-indentation ran only in `StringWrapper`, so callers that pass `--skip-reflowing-long-strings` moved the opening `"""` delimiter without updating the indentation of the text block body.

Move text block line normalization into `JavaInputAstVisitor` and emit multi-line tokens via `LayoutBuilder.multilineToken` and `Doc.Lines`, which `LayoutSolver` indents to the current line's indentation.

PiperOrigin-RevId: 1002276705
@copybara-service
copybara-service Bot merged commit d8312fa into master Oct 19, 2026
16 checks passed
@copybara-service
copybara-service Bot deleted the test_1001065554 branch October 19, 2026 12:49
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.

odd formatting for lambdas

1 participant