Skip to content

Allow for better formatting of curried parameter lists #159

@kiritsuku

Description

@kiritsuku

From @nairbv on January 1, 2016 17:46

As described in a comment on:
daniel-trinh#36

To be able to use multiple parameter lists in a nicely formatted way, while keeping a strict line-length restriction in scalastyle, it would be nice to be able to preserve new lines and indentation between parameter lists.

E.g. I would like to be able to write code like:

def aReallyLongMethodName(thatHasSomeParameters:WithLongTypes)
                         (andThenAnother:ParameterList) = foo

Without having it reformatted to:

def aReallyLongMethodName(thatHasSomeParameters:WithLongTypes)(andThenAnother:ParameterList) = foo

The simplest solution is just to preserve any existing whitespace between ) and (, and I think I could submit a pull request to do that.

There might be a nicer way to achieve the same result, e.g. actually formatting the indentation of the next parameter list to match the first, but that might take more effort to implement and might reduce flexibility for the programmer to indent to a specific level.

Copied from original issue: daniel-trinh#104

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions