-
Notifications
You must be signed in to change notification settings - Fork 277
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
Weird formatting of Scala3-style intersection types #4705
Comments
@satorg just to clarify: there's no change in formatting of
all i can suggest is use |
@kitbellew the issue emerged when Cats started switching from Perhaps, there are some cases when the current way of formatting types with
i.e. what could be benefits in splitting the type definition itself if it seems possible to split the line a little in advance and keep the type in one line? E.g.:
I may not be aware of all the plumbings in Scalafmt/Scalameta, but the default behavior seems pretty weird to me. |
i don't disagree but keep in mind that by default or use |
@kitbellew , understood, thank you for the clarification. |
The issue confirmed to exist in all Scalafmt versions at least since v3.8.2 through v3.8.4-RC4.
The issue first discovered in typelevel/cats#4673.
Configuration
(or
version = 3.8.3
, orversion = 3.8.2
, etc.)Command-line parameters
Steps
Given code like this:
Problem
Scalafmt formats code like this:
Note the
newStyle
statement gets formatted in a very awkward and quite difficult-to-read way.The
oldStyle
statement looks fine though.Expectation
I would like the
newStyle
part of the formatted output to look like this:or something like this would work even better:
Workaround
Reformatting the above snippet manually seems helping keep the desired format in place.
The text was updated successfully, but these errors were encountered: