-
Notifications
You must be signed in to change notification settings - Fork 31
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
Investigate forcing multi line parameters onto newline #7
Comments
I think after merging #4 after first parameter there will be insert newline so example def something(a: Int,
b: String,
c: Boolean)(d: Int,
e: String,
f: Boolean) could cook like this def something(a: Int,
b: String,
c: Boolean)
(d: Int,
e: String,
f: Boolean) |
One of the design goals for #7 and #8 are to simplify several multi-line If #7, #8, and #9 are implemented, // Number 1
def something(a: Int,
b: String,
c: Boolean)(d: Int,
e: String,
f: Boolean) // Number 2
def something(
a: Int,
b: String,
c: Boolean)(d: Int,
e: String,
f: Boolean) // Number 3
def something(
a: Int,
b: String,
c: Boolean)(
d: Int,
e: String,
f: Boolean) Number 1, 2, and 3 would all become this: def something(
a: Int,
b: String,
c: Boolean
)(
d: Int,
e: String,
f: Boolean
) Without #7 and #8, currently, Number 1 might become def something(a: Int,
b: String,
c: Boolean)
(d: Int,
e: String,
f: Boolean) Number 2 might become def something(
a: Int,
b: String,
c: Boolean)
(d: Int,
e: String,
f: Boolean) and Number 3 might become def something(
a: Int,
b: String,
c: Boolean)(
d: Int,
e: String,
f: Boolean) PR #4 would still be useful in the case of single line parameters: def something(a: Int, b: String, c: Boolean)(d: Int, e: String, f: Boolean)
something(a, b, c)(d, e, f) ==> def something(a: Int, b: String, c: Boolean)
(d: Int, e: String, f: Boolean)
something(a, b, c)
(d, e, f) Having only one final style for the multi line case also happens to simplify Thoughts? |
Currently, this
is reformatted to this
It would be simpler to just have it force the parameter onto a newline:
or
Reasoning for this: The "force to newline" version is already valid Scalariform formatting, which will occur if the user places the first parameter on a newline themselves. It'd be simpler to maintain the formatting code if only one of these versions were supported, and would be easier for people to read / get used to, since multi line arguments would always be formatted in the same way.
The text was updated successfully, but these errors were encountered: