Skip to content

Commit

Permalink
FormatOps: process all clauses together
Browse files Browse the repository at this point in the history
In fact, FuncParamClause uses a paren, not a bracket.
  • Loading branch information
kitbellew committed May 15, 2024
1 parent a866439 commit b255320
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1030,15 +1030,11 @@ class FormatOps(
}
}
tokens.foreach {
case ft @ FormatToken(_: T.LeftParen, _, m) => m.leftOwner match {
case t: Term.ArgClause if !t.parent.exists(_.is[Term.ApplyInfix]) =>
case ft @ FormatToken(_: T.LeftParen | _: T.LeftBracket, _, m) =>
m.leftOwner match {
case t: Member.ArgClause if !t.parent.exists(_.is[Member.Infix]) =>
process(t, ft)(callSite)
case t: Term.ParamClause => process(t, ft)(defnSite)
case _ =>
}
case ft @ FormatToken(_: T.LeftBracket, _, m) => m.leftOwner match {
case t: Type.ArgClause => process(t, ft)(callSite)
case t: Type.ParamClause => process(t, ft)(defnSite)
case t: Member.ParamClause => process(t, ft)(defnSite)
case t: Type.FuncParamClause => process(t, ft)(defnSite)
case _ =>
}
Expand Down

0 comments on commit b255320

Please sign in to comment.