189 references to ParenthesizedExpression
Microsoft.CodeAnalysis.CSharp (17)
Binder\Binder_Expressions.cs (4)
685
case SyntaxKind.
ParenthesizedExpression
:
2738
case SyntaxKind.
ParenthesizedExpression
:
2811
case SyntaxKind.
ParenthesizedExpression
: // this is never allowed in legacy compiler
9464
while (receiver.IsKind(SyntaxKind.
ParenthesizedExpression
))
Binder\Binder_Invocation.cs (1)
34
case SyntaxKind.
ParenthesizedExpression
:
Binder\Binder_Operators.cs (2)
472
&& current.IsKind(SyntaxKind.
ParenthesizedExpression
))
475
&& !((ParenthesizedExpressionSyntax)current).Expression.IsKind(SyntaxKind.
ParenthesizedExpression
))
Binder\Binder_Patterns.cs (1)
479
case SyntaxKind.
ParenthesizedExpression
:
Binder\Binder_Statements.cs (1)
2407
while (nodeForError.Kind() == SyntaxKind.
ParenthesizedExpression
)
Binder\EarlyWellKnownAttributeBinder.cs (1)
102
case SyntaxKind.
ParenthesizedExpression
:
Compilation\MemberSemanticModel.cs (1)
2271
case SyntaxKind.
ParenthesizedExpression
:
Compilation\SyntaxTreeSemanticModel_RegionAnalysisContext.cs (1)
22
while (expression.Kind() == SyntaxKind.
ParenthesizedExpression
)
Parser\DirectiveParser.cs (1)
846
case SyntaxKind.
ParenthesizedExpression
:
Parser\LanguageParser.cs (2)
9105
if (expression.Kind == SyntaxKind.
ParenthesizedExpression
)
10178
case SyntaxKind.
ParenthesizedExpression
:
Syntax\SyntaxExtensions.cs (1)
204
while (expression.Kind() == SyntaxKind.
ParenthesizedExpression
)
Syntax\SyntaxFacts.cs (1)
348
while (current != null && (current.IsKind(
ParenthesizedExpression
) || current.IsKind(CastExpression))) current = current.Parent;
Microsoft.CodeAnalysis.CSharp.CodeStyle (13)
CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
120
case SyntaxKind.
ParenthesizedExpression
:
CSharpRemoveUnnecessaryExpressionParenthesesDiagnosticAnalyzer.cs (1)
22
=> SyntaxKind.
ParenthesizedExpression
;
CSharpSyntaxKinds.cs (1)
98
public int ParenthesizedExpression => (int)SyntaxKind.
ParenthesizedExpression
;
ExpressionSyntaxExtensions.cs (1)
560
case SyntaxKind.
ParenthesizedExpression
:
ParenthesizedExpressionSyntaxExtensions.cs (6)
59
if (expression.IsKind(SyntaxKind.
ParenthesizedExpression
) ||
60
parentExpression.IsKind(SyntaxKind.
ParenthesizedExpression
))
329
if (ancestor.IsKind(SyntaxKind.
ParenthesizedExpression
))
356
if (nodeOrToken.IsNode && !nodeOrToken.IsKind(SyntaxKind.
ParenthesizedExpression
))
574
binaryExpression.Right.Kind() is SyntaxKind.
ParenthesizedExpression
or SyntaxKind.CastExpression)
670
&& greaterThanExpression.Right.Kind() is SyntaxKind.
ParenthesizedExpression
or SyntaxKind.CastExpression;
SpacingFormattingRule.cs (2)
165
if ((previousToken.Parent.Kind() is SyntaxKind.
ParenthesizedExpression
or SyntaxKind.ParenthesizedPattern && previousKind == SyntaxKind.OpenParenToken) ||
166
(currentToken.Parent.Kind() is SyntaxKind.
ParenthesizedExpression
or SyntaxKind.ParenthesizedPattern && currentKind == SyntaxKind.CloseParenToken))
SpeculationAnalyzer.cs (1)
645
=> node.IsKind(SyntaxKind.
ParenthesizedExpression
);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (1)
333
targetToken.Parent.IsKind(SyntaxKind.
ParenthesizedExpression
))
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (7)
1233
if (token.Parent is (kind: SyntaxKind.
ParenthesizedExpression
or SyntaxKind.TupleExpression or SyntaxKind.CastExpression))
1309
SyntaxKind.
ParenthesizedExpression
or
1558
SyntaxKind.
ParenthesizedExpression
or
1613
if (leftToken.IsKind(SyntaxKind.OpenParenToken) && leftToken.Parent.IsKind(SyntaxKind.
ParenthesizedExpression
))
1657
if (node.Parent.IsKind(SyntaxKind.
ParenthesizedExpression
))
2240
if (token.Parent.IsKind(SyntaxKind.
ParenthesizedExpression
))
2459
if (token.Parent.IsParentKind(SyntaxKind.
ParenthesizedExpression
))
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
CompleteStatement\CompleteStatementCommandHandler.cs (1)
195
SyntaxKind.
ParenthesizedExpression
or
Microsoft.CodeAnalysis.CSharp.Features (6)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
439
while (parent.Kind() is SyntaxKind.
ParenthesizedExpression
or SyntaxKind.CastExpression)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
151
token.GetRequiredParent().Kind() == SyntaxKind.
ParenthesizedExpression
)
Completion\CompletionProviders\TupleNameCompletionProvider.cs (1)
77
if (token.Parent is (kind: SyntaxKind.
ParenthesizedExpression
or SyntaxKind.TupleExpression or SyntaxKind.CastExpression))
Completion\KeywordRecommenders\VoidKeywordRecommender.cs (1)
80
token.Parent.IsKind(SyntaxKind.
ParenthesizedExpression
))
CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
120
case SyntaxKind.
ParenthesizedExpression
:
CSharpRemoveUnnecessaryExpressionParenthesesDiagnosticAnalyzer.cs (1)
22
=> SyntaxKind.
ParenthesizedExpression
;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (116)
Parsing\AnonymousFunctionParsingTests.cs (1)
1957
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\AsyncStreamsParsingTests.cs (1)
416
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\AwaitParsingTests.cs (1)
665
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\DeclarationScopeParsingTests.cs (14)
1034
N(SyntaxKind.
ParenthesizedExpression
);
1068
N(SyntaxKind.
ParenthesizedExpression
);
1098
N(SyntaxKind.
ParenthesizedExpression
);
1167
N(SyntaxKind.
ParenthesizedExpression
);
1195
N(SyntaxKind.
ParenthesizedExpression
);
3678
N(SyntaxKind.
ParenthesizedExpression
);
3783
N(SyntaxKind.
ParenthesizedExpression
);
3966
N(SyntaxKind.
ParenthesizedExpression
);
4079
N(SyntaxKind.
ParenthesizedExpression
);
4253
N(SyntaxKind.
ParenthesizedExpression
);
4426
N(SyntaxKind.
ParenthesizedExpression
);
4604
N(SyntaxKind.
ParenthesizedExpression
);
5435
N(SyntaxKind.
ParenthesizedExpression
);
5537
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\DeconstructionTests.cs (1)
77
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\ExpressionParsingTests.cs (8)
445
Assert.Equal(SyntaxKind.
ParenthesizedExpression
, expr.Kind());
1623
N(SyntaxKind.
ParenthesizedExpression
);
1703
N(SyntaxKind.
ParenthesizedExpression
);
3054
Assert.Equal(SyntaxKind.
ParenthesizedExpression
, expr.Kind());
5096
N(SyntaxKind.
ParenthesizedExpression
);
5208
N(SyntaxKind.
ParenthesizedExpression
);
5704
N(SyntaxKind.
ParenthesizedExpression
);
5714
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\LambdaAttributeParsingTests.cs (9)
1026
N(SyntaxKind.
ParenthesizedExpression
);
1131
N(SyntaxKind.
ParenthesizedExpression
);
1306
N(SyntaxKind.
ParenthesizedExpression
);
1619
N(SyntaxKind.
ParenthesizedExpression
);
2460
N(SyntaxKind.
ParenthesizedExpression
);
2644
N(SyntaxKind.
ParenthesizedExpression
);
3267
N(SyntaxKind.
ParenthesizedExpression
);
3315
N(SyntaxKind.
ParenthesizedExpression
);
3525
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\LambdaParameterParsingTests.cs (13)
114
N(SyntaxKind.
ParenthesizedExpression
);
225
N(SyntaxKind.
ParenthesizedExpression
);
344
N(SyntaxKind.
ParenthesizedExpression
);
470
N(SyntaxKind.
ParenthesizedExpression
);
599
N(SyntaxKind.
ParenthesizedExpression
);
697
N(SyntaxKind.
ParenthesizedExpression
);
2104
N(SyntaxKind.
ParenthesizedExpression
);
2872
N(SyntaxKind.
ParenthesizedExpression
);
2946
N(SyntaxKind.
ParenthesizedExpression
);
3018
N(SyntaxKind.
ParenthesizedExpression
);
3243
N(SyntaxKind.
ParenthesizedExpression
);
4060
N(SyntaxKind.
ParenthesizedExpression
);
4659
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\LambdaReturnTypeParsingTests.cs (12)
1925
N(SyntaxKind.
ParenthesizedExpression
);
2526
N(SyntaxKind.
ParenthesizedExpression
);
2605
N(SyntaxKind.
ParenthesizedExpression
);
2712
N(SyntaxKind.
ParenthesizedExpression
);
2818
N(SyntaxKind.
ParenthesizedExpression
);
2903
N(SyntaxKind.
ParenthesizedExpression
);
2990
N(SyntaxKind.
ParenthesizedExpression
);
3069
N(SyntaxKind.
ParenthesizedExpression
);
3165
N(SyntaxKind.
ParenthesizedExpression
);
3251
N(SyntaxKind.
ParenthesizedExpression
);
3278
N(SyntaxKind.
ParenthesizedExpression
);
3392
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\LocalFunctionParsingTests.cs (1)
1530
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\NullableParsingTests.cs (2)
148
N(SyntaxKind.
ParenthesizedExpression
);
197
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\PatternParsingTests.cs (37)
1267
N(SyntaxKind.
ParenthesizedExpression
);
1748
N(SyntaxKind.
ParenthesizedExpression
);
1751
N(SyntaxKind.
ParenthesizedExpression
);
1754
N(SyntaxKind.
ParenthesizedExpression
);
1800
N(SyntaxKind.
ParenthesizedExpression
);
1803
N(SyntaxKind.
ParenthesizedExpression
);
1806
N(SyntaxKind.
ParenthesizedExpression
);
1904
N(SyntaxKind.
ParenthesizedExpression
);
1907
N(SyntaxKind.
ParenthesizedExpression
);
5457
N(SyntaxKind.
ParenthesizedExpression
);
6635
N(SyntaxKind.
ParenthesizedExpression
);
6657
N(SyntaxKind.
ParenthesizedExpression
);
6683
N(SyntaxKind.
ParenthesizedExpression
);
6709
N(SyntaxKind.
ParenthesizedExpression
);
7143
N(SyntaxKind.
ParenthesizedExpression
);
7148
N(SyntaxKind.
ParenthesizedExpression
);
7166
N(SyntaxKind.
ParenthesizedExpression
);
7171
N(SyntaxKind.
ParenthesizedExpression
);
7190
N(SyntaxKind.
ParenthesizedExpression
);
7195
N(SyntaxKind.
ParenthesizedExpression
);
7254
N(SyntaxKind.
ParenthesizedExpression
);
7259
N(SyntaxKind.
ParenthesizedExpression
);
7269
N(SyntaxKind.
ParenthesizedExpression
);
7316
N(SyntaxKind.
ParenthesizedExpression
);
7321
N(SyntaxKind.
ParenthesizedExpression
);
7383
N(SyntaxKind.
ParenthesizedExpression
);
7393
N(SyntaxKind.
ParenthesizedExpression
);
7438
N(SyntaxKind.
ParenthesizedExpression
);
7443
N(SyntaxKind.
ParenthesizedExpression
);
7921
N(SyntaxKind.
ParenthesizedExpression
);
7956
N(SyntaxKind.
ParenthesizedExpression
);
8052
N(SyntaxKind.
ParenthesizedExpression
);
9826
N(SyntaxKind.
ParenthesizedExpression
);
10397
N(SyntaxKind.
ParenthesizedExpression
);
10438
N(SyntaxKind.
ParenthesizedExpression
);
12587
N(SyntaxKind.
ParenthesizedExpression
);
12696
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\PatternParsingTests2.cs (1)
852
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\ScriptParsingTests.cs (1)
6248
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\StatementAttributeParsingTests.cs (1)
5402
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\StatementParsingTests.cs (2)
4033
N(SyntaxKind.
ParenthesizedExpression
);
4043
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\SuppressNullableWarningExpressionParsingTests.cs (1)
562
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\TypeArgumentListParsingTests.cs (1)
1067
N(SyntaxKind.
ParenthesizedExpression
);
Parsing\ValueTupleTests.cs (1)
680
N(SyntaxKind.
ParenthesizedExpression
);
Syntax\SyntaxNodeTests.cs (8)
90
Assert.Equal(SyntaxKind.
ParenthesizedExpression
, nodes[1].Kind());
92
Assert.Equal(SyntaxKind.
ParenthesizedExpression
, nodes[3].Kind());
94
Assert.Equal(SyntaxKind.
ParenthesizedExpression
, nodes[5].Kind());
109
Assert.Equal(SyntaxKind.
ParenthesizedExpression
, nodes[2].Kind());
111
Assert.Equal(SyntaxKind.
ParenthesizedExpression
, nodes[4].Kind());
113
Assert.Equal(SyntaxKind.
ParenthesizedExpression
, nodes[6].Kind());
124
var firstParens = e.FirstAncestorOrSelf<ExpressionSyntax>(n => n.Kind() == SyntaxKind.
ParenthesizedExpression
);
3811
var firstParens = e.FirstAncestorOrSelf<ExpressionSyntax>(n => n.Kind() == SyntaxKind.
ParenthesizedExpression
);
Microsoft.CodeAnalysis.CSharp.Workspaces (25)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3185
expression.IsKind(SyntaxKind.
ParenthesizedExpression
) ||
CSharpSyntaxKinds.cs (1)
98
public int ParenthesizedExpression => (int)SyntaxKind.
ParenthesizedExpression
;
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs\ExpressionSyntaxExtensions.cs (1)
560
case SyntaxKind.
ParenthesizedExpression
:
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (1)
333
targetToken.Parent.IsKind(SyntaxKind.
ParenthesizedExpression
))
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (7)
1233
if (token.Parent is (kind: SyntaxKind.
ParenthesizedExpression
or SyntaxKind.TupleExpression or SyntaxKind.CastExpression))
1309
SyntaxKind.
ParenthesizedExpression
or
1558
SyntaxKind.
ParenthesizedExpression
or
1613
if (leftToken.IsKind(SyntaxKind.OpenParenToken) && leftToken.Parent.IsKind(SyntaxKind.
ParenthesizedExpression
))
1657
if (node.Parent.IsKind(SyntaxKind.
ParenthesizedExpression
))
2240
if (token.Parent.IsKind(SyntaxKind.
ParenthesizedExpression
))
2459
if (token.Parent.IsParentKind(SyntaxKind.
ParenthesizedExpression
))
ParenthesizedExpressionSyntaxExtensions.cs (6)
59
if (expression.IsKind(SyntaxKind.
ParenthesizedExpression
) ||
60
parentExpression.IsKind(SyntaxKind.
ParenthesizedExpression
))
329
if (ancestor.IsKind(SyntaxKind.
ParenthesizedExpression
))
356
if (nodeOrToken.IsNode && !nodeOrToken.IsKind(SyntaxKind.
ParenthesizedExpression
))
574
binaryExpression.Right.Kind() is SyntaxKind.
ParenthesizedExpression
or SyntaxKind.CastExpression)
670
&& greaterThanExpression.Right.Kind() is SyntaxKind.
ParenthesizedExpression
or SyntaxKind.CastExpression;
Recommendations\CSharpRecommendationServiceRunner.cs (1)
441
if (originalExpressionKind is SyntaxKind.
ParenthesizedExpression
&&
Rename\CSharpRenameRewriterLanguageService.cs (1)
463
case SyntaxKind.
ParenthesizedExpression
:
Simplification\CSharpSimplificationService.Expander.cs (2)
360
if ((node.Kind() == SyntaxKind.GreaterThanExpression || node.Kind() == SyntaxKind.RightShiftExpression) && !node.IsParentKind(SyntaxKind.
ParenthesizedExpression
))
372
if (result.Expression != null && !result.Expression.IsKind(SyntaxKind.
ParenthesizedExpression
))
Simplification\Simplifiers\MemberAccessExpressionSimplifier.cs (1)
51
if (!parent.IsParentKind(SyntaxKind.
ParenthesizedExpression
))
SpacingFormattingRule.cs (2)
165
if ((previousToken.Parent.Kind() is SyntaxKind.
ParenthesizedExpression
or SyntaxKind.ParenthesizedPattern && previousKind == SyntaxKind.OpenParenToken) ||
166
(currentToken.Parent.Kind() is SyntaxKind.
ParenthesizedExpression
or SyntaxKind.ParenthesizedPattern && currentKind == SyntaxKind.CloseParenToken))
SpeculationAnalyzer.cs (1)
645
=> node.IsKind(SyntaxKind.
ParenthesizedExpression
);
Microsoft.CodeAnalysis.UnitTests (2)
CommonSyntaxTests.cs (2)
223
Assert.Equal(CSharp.SyntaxKind.
ParenthesizedExpression
, CSharp.CSharpExtensions.Kind(trackedB.Parent));
246
Assert.Equal(CSharp.SyntaxKind.
ParenthesizedExpression
, CSharp.CSharpExtensions.Kind(trackedB.Parent));
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\MethodXml\MethodXmlBuilder.cs (1)
180
case SyntaxKind.
ParenthesizedExpression
: