Skip to main content

WorkspaceSyntaxExtensions.Parenthesize(ExpressionSyntax, Boolean, Boolean) Method

Containing Type: WorkspaceSyntaxExtensions

Assembly: Roslynator.CSharp.Workspaces.dll

Creates parenthesized expression that is parenthesizing the specified expression.

public static Microsoft.CodeAnalysis.CSharp.Syntax.ParenthesizedExpressionSyntax Parenthesize(this Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expression, bool includeElasticTrivia = true, bool simplifiable = true)

Parameters

expression ExpressionSyntax

includeElasticTrivia Boolean

If true, add elastic trivia.

simplifiable Boolean

If true, attach Simplifier.Annotation to the parenthesized expression.

Returns

ParenthesizedExpressionSyntax