-
Notifications
You must be signed in to change notification settings - Fork 268
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
Fix: Format for comprehension expressions #3916
Conversation
PartC, | ||
j | ||
<- PartD + | ||
PartE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this PartE
intended to be aligned with PartD
, or is it supposed to be one 2-space indent past the corresponding <-
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is intended to be aligned with PartD. Specifically, the "<-" is treated like an "in" binary operator, and I put the rule that if the "in" operator is not followed by a newline, then it starts a new aligning indentation. If it is followed by a newline, then it's indented by two spaces as usual. This matches usages of newlines I've seen for the second argument of "in" and "<-"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, aside from a question about the resulting formatting (not blocking)
This PR fixes #3912
Specifically, I ensured that "in" and "<-" operator indent their second operator compared to the first, but if "<-" starts the line, then it indents its second argument only relative to itself.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.