Skip to content

Formatting of multi-line statement inside closure #1682

Description

@jochenberger

I noticed a formatting regression of multi-line statements inside a closure:

This was the formatting in 5.8.0

Map.copyOf(
        foo: 'bar'
        ) //<- this is not nice, but it was already like that in 5.8.0

def c = {
            Map.copyOf(
                    foo: 'bar'
                    ) //<- same here
        }

        "foo".tap {
            it
                    .toUpperCase()

            it
                    .toUpperCase()
        }

With 6.1.0, you get

Map.copyOf(
        foo: 'bar'
        ) //<- this has not changed

def c = {
            Map.copyOf(
            foo: 'bar' // <- the indentation is gone
            ) // <- this line is actually better
        }

        "foo".tap {
            it
            .toUpperCase()  //<- this is no longer indented

            it
                    .toUpperCase() // <- but this is
        }

Not sure about the versions between those.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions