Skip to content

Improve wrapping logic of parameter lists #274

Description

@Egorand

Currently we wrap based on the number of parameters, not on the length:

val file = FileSpec.builder(tacosPackage, "Taco")
    .addFunction(FunSpec.builder("test")
        .addParameter("a", Int::class)
        .addParameter("b", Int::class)
        .addParameter("c", Int::class)
        .addStatement("return a + b + c")
        .build())
    .build()

prints this:

fun test(
    a: Int,
    b: Int,
    c: Int
) = a + b + c

when it could be this:

fun test(a: Int, b: Int, c: Int) = a + b + c

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions