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 [18]: FormatOps: ignore line breaks in infix expressions #1855

Merged
merged 13 commits into from Apr 13, 2020

Conversation

kitbellew
Copy link
Collaborator

@kitbellew kitbellew commented Apr 11, 2020

Add the newlines.afterInfix parameter to allow formatting of infix expressions and optionally breaking lines after an infix operation (which appears to be always safe, unlike before it); enable it for newlines.source=fold,unfold. The behaviour and specific parameters/values will be defined in a separate PR containing the documentation.

Helps with #1627.

scala-repos diffs:

@kitbellew
Copy link
Collaborator Author

@olafurpg @tanishiking @poslegm PTAL.

This turned out to be the most complex problem, took me almost 3 weeks. I know @olafurpg tried solving this before and eventually gave up; I tried to track down all previous issues relating to infix handling and take them into account. I think the end result is reasonable albeit not always optimal.

Copy link
Collaborator

@poslegm poslegm left a comment

Choose a reason for hiding this comment

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

Thank you for your tremendous work!

One question and one nitpicking

@kitbellew kitbellew merged commit 5c25561 into scalameta:master Apr 13, 2020
@kitbellew kitbellew deleted the 1855 branch April 13, 2020 10:33
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.

None yet

2 participants