Skip to content

Commit

Permalink
Fixing extra space in property initializer
Browse files Browse the repository at this point in the history
closes #693
  • Loading branch information
belav committed Jul 4, 2022
1 parent d9b3b90 commit 2682ccb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,21 @@ public class ClassName
new List<(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements)>();

public int[] ArrayWithoutSizesDoesntBreak { get; set; }

public int[] ArrayWithInitializer { get; set; } = { 1, 2, 3, 4, 5 };

public Guid[] BreakingArray1 { get; set; } =
{ Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() };

public Guid[] BreakingArray2 { get; set; } =
{
Guid.NewGuid(),
Guid.NewGuid(),
Guid.NewGuid(),
Guid.NewGuid(),
Guid.NewGuid(),
Guid.NewGuid(),
Guid.NewGuid(),
Guid.NewGuid()
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ internal static class InitializerExpression
{
public static Doc Print(InitializerExpressionSyntax node, FormattingContext context)
{
Doc separator = node.Parent is AssignmentExpressionSyntax or EqualsValueClauseSyntax
Doc separator = node.Parent
is AssignmentExpressionSyntax
or EqualsValueClauseSyntax { Parent: not PropertyDeclarationSyntax }
? Doc.Line
: Doc.Null;

Expand Down

0 comments on commit 2682ccb

Please sign in to comment.