Skip to content

Commit

Permalink
Fixing dedented invocation on some method chains (#1222)
Browse files Browse the repository at this point in the history
closes #1154
  • Loading branch information
belav committed Apr 7, 2024
1 parent 1ee22ea commit 548b320
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ var someValue =
.CallMethod_____________________________________________________();

o.Property.CallMethod(
someParameter_____________________________,
someParameter_____________________________
)
someParameter_____________________________,
someParameter_____________________________
)
.CallMethod()
.CallMethod();
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ is LiteralExpressionSyntax
var expanded = Doc.Concat(
Doc.Concat(groups[0].Select(o => o.Doc).ToArray()),
shouldMergeFirstTwoGroups
? Doc.Concat(groups[1].Select(o => o.Doc).ToArray())
? Doc.IndentIf(
groups.Count > 2 && groups[1].Last().Doc is not Group { Contents: IndentDoc },
Doc.Concat(groups[1].Select(o => o.Doc).ToArray())
)
: Doc.Null,
PrintIndentedGroup(node, groups.Skip(shouldMergeFirstTwoGroups ? 2 : 1).ToList())
);
Expand Down

0 comments on commit 548b320

Please sign in to comment.