Skip to content

Investigate forcing multi line parameters onto newline #7

@daniel-trinh

Description

@daniel-trinh

Currently, this

def something(a: Int,
  b: String, 
  c: Boolean)(d: Int,
  e: String, 
  f: Boolean)

is reformatted to this

def something(a: Int,
              b: String, 
              c: Boolean)(d: Int,
                          e: String, 
                          f: Boolean)

It would be simpler to just have it force the parameter onto a newline:

def something(
  a: Int,
  b: String, 
  c: Boolean)(
    d: Int,
    e: String, 
    f: Boolean)

or

def something(
  a: Int,
  b: String, 
  c: Boolean)(
  d: Int,
  e: String, 
  f: Boolean)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions