Skip to content

Fix multiline delegated constructor formatting - #2354

Open
arpitagarwal1301 wants to merge 1 commit into
square:mainfrom
arpitagarwal1301:fix/1762-chained-constructor-call-is
Open

Fix multiline delegated constructor formatting#2354
arpitagarwal1301 wants to merge 1 commit into
square:mainfrom
arpitagarwal1301:fix/1762-chained-constructor-call-is

Conversation

@arpitagarwal1301

Copy link
Copy Markdown

Fixes #1762

Summary

  • expand delegated this(...) and super(...) calls when an argument contains an explicit structural newline
  • indent every expanded argument and emit Kotlin-style trailing commas
  • preserve existing one-line calls and %S/%P string data, including trailing newlines

This independently reimplements the behavior previously reviewed in #2332, which was closed because its author could not complete the Square CLA. No commits were copied.

Validation

  • focused red-then-green delegate-constructor and CodeBlock regressions
  • ./gradlew spotlessApply :kotlinpoet:spotlessKotlinCheck :kotlinpoet:apiCheck :kotlinpoet:jvmTest
  • ./gradlew clean build with Zulu OpenJDK 26.0.2
  • git diff --check

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.

Chained constructor call is not formatted correctly

1 participant