private ExpressionSyntax VisitLambdaExpression(LambdaExpressionSyntax node) { var parentIndentWidth = node.Parent.GetLeadingTrivia().FirstOrDefault(x => x.IsKind(SyntaxKind.WhitespaceTrivia)).Span.Length; if (!node.ArrowToken.TrailingTrivia.Any(x => x.IsKind(SyntaxKind.EndOfLineTrivia))) { node = node.WithArrowToken(node.ArrowToken.WithTrailingTrivia(new[] { SyntaxFactory.EndOfLine("\n") })); } if (node.Body is BlockSyntax block) { node = node.WithBody(UpdateBlock(block)); } else { var newWhitespaceTrivia = SyntaxFactory.SyntaxTrivia(SyntaxKind.WhitespaceTrivia, new string(' ', parentIndentWidth + 4)); node = node.WithBody(node.Body.WithLeadingTrivia(newWhitespaceTrivia)); var body = Visit(node.Body); if (body != null) { node = node.WithBody(body); } } return(node); }