226 references to ParenthesizedExpression
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\SyntaxNodeExtensions.cs (1)
46while (node?.Parent?.RawKind == (int)SyntaxKind.ParenthesizedExpression)
Microsoft.CodeAnalysis.CSharp (17)
Binder\Binder_Expressions.cs (4)
717case SyntaxKind.ParenthesizedExpression: 2954case SyntaxKind.ParenthesizedExpression: 3027case SyntaxKind.ParenthesizedExpression: // this is never allowed in legacy compiler 11069while (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)
2444while (nodeForError.Kind() == SyntaxKind.ParenthesizedExpression)
Binder\EarlyWellKnownAttributeBinder.cs (1)
102case SyntaxKind.ParenthesizedExpression:
Compilation\MemberSemanticModel.cs (1)
2299case SyntaxKind.ParenthesizedExpression:
Compilation\SyntaxTreeSemanticModel_RegionAnalysisContext.cs (1)
22while (expression.Kind() == SyntaxKind.ParenthesizedExpression)
Parser\DirectiveParser.cs (1)
849case SyntaxKind.ParenthesizedExpression:
Parser\LanguageParser.cs (2)
9702if (expression.Kind == SyntaxKind.ParenthesizedExpression) 10796case 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)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryParentheses\CSharpRemoveUnnecessaryExpressionParenthesesDiagnosticAnalyzer.cs (1)
22=> SyntaxKind.ParenthesizedExpression;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
120case SyntaxKind.ParenthesizedExpression:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
575case SyntaxKind.ParenthesizedExpression:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (6)
59if (expression.IsKind(SyntaxKind.ParenthesizedExpression) || 60parentExpression.IsKind(SyntaxKind.ParenthesizedExpression)) 326if (ancestor.IsKind(SyntaxKind.ParenthesizedExpression)) 351if (!childNode.IsKind(SyntaxKind.ParenthesizedExpression)) 563binaryExpression.Right.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.CastExpression) 659&& greaterThanExpression.Right.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.CastExpression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
163if ((previousToken.Parent.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.ParenthesizedPattern && previousKind == SyntaxKind.OpenParenToken) || 164(currentToken.Parent.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.ParenthesizedPattern && currentKind == SyntaxKind.CloseParenToken))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
108public int ParenthesizedExpression => (int)SyntaxKind.ParenthesizedExpression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
663=> node.IsKind(SyntaxKind.ParenthesizedExpression);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
334targetToken.Parent.IsKind(SyntaxKind.ParenthesizedExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (7)
1247if (token.Parent is (kind: SyntaxKind.ParenthesizedExpression or SyntaxKind.TupleExpression or SyntaxKind.CastExpression)) 1323SyntaxKind.ParenthesizedExpression or 1574SyntaxKind.ParenthesizedExpression or 1629if (leftToken.IsKind(SyntaxKind.OpenParenToken) && leftToken.Parent.IsKind(SyntaxKind.ParenthesizedExpression)) 1673if (node.Parent.IsKind(SyntaxKind.ParenthesizedExpression)) 2250if (token.Parent.IsKind(SyntaxKind.ParenthesizedExpression)) 2455if (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)
437while (parent.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.CastExpression)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
148token.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)
76token.Parent.IsKind(SyntaxKind.ParenthesizedExpression))
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryParentheses\CSharpRemoveUnnecessaryExpressionParenthesesDiagnosticAnalyzer.cs (1)
22=> SyntaxKind.ParenthesizedExpression;
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (1)
120case SyntaxKind.ParenthesizedExpression:
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (151)
Parsing\AnonymousFunctionParsingTests.cs (1)
1957N(SyntaxKind.ParenthesizedExpression);
Parsing\AsyncStreamsParsingTests.cs (1)
416N(SyntaxKind.ParenthesizedExpression);
Parsing\AwaitParsingTests.cs (2)
666N(SyntaxKind.ParenthesizedExpression); 1649N(SyntaxKind.ParenthesizedExpression);
Parsing\CollectionExpressionParsingTests.cs (20)
2475N(SyntaxKind.ParenthesizedExpression); 3836N(SyntaxKind.ParenthesizedExpression); 4062N(SyntaxKind.ParenthesizedExpression); 4118N(SyntaxKind.ParenthesizedExpression); 4471N(SyntaxKind.ParenthesizedExpression); 4474N(SyntaxKind.ParenthesizedExpression); 4653N(SyntaxKind.ParenthesizedExpression); 4751N(SyntaxKind.ParenthesizedExpression); 4815N(SyntaxKind.ParenthesizedExpression); 4877N(SyntaxKind.ParenthesizedExpression); 4934N(SyntaxKind.ParenthesizedExpression); 4998N(SyntaxKind.ParenthesizedExpression); 5259N(SyntaxKind.ParenthesizedExpression); 5302N(SyntaxKind.ParenthesizedExpression); 5347N(SyntaxKind.ParenthesizedExpression); 5455N(SyntaxKind.ParenthesizedExpression); 13198N(SyntaxKind.ParenthesizedExpression); 13533N(SyntaxKind.ParenthesizedExpression); 13719N(SyntaxKind.ParenthesizedExpression); 13928N(SyntaxKind.ParenthesizedExpression);
Parsing\DeclarationScopeParsingTests.cs (14)
1015N(SyntaxKind.ParenthesizedExpression); 1049N(SyntaxKind.ParenthesizedExpression); 1079N(SyntaxKind.ParenthesizedExpression); 1148N(SyntaxKind.ParenthesizedExpression); 1176N(SyntaxKind.ParenthesizedExpression); 3649N(SyntaxKind.ParenthesizedExpression); 3725N(SyntaxKind.ParenthesizedExpression); 3879N(SyntaxKind.ParenthesizedExpression); 3963N(SyntaxKind.ParenthesizedExpression); 4108N(SyntaxKind.ParenthesizedExpression); 4252N(SyntaxKind.ParenthesizedExpression); 4401N(SyntaxKind.ParenthesizedExpression); 5203N(SyntaxKind.ParenthesizedExpression); 5276N(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 (11)
1011N(SyntaxKind.ParenthesizedExpression); 1116N(SyntaxKind.ParenthesizedExpression); 1271N(SyntaxKind.ParenthesizedExpression); 1614N(SyntaxKind.ParenthesizedExpression); 2472N(SyntaxKind.ParenthesizedExpression); 2656N(SyntaxKind.ParenthesizedExpression); 3279N(SyntaxKind.ParenthesizedExpression); 3327N(SyntaxKind.ParenthesizedExpression); 3537N(SyntaxKind.ParenthesizedExpression); 4337N(SyntaxKind.ParenthesizedExpression); 4471N(SyntaxKind.ParenthesizedExpression);
Parsing\LambdaParameterParsingTests.cs (23)
114N(SyntaxKind.ParenthesizedExpression); 225N(SyntaxKind.ParenthesizedExpression); 344N(SyntaxKind.ParenthesizedExpression); 470N(SyntaxKind.ParenthesizedExpression); 599N(SyntaxKind.ParenthesizedExpression); 697N(SyntaxKind.ParenthesizedExpression); 944N(SyntaxKind.ParenthesizedExpression); 1079N(SyntaxKind.ParenthesizedExpression); 1149N(SyntaxKind.ParenthesizedExpression); 1224N(SyntaxKind.ParenthesizedExpression); 1280N(SyntaxKind.ParenthesizedExpression); 1341N(SyntaxKind.ParenthesizedExpression); 2192N(SyntaxKind.ParenthesizedExpression); 2960N(SyntaxKind.ParenthesizedExpression); 3034N(SyntaxKind.ParenthesizedExpression); 3106N(SyntaxKind.ParenthesizedExpression); 3331N(SyntaxKind.ParenthesizedExpression); 4148N(SyntaxKind.ParenthesizedExpression); 4427N(SyntaxKind.ParenthesizedExpression); 4582N(SyntaxKind.ParenthesizedExpression); 4734N(SyntaxKind.ParenthesizedExpression); 4846N(SyntaxKind.ParenthesizedExpression); 4985N(SyntaxKind.ParenthesizedExpression);
Parsing\LambdaReturnTypeParsingTests.cs (12)
1998N(SyntaxKind.ParenthesizedExpression); 2599N(SyntaxKind.ParenthesizedExpression); 2678N(SyntaxKind.ParenthesizedExpression); 2785N(SyntaxKind.ParenthesizedExpression); 2891N(SyntaxKind.ParenthesizedExpression); 2976N(SyntaxKind.ParenthesizedExpression); 3063N(SyntaxKind.ParenthesizedExpression); 3142N(SyntaxKind.ParenthesizedExpression); 3238N(SyntaxKind.ParenthesizedExpression); 3324N(SyntaxKind.ParenthesizedExpression); 3351N(SyntaxKind.ParenthesizedExpression); 3465N(SyntaxKind.ParenthesizedExpression);
Parsing\LocalFunctionParsingTests.cs (1)
1530N(SyntaxKind.ParenthesizedExpression);
Parsing\MemberDeclarationParsingTests.cs (1)
18668N(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); 5418N(SyntaxKind.ParenthesizedExpression); 6596N(SyntaxKind.ParenthesizedExpression); 6618N(SyntaxKind.ParenthesizedExpression); 6644N(SyntaxKind.ParenthesizedExpression); 6670N(SyntaxKind.ParenthesizedExpression); 7104N(SyntaxKind.ParenthesizedExpression); 7109N(SyntaxKind.ParenthesizedExpression); 7127N(SyntaxKind.ParenthesizedExpression); 7132N(SyntaxKind.ParenthesizedExpression); 7151N(SyntaxKind.ParenthesizedExpression); 7156N(SyntaxKind.ParenthesizedExpression); 7215N(SyntaxKind.ParenthesizedExpression); 7220N(SyntaxKind.ParenthesizedExpression); 7230N(SyntaxKind.ParenthesizedExpression); 7277N(SyntaxKind.ParenthesizedExpression); 7282N(SyntaxKind.ParenthesizedExpression); 7344N(SyntaxKind.ParenthesizedExpression); 7354N(SyntaxKind.ParenthesizedExpression); 7399N(SyntaxKind.ParenthesizedExpression); 7404N(SyntaxKind.ParenthesizedExpression); 7882N(SyntaxKind.ParenthesizedExpression); 7917N(SyntaxKind.ParenthesizedExpression); 8013N(SyntaxKind.ParenthesizedExpression); 9787N(SyntaxKind.ParenthesizedExpression); 10358N(SyntaxKind.ParenthesizedExpression); 10399N(SyntaxKind.ParenthesizedExpression); 12548N(SyntaxKind.ParenthesizedExpression); 12657N(SyntaxKind.ParenthesizedExpression);
Parsing\PatternParsingTests2.cs (1)
853N(SyntaxKind.ParenthesizedExpression);
Parsing\ScriptParsingTests.cs (1)
6248N(SyntaxKind.ParenthesizedExpression);
Parsing\StatementAttributeParsingTests.cs (1)
5403N(SyntaxKind.ParenthesizedExpression);
Parsing\StatementParsingTests.cs (2)
4034N(SyntaxKind.ParenthesizedExpression); 4044N(SyntaxKind.ParenthesizedExpression);
Parsing\SuppressNullableWarningExpressionParsingTests.cs (1)
552N(SyntaxKind.ParenthesizedExpression);
Parsing\SwitchExpressionParsingTests.cs (1)
4855N(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); 3822var firstParens = e.FirstAncestorOrSelf<ExpressionSyntax>(n => n.Kind() == SyntaxKind.ParenthesizedExpression);
Microsoft.CodeAnalysis.CSharp.Workspaces (26)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3186or SyntaxKind.ParenthesizedExpression
Recommendations\CSharpRecommendationServiceRunner.cs (2)
180if (current.Kind() == SyntaxKind.ParenthesizedExpression) 718if (originalExpressionKind is SyntaxKind.ParenthesizedExpression &&
Rename\CSharpRenameRewriterLanguageService.cs (1)
460case SyntaxKind.ParenthesizedExpression:
Simplification\CSharpSimplificationService.Expander.cs (2)
362if ((node.Kind() == SyntaxKind.GreaterThanExpression || node.Kind() == SyntaxKind.RightShiftExpression) && !node.IsParentKind(SyntaxKind.ParenthesizedExpression)) 374if (result.Expression != null && !result.Expression.IsKind(SyntaxKind.ParenthesizedExpression))
Simplification\Simplifiers\MemberAccessExpressionSimplifier.cs (1)
51if (!parent.IsParentKind(SyntaxKind.ParenthesizedExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
575case SyntaxKind.ParenthesizedExpression:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (6)
59if (expression.IsKind(SyntaxKind.ParenthesizedExpression) || 60parentExpression.IsKind(SyntaxKind.ParenthesizedExpression)) 326if (ancestor.IsKind(SyntaxKind.ParenthesizedExpression)) 351if (!childNode.IsKind(SyntaxKind.ParenthesizedExpression)) 563binaryExpression.Right.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.CastExpression) 659&& greaterThanExpression.Right.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.CastExpression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
163if ((previousToken.Parent.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.ParenthesizedPattern && previousKind == SyntaxKind.OpenParenToken) || 164(currentToken.Parent.Kind() is SyntaxKind.ParenthesizedExpression or SyntaxKind.ParenthesizedPattern && currentKind == SyntaxKind.CloseParenToken))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxKinds.cs (1)
108public int ParenthesizedExpression => (int)SyntaxKind.ParenthesizedExpression;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
663=> node.IsKind(SyntaxKind.ParenthesizedExpression);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
334targetToken.Parent.IsKind(SyntaxKind.ParenthesizedExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (7)
1247if (token.Parent is (kind: SyntaxKind.ParenthesizedExpression or SyntaxKind.TupleExpression or SyntaxKind.CastExpression)) 1323SyntaxKind.ParenthesizedExpression or 1574SyntaxKind.ParenthesizedExpression or 1629if (leftToken.IsKind(SyntaxKind.OpenParenToken) && leftToken.Parent.IsKind(SyntaxKind.ParenthesizedExpression)) 1673if (node.Parent.IsKind(SyntaxKind.ParenthesizedExpression)) 2250if (token.Parent.IsKind(SyntaxKind.ParenthesizedExpression)) 2455if (token.Parent.IsParentKind(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: