Commit a719627 1 parent ce34da2 commit a719627 Copy full SHA for a719627
File tree 2 files changed +11
-3
lines changed
scalafmt-core/shared/src/main/scala/org/scalafmt/util
scalafmt-tests/shared/src/test/resources/trailing-commas
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -717,7 +717,15 @@ object TreeOps {
717
717
): Boolean = {
718
718
def owner = ft.meta.rightOwner
719
719
def isArgOrParamClauseSite (tree : Tree ) = ! whenNL || isArgClauseSite(tree) ||
720
- isParamClauseSite(tree)
720
+ isParamClauseSite(tree) &&
721
+ (tree match { // exclude extended instance; type/`using` clause is ok
722
+ case t : Term .ParamClause if t.mod.isEmpty && isSeqSingle(t.values) =>
723
+ tree.parent.forall {
724
+ case p : Member .ParamClauseGroup => ! p.parent.is[Defn .ExtensionGroup ]
725
+ case _ => true
726
+ }
727
+ case _ => true
728
+ })
721
729
// skip empty parens/braces/brackets
722
730
ft.right match {
723
731
case _ : T .RightBrace => ! left.is[T .LeftBrace ] && owner.is[Importer ]
Original file line number Diff line number Diff line change @@ -492,7 +492,7 @@ extension [
492
492
A,
493
493
B,
494
494
](
495
- self: Int,
495
+ self: Int
496
496
)(using
497
497
a: A,
498
498
b: B,
@@ -518,7 +518,7 @@ extension [
518
518
A,
519
519
B,
520
520
](
521
- self: Int,
521
+ self: Int
522
522
)(using
523
523
a: A,
524
524
b: B,
You can’t perform that action at this time.
0 commit comments