From f38e2e75853bfc03ad0b37c16ad9fcee05c77e0f Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 6 Dec 2021 14:14:45 -0600 Subject: [PATCH] Fix join losing code (#509) closes #508 --- .../FormattingTests/TestFiles/QueryExpressions.cst | 8 ++++++++ .../SyntaxPrinter/SyntaxNodePrinters/JoinClause.cs | 1 + 2 files changed, 9 insertions(+) diff --git a/Src/CSharpier.Tests/FormattingTests/TestFiles/QueryExpressions.cst b/Src/CSharpier.Tests/FormattingTests/TestFiles/QueryExpressions.cst index 490d762f3..4f64d4b88 100644 --- a/Src/CSharpier.Tests/FormattingTests/TestFiles/QueryExpressions.cst +++ b/Src/CSharpier.Tests/FormattingTests/TestFiles/QueryExpressions.cst @@ -33,6 +33,14 @@ class ClassName select c into d select d; + var joinWitType = + from c in customers + join Customers c1 in customers_____________________________ + on c1.GetHashCode() equals c.GetHashCode() + into e + select c into d + select d; + var complexQuery = from c in customers let d = c diff --git a/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/JoinClause.cs b/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/JoinClause.cs index 5202d0446..68dd9d4d7 100644 --- a/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/JoinClause.cs +++ b/Src/CSharpier/SyntaxPrinter/SyntaxNodePrinters/JoinClause.cs @@ -6,6 +6,7 @@ public static Doc Print(JoinClauseSyntax node) { return Doc.Group( Token.PrintWithSuffix(node.JoinKeyword, " "), + node.Type != null ? Doc.Concat(Node.Print(node.Type), " ") : Doc.Null, Token.PrintWithSuffix(node.Identifier, " "), Token.PrintWithSuffix(node.InKeyword, " "), Node.Print(node.InExpression),