Skip to content
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

Router: fold single-line case arrow body if unfold #2826

Merged
merged 4 commits into from
Oct 28, 2021

Conversation

kitbellew
Copy link
Collaborator

Fixes #2821.

@kitbellew kitbellew changed the title Router: CtrlBodySplits to unfold case arrow body Router: fold single-line case arrow body if unfold Oct 28, 2021
@kitbellew kitbellew requested a review from tgodzik October 28, 2021 02:57
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Should we make a similar fix for other places that style.newlines.getBeforeMultiline is used? Specifically I think yield and else are impacted.

@kitbellew kitbellew merged commit db5ec56 into scalameta:master Oct 28, 2021
@kitbellew kitbellew deleted the 2821 branch October 28, 2021 11:53
@kitbellew
Copy link
Collaborator Author

LGTM! Should we make a similar fix for other places that style.newlines.getBeforeMultiline is used? Specifically I think yield and else are impacted.

we can try them separately. however, here's why this change worked: beforeMultiline generally should apply only to multiline; if the body is single-line, the regular newlines.source should take over. and in the case of source=unfold, we don't want to tuck else or yield or do to be on the same line. i will take a look to see if it's consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

beforeMultilite = unfold creates newlines for non-multiline statements
2 participants