diff --git a/Src/CSharpier.Tests/TestFiles/IsPatternExpression/IsPatternExpressions.cst b/Src/CSharpier.Tests/TestFiles/IsPatternExpression/IsPatternExpressions.cst index 5f97e1f3a..454be9753 100644 --- a/Src/CSharpier.Tests/TestFiles/IsPatternExpression/IsPatternExpressions.cst +++ b/Src/CSharpier.Tests/TestFiles/IsPatternExpression/IsPatternExpressions.cst @@ -47,5 +47,10 @@ class ClassName ) { return; } + + if (x is Y { NoExtraSpaceAfterThisNextBrace: true } && newGroup) + { + return; + } } } diff --git a/Src/CSharpier.Tests/TestFiles/IsPatternExpression/RecursivePattern.cst b/Src/CSharpier.Tests/TestFiles/IsPatternExpression/RecursivePattern.cst deleted file mode 100644 index f9078bf1c..000000000 --- a/Src/CSharpier.Tests/TestFiles/IsPatternExpression/RecursivePattern.cst +++ /dev/null @@ -1,10 +0,0 @@ -class ClassName -{ - void MethodName() - { - if (expr is string { Length: 5 } s) - { - return; - } - } -} diff --git a/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/RecursivePattern.cs b/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/RecursivePattern.cs index 3d9e888b4..15e6b0a12 100644 --- a/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/RecursivePattern.cs +++ b/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/RecursivePattern.cs @@ -44,10 +44,10 @@ public static Doc Print(RecursivePatternSyntax node) " " ), " ", - Token.PrintWithSuffix(node.PropertyPatternClause.CloseBraceToken, " ") - ) + Token.Print(node.PropertyPatternClause.CloseBraceToken) + ) : string.Empty, - node.Designation != null ? Node.Print(node.Designation) : string.Empty + node.Designation != null ? Doc.Concat(" ", Node.Print(node.Designation)) : string.Empty ); } }