Skip to content

Commit

Permalink
Router: implement Newlines.forceBeforeAssign
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Aug 11, 2022
1 parent ebd6073 commit 8bba465
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2640,6 +2640,8 @@ class Router(formatOps: FormatOps) {
Seq(CtrlBodySplits.withIndent(Split(Space.orNL(ft.noBreak), 0), ft, body))
else if (isJsNative(body))
Seq(Split(Space, 0).withSingleLine(expire))
else if (style.newlines.forceBeforeAssign(ft.meta.leftOwner))
Seq(CtrlBodySplits.withIndent(Split(Newline, 0), ft, body))
else if (style.newlines.shouldForceBeforeMultilineAssign(ft.meta.leftOwner))
CtrlBodySplits.slbOnly(ft, body, spaceIndents) { x =>
CtrlBodySplits.withIndent(Split(Newline, x), ft, body)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6127,4 +6127,5 @@ newlines.forceBeforeAssign = def
def sum(a: Int, b: Int): Int =
a + b
>>>
def sum(a: Int, b: Int): Int = a + b
def sum(a: Int, b: Int): Int =
a + b

0 comments on commit 8bba465

Please sign in to comment.