-
Notifications
You must be signed in to change notification settings - Fork 148
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
implicit argument lists #180
Comments
From @nairbv on January 1, 2016 1:36 I'm looking for any way to use scalariform without condensing curried function signatures, but the issue isn't just with implicit parameters, it's any kind of currying.
I'd like to be able to write it as:
But it automatically gets reformatted back to the first one by scalariform. This prevents me from keeping a tight limit on org.scalastyle.file.FileLineLengthChecker in scalaStyle, and I've often seen single lines of code that get excessively long. From the preview here it looks like characters aren't monospaced, but what I was getting at in my example is I would typically align the open-paren of my curried parameters, implicit or not. Ideally I think I'd rather just have scalariform not touch any whitespace between a close and then open paren. I hadn't considered your style for writing implicit parameters. |
From @nairbv on January 1, 2016 17:39 I think I'll create a separate issue for what I'm describing since the option I'm requesting for curried parameters is a bit different. |
I have a patch that formats implicits all with the keyword attached to the first parameter: def foo()(
implicit a: TypeA,
b: TypeB
): Unit = {} This could be leveraged into the filer's format if desired. |
I've seen that style, it might be a useful addition. |
This works out of the box (0.2.4)
While this is not currently possible
An alternative solution is
Basically, stack param groups and let the library handle indentation. |
From @fommil on October 25, 2014 11:24
It is fairly standard practice in implicit-heavy libraries to write implicit parameter lists like this
but unfortunately I can't set up scalariform to use this trailing-implicit format. Is this something you could support with a new option?
Note that it is possible to do this sort of thing
Copied from original issue: daniel-trinh#36
The text was updated successfully, but these errors were encountered: