Skip to content

Commit

Permalink
RedundantParens: check for placeholder in Apply
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Feb 5, 2022
1 parent 63e83e1 commit 8e279bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ class RedundantParens(ftoks: FormatTokens) extends FormatTokensRewrite.Rule {

case _: Lit | _: Name | _: Term.Interpolate => true

case Term.Apply(_, List(b @ (_: Term.Block | _: Term.PartialFunction)))
case Term.Apply(f, List(b @ (_: Term.Block | _: Term.PartialFunction)))
if b.tokens.headOption.exists(_.is[Token.LeftBrace]) =>
true
!RewriteCtx.hasPlaceholder(f)

case _: Term.PartialFunction => true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,6 @@ foo >>= (_.http(registry, port).map(Option.apply(_)).catchSome {
bar
})
>>>
foo >>= _.http(registry, port)
.map(Option.apply(_))
.catchSome {
bar
}
foo >>= (_.http(registry, port).map(Option.apply(_)).catchSome {
bar
})

0 comments on commit 8e279bd

Please sign in to comment.