Skip to content
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

Arguments of nested anonymous functions are crammed into a single line #269

Open
odisseus opened this issue Feb 21, 2018 · 1 comment
Open

Comments

@odisseus
Copy link

odisseus commented Feb 21, 2018

When I have an anonymous function that returns another anonymous function, I would like to keep the arguments of each consecutive layer in a separate line. However, Scalariform moves them all into a single line, and I could not find a configuration key to change this behaviour.

Here's an example:

Before:

object Main {
  def foo: Int => Int => String = {
    x: Int =>
      y: Int =>
        "x"
  }
}

After:

object Main {
  def foo: Int => Int => String = { x: Int => y: Int =>
    "x"
  }
}

This issue may be similar to #21, but it is not a duplicate. In particular, the example from #21 is not being reformatted.

I use SBT 1.1.1 with Scala 2.12.4 and sbt-scalariform 1.8.2 with scalariform 0.2.5.

It seems that the change that breaks my example has been deliberately introduced by commit 34a7bbd.

@odisseus
Copy link
Author

odisseus commented Feb 23, 2018

Update: The old version I was comparing against is in fact older than 0.1.7. I tracked the breaking change to commit 34a7bbd.

odisseus added a commit to odisseus/scalariform that referenced this issue Feb 23, 2018
odisseus added a commit to odisseus/scalariform that referenced this issue Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant