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

#1627 [04]: Router: ignore line breaks in if-else and bodies #1778

Merged
merged 2 commits into from
Mar 11, 2020

Conversation

kitbellew
Copy link
Collaborator

Modify breaks around control expressions (if-else, for, while etc.) and their bodies.

Helps with #1627.

scala-repos diffs:

@kitbellew
Copy link
Collaborator Author

@olafurpg @tanishiking @poslegm PTAL

@@ -1359,10 +1376,13 @@ class Router(formatOps: FormatOps) {
case x => throw new UnexpectedTree[Term.If](x)
}) =>
val expire = leftOwner.asInstanceOf[Term.If].elsep.tokens.last
val noSpace = style.newlines.source match {
Copy link
Collaborator

Choose a reason for hiding this comment

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

3-times repeated noSpace computation? May be extract it to a function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done!

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.

2 participants