public static DestructorDeclarationSyntax ToStatementBody(DestructorDeclarationSyntax method) { var body = method.ExpressionBody.Expression.WithLeadingTrivia(SyntaxFactory.Space); return(method.WithBody(SyntaxFactory.Block(SyntaxFactory.ExpressionStatement(body))) .WithExpressionBody(null) .WithSemicolonToken(SyntaxFactory.MissingToken(SyntaxKind.SemicolonToken)) .WithTrailingTrivia(method.GetTrailingTrivia())); }
public override SyntaxNode VisitDestructorDeclaration(DestructorDeclarationSyntax node) { BlockSyntax block = (BlockSyntax)SyntaxFactory.ParseStatement(emptyBody); return(node.WithBody(block)); }