-
Notifications
You must be signed in to change notification settings - Fork 32
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
Multiple parameters list #4
base: master
Are you sure you want to change the base?
Multiple parameters list #4
Conversation
10x for reactivating scalariform |
Do you think we should increase limit for parameter from 100 characters ? |
For the limit, I think it's fine to have it as 1 to 100, since that's the same range of This feature is a bit tricky to integrate when a parameter clause spans multiple lines: Currently, enabling this feature would make something like this def something(
a: Int,
b: String,
c: Boolean)(
d: Int,
e: String,
f: Boolean) look like this: def something(
a: Int,
b: String,
c: Boolean)
(
d: Int,
e: String,
f: Boolean) I think it would make sense to add a check so that all param clauses must be single line only It would also make sense to implement this same behavior for method arguments as well: something(1, "", false)(2, "e", true) would be rewritten to something(1, "", false)
(2, "e", true) |
Should I add more integration test ? But what is right behavior of this feature when other are active ? |
I plan to create next PR but it can wait until we have consensus on how it should work. |
@bambuchaAdm Are you still planning on working on this feature? If not, I'll pick it up as the next thing I implement. More thoughts on implementation details: I'm thinking that it might be simpler to not include extra configuration options in favor Examples: This... def a(one: Int)(two: String): Boolean
a(1)("2") stays unchanged: def a(one: Int)(two: String): Boolean
a(1)("2") A newline between clauses... def a(one: Int)
(two: String): Boolean
a(1)
("2") becomes: def a(one: Int)
(two: String): Boolean
a(1)
("2") |
I'm going to finish this just after implement annotation. feasturue. At second proposition. I have wrote minimal object App extends Application {
def mpl(i: Int)(s: String) = ???
mpl(5)
("Ala")
} and on compilation in SBT i have
So we cannot use that syntax on callsite |
OK, good to know. That simplifies the implementation a bit. |
I think is's work. But its need some refactoring. #7 will simplified implementation but i don't use it here. |
What's the status of this PR? |
@betehess I ran into conflicts trying to integrate this feature without breaking the alignParameter feature. This feature is on hold until those conflicts are fixed |
Any chances to revive this one, @bambuchaAdm? Bumped into needing it recently as well.. |
3383e5a
to
19faa4a
Compare
Initial rework after changes on master. 1 test still fail. I think this should be ready to end of week. |
All tests are green. Ready to merge. @daniel-trinh please look on it quickly before conflicts appear. |
It looks like this feature doesn't play well with the AlignParameters feature. Trying to merge these two functionalities and have them play nicely might be a hairy task. It might be best to simply disallow using the two features together. Thoughts? Example of conflicts (seems like AlignParameter code overrides the BreakMultipleParameterGroups behavior):
|
Is this really the expected result of |
It's not -- I actually haven't thought about the best way for the two to interact -- the failed examples are just to show that the behavior of enabling both is probably not going to result in something that the user expects. |
+1 |
Hey @bambuchaAdm, scalariform has new maintainers. Are you interested in bringing this PR back to live? You would have to rebase against the master branch of https://github.com/scala-ide/scalariform |
I am also interested in better formatting of curried parameter lists. Anything going to happen on that? |
See the issues on the upstream project https://github.com/scala-ide/scalariform, maybe there were changes in the meantime |
PR from mdr branch:
scala-ide#99