18 references to Parenthesize
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (18)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
249switchStatement.Expression.Parenthesize(),
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
137localDeclarationStatement.Declaration.Variables[0].Initializer!.Value.Parenthesize(),
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (1)
74.Parenthesize();
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (3)
506var condition = IndentExpression(ifStatement, ifStatement.Condition, preferredIndentation).Parenthesize(includeElasticTrivia: false); 525ConvertExpression(trueStatement.Expression, indent: null).Parenthesize(includeElasticTrivia: false), 526ConvertExpression(falseStatement.Expression, indent: null).Parenthesize(includeElasticTrivia: false));
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (2)
147startExpr != null && startFromEnd ? IndexExpression(startExpr) : startExpr?.Parenthesize(), 148endExpr != null && endFromEnd ? IndexExpression(endExpr) : endExpr?.Parenthesize());
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\Helpers.cs (1)
18expr.Parenthesize());
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForReferenceEqualsCodeFixProvider.cs (4)
34=> BinaryExpression(SyntaxKind.EqualsExpression, argument, s_nullLiteralExpression).Parenthesize(); 37=> IsPatternExpression(argument, s_nullLiteralPattern).Parenthesize(); 47s_nullLiteralPattern)).Parenthesize(); 54PredefinedType(ObjectKeyword)).Parenthesize();
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (2)
129return CastExpression(governingType.GenerateTypeSyntax(), expr.Parenthesize()).WithAdditionalAnnotations(Simplifier.Annotation); 132return expr.Parenthesize();
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
180return PrefixUnaryExpression(SyntaxKind.LogicalNotExpression, isPatternExpression.Parenthesize());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
90var parenthesized = expression.Parenthesize();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
91ExpressionSyntax expression => expression.Parenthesize(includeElasticTrivia, addSimplifierAnnotation),