Skip to content

Commit

Permalink
Router: adjust align formatting for open bracket
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Sep 17, 2021
1 parent 898d26b commit 1c85c91
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -923,9 +923,10 @@ class Router(formatOps: FormatOps) {
}

val excludeBlocks =
if (isBracket)
insideBlock[T.LeftBracket](tok, close)
else if (
if (isBracket) {
val excludeBeg = if (align) tokens(args.last.tokens.head) else tok
insideBlock[T.LeftBracket](excludeBeg, close)
} else if (
multipleArgs ||
!isSingleEnclosedArgument &&
style.newlines.source.eq(Newlines.unfold)
Expand Down
17 changes: 12 additions & 5 deletions scalafmt-tests/src/test/resources/default/TypeArguments.stat
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,18 @@ def props[M[_[_]], F[_]: Async, I: KeyDecoder, State, Event: PersistentEncoder:
}
>>>
object a {
def deploy[M[_[_]]: FunctorK, F[
_
], State, Event: PersistentEncoder: PersistentDecoder, K: KeyEncoder: KeyDecoder] = ???
def props[M[_[_]], F[_]
: Async, I: KeyDecoder, State, Event: PersistentEncoder: PersistentDecoder]() = ???
def deploy[M[_[_]]: FunctorK,
F[_],
State,
Event: PersistentEncoder: PersistentDecoder,
K: KeyEncoder: KeyDecoder
] = ???
def props[M[_[_]],
F[_]: Async,
I: KeyDecoder,
State,
Event: PersistentEncoder: PersistentDecoder
]() = ???
}
<<< #2739 bracketDefnSite = never, danglingParentheses, !align
maxColumn = 100
Expand Down

0 comments on commit 1c85c91

Please sign in to comment.