Skip to content

Excess indentation with method-receiving text blocks #1081

Closed
@Stephan202

Description

@Stephan202

The new fmt-maven-plugin release comes with an upgrade from GJF 1.19.2 to GJF 1.21.0. With this upgrade it appears that text blocks inside lambda expressions that are the receiver of a method are indented too far to the right. See PicnicSupermarket/error-prone-support@a2196ee (#1069) for an example. This is what that code would look like if the text block contents are shifted to the right to match the new position of the text block start marker:

unexpectedMatchesByLineNumber.entries().stream()
    .map(
        e ->
                """
                Rule `%s` matches on line %s, while it should match in a method named \
                `test%s`."""
                .formatted(e.getValue(), e.getKey(), e.getValue()))

I.e.: an amount of indentation that better matches AOSP rather than GOOGLE style. I assume that this is a side-effect of ce3cb59.

(Apologies for not providing a 100% stand-alone reproduction case; can do that ~this weekend if desired.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions