Skip to content

Commit

Permalink
Fixing bug with empty array ranks breaking
Browse files Browse the repository at this point in the history
closes #301
  • Loading branch information
belav committed Jun 14, 2021
1 parent 7ed2638 commit f916362
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,8 @@ class ClassName
SqlParameterCollectionExtensions.DefaultValueColumnWidth
+ SqlParameterCollectionExtensions.DefaultValueColumnWidth
];

var someLongVariable_doesNotBreakArrayRank____________________________ =
(ArrayType[])CallMethod();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ public static class ArrayRankSpecifier
{
public static Doc Print(ArrayRankSpecifierSyntax node)
{
if (node.Sizes.All(o => o is OmittedArraySizeExpressionSyntax))
{
return Doc.Concat(
Token.Print(node.OpenBracketToken),
SeparatedSyntaxList.Print(node.Sizes, Node.Print, Doc.Null),
Token.Print(node.CloseBracketToken)
);
}

return Doc.Group(
Token.Print(node.OpenBracketToken),
node.Sizes.Any()
Expand Down

0 comments on commit f916362

Please sign in to comment.