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