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

2.6.0+ regression: constructor argument expression on a separate line gets folded back to the previous line if verticalMultiline.atDefnSite=true #2044

Closed
neko-kai opened this issue Jun 23, 2020 · 0 comments · Fixed by #2060

Comments

@neko-kai
Copy link

  • Configuration:
version = "2.6.1"
maxColumn = 170

continuationIndent.defnSite = 2
continuationIndent.extendSite = 2

verticalMultiline.atDefnSite = true
verticalMultiline.excludeDanglingParens = []

Steps

Given code like this:

final class Dummy[F[+_, +_]: BIOMonad: BIOPrimitives: Clock2](
  log: LogBIO[F]
) extends DIResource.LiftF(
    F.mkRef(Map.empty[Key, Item]).map(new Dummy.Impl(_))
  )

Scalafmt formats code like this:

final class Dummy[F[+_, +_]: BIOMonad: BIOPrimitives: Clock2](
  log: LogBIO[F]
) extends DIResource.LiftF(F.mkRef(Map.empty[Key, Item]).map(new Dummy.Impl(_)))

Expectation

I would like the formatted output to look like this, which is the formatting from version 2.5.2:

final class Dummy[F[+_, +_]: BIOMonad: BIOPrimitives: Clock2](
  log: LogBIO[F]
) extends DIResource.LiftF(
    F.mkRef(Map.empty[Key, Item]).map(new Dummy.Impl(_))
  )

Workaround

I've found that if the parameter log: LogBIO[F] in the example is moved up o the line with the rest of the declaration, then the argument expression is left unchanged and not folded:

final class Dummy[F[+_, +_]: BIOMonad: BIOPrimitives: Clock2](log: LogBIO[F])
  extends DIResource.LiftF(
    F.mkRef(Map.empty[Key, Item]).map(new Dummy.Impl(_))
  )
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