diff --git a/Src/CSharpier.Tests/TestFiles/PropertyDeclaration/PropertyDeclarations.cst b/Src/CSharpier.Tests/TestFiles/PropertyDeclaration/PropertyDeclarations.cst index 817d4db32..18ff79465 100644 --- a/Src/CSharpier.Tests/TestFiles/PropertyDeclaration/PropertyDeclarations.cst +++ b/Src/CSharpier.Tests/TestFiles/PropertyDeclaration/PropertyDeclarations.cst @@ -3,6 +3,8 @@ public class ClassName public string Property { get; set; } public string Interface.Property { get; set; } + string ShortModifiers { get; private set; } + string PropertyWithModifiers { protected internal get; diff --git a/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/BasePropertyDeclaration.cs b/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/BasePropertyDeclaration.cs index 9f4d5dcb2..fcb532fcd 100644 --- a/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/BasePropertyDeclaration.cs +++ b/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/BasePropertyDeclaration.cs @@ -63,13 +63,11 @@ public static Doc Print(BasePropertyDeclarationSyntax node) Doc.Concat( separator, Token.Print(node.AccessorList.OpenBraceToken), - Doc.Group( - Doc.Indent( - node.AccessorList.Accessors.Select( - o => PrintAccessorDeclarationSyntax(o, separator) - ) - .ToArray() - ) + Doc.Indent( + node.AccessorList.Accessors.Select( + o => PrintAccessorDeclarationSyntax(o, separator) + ) + .ToArray() ), separator, Token.Print(node.AccessorList.CloseBraceToken) @@ -112,12 +110,8 @@ private static Doc PrintAccessorDeclarationSyntax( Doc separator ) { var docs = new List(); - if ( - node.Modifiers.Count > 0 - || node.AttributeLists.Count > 0 - || node.Body != null - || node.ExpressionBody != null - ) { + if (node.AttributeLists.Count > 0 || node.Body != null || node.ExpressionBody != null) + { docs.Add(Doc.HardLine); } else