diff --git a/scalafmt-core/shared/src/main/scala/org/scalafmt/config/AlignToken.scala b/scalafmt-core/shared/src/main/scala/org/scalafmt/config/AlignToken.scala index 9a003bb804..d658e472c8 100644 --- a/scalafmt-core/shared/src/main/scala/org/scalafmt/config/AlignToken.scala +++ b/scalafmt-core/shared/src/main/scala/org/scalafmt/config/AlignToken.scala @@ -6,6 +6,7 @@ import metaconfig.Configured.Ok import metaconfig._ import metaconfig.annotation.DeprecatedName import metaconfig.generic.Surface +import org.scalafmt.util.ParamClauseParent /** Configuration option for aligning tokens. * @@ -91,6 +92,7 @@ object AlignToken { owner.forall(check(tree)) && (parents.isEmpty || tree.parent.exists { p => parents.forall(check(p)) || (p match { + case ParamClauseParent(pp) => parents.forall(check(pp)) case _: meta.Member.SyntaxValuesClause => p.parent.exists { pp => parents.forall(check(pp)) } case _ => false diff --git a/scalafmt-core/shared/src/main/scala/org/scalafmt/util/TreeExtractors.scala b/scalafmt-core/shared/src/main/scala/org/scalafmt/util/TreeExtractors.scala index 5b434a5477..44c9ca3b6e 100644 --- a/scalafmt-core/shared/src/main/scala/org/scalafmt/util/TreeExtractors.scala +++ b/scalafmt-core/shared/src/main/scala/org/scalafmt/util/TreeExtractors.scala @@ -81,7 +81,7 @@ object WithChain { } object ParamClauseParent { - def unapply(t: Term.ParamClause): Option[Tree] = t.parent match { + def unapply(t: Member.ParamClause): Option[Tree] = t.parent match { case Some(p: Member.ParamClauseGroup) => p.parent case p => p }