Closed Stephan202 closed 3 months ago
Thanks for the report, I agree this is an issue. I don't think it's specific to lambda bodies, in general if text blocks show up as the receiver of a method call they are getting a surprising continuation indent:
class T {
{
System.err.printf("hello %s\n", world);
"""
hello %s
"""
.formatted("world");
}
}
Right, makes sense! Should have played around with the example a bit more. I'll update the ticket description :+1:
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:I.e.: an amount of indentation that better matches
AOSP
rather thanGOOGLE
style. I assume that this is a side-effect of ce3cb59a8d649359a8e6e7fcc5f2f21bb79b3df1.(Apologies for not providing a 100% stand-alone reproduction case; can do that ~this weekend if desired.)