-
Notifications
You must be signed in to change notification settings - Fork 870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Excess indentation with method-receiving text blocks #1081
Comments
1 task
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 👍 |
Stephan202
changed the title
Excess text block indentation inside lambda expressions
Excess indentation with method-receiving text blocks
Mar 15, 2024
copybara-service bot
pushed a commit
that referenced
this issue
Apr 1, 2024
… commit Previously the formatting was adding a forced break at the beginning of text blocks, which caused issues like #1081. With the changes in the baseline CL it correctly handles the 'width' of text blocks containing newlines as infinity, instead of counting the number of characters and treating the newline as having width 1. Fixes #1081 PiperOrigin-RevId: 620311510
copybara-service bot
pushed a commit
that referenced
this issue
Apr 1, 2024
… commit Previously the formatting was adding a forced break at the beginning of text blocks, which caused issues like #1081. With the changes in the baseline CL it correctly handles the 'width' of text blocks containing newlines as infinity, instead of counting the number of characters and treating the newline as having width 1. Fixes #1081 PiperOrigin-RevId: 620311510
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 blocksinside lambda expressionsthat 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 ce3cb59.(Apologies for not providing a 100% stand-alone reproduction case; can do that ~this weekend if desired.)
The text was updated successfully, but these errors were encountered: