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