79 references to IsParentKind
Microsoft.CodeAnalysis.CSharp.Workspaces (79)
Classification\SyntaxClassification\NameSyntaxClassifier.cs (1)
43
=> node.
IsParentKind
(SyntaxKind.Attribute);
Classification\SyntaxClassification\SyntaxTokenClassifier.cs (2)
68
if (identifierName.
IsParentKind
(SyntaxKind.MemberBindingExpression))
78
if (identifier.Parent.
IsParentKind
(SyntaxKind.ConditionalAccessExpression))
Rename\CSharpRenameRewriterLanguageService.cs (1)
746
token.Parent.
IsParentKind
(SyntaxKind.InvocationExpression) &&
Simplification\CSharpSimplificationService.Expander.cs (3)
79
argument.
IsParentKind
(SyntaxKind.ArgumentList) &&
362
if ((node.Kind() == SyntaxKind.GreaterThanExpression || node.Kind() == SyntaxKind.RightShiftExpression) && !node.
IsParentKind
(SyntaxKind.ParenthesizedExpression))
672
originalSimpleName.
IsParentKind
(SyntaxKind.NameMemberCref) ||
Simplification\Reducers\CSharpMiscellaneousReducer.cs (2)
40
if (parameterSyntax.
IsParentKind
(SyntaxKind.ParameterList) &&
41
parameterSyntax.Parent.
IsParentKind
(SyntaxKind.ParenthesizedLambdaExpression))
Simplification\Simplifiers\MemberAccessExpressionSimplifier.cs (2)
45
if (parent.
IsParentKind
(SyntaxKind.SimpleMemberAccessExpression))
51
if (!parent.
IsParentKind
(SyntaxKind.ParenthesizedExpression))
Simplification\Simplifiers\NameSimplifier.cs (1)
653
expression.
IsParentKind
(SyntaxKind.UsingDirective) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
69
if (equalsValueClause.
IsParentKind
(SyntaxKind.VariableDeclarator) &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (10)
46
=> expression.
IsParentKind
(SyntaxKind.NameMemberCref) && expression.Parent.
IsParentKind
(SyntaxKind.QualifiedCref);
110
=> name.
IsParentKind
(SyntaxKind.ExplicitInterfaceSpecifier);
188
if (expression.
IsParentKind
(SyntaxKind.ConstantPattern))
276
if (!expr.
IsParentKind
(SyntaxKind.Argument))
401
return nameEquals.
IsParentKind
(SyntaxKind.AttributeArgument);
486
if (expression is LiteralExpressionSyntax && !expression.
IsParentKind
(SyntaxKind.UnaryMinusExpression))
599
if (!(expression is LiteralExpressionSyntax && expression.
IsParentKind
(SyntaxKind.UnaryMinusExpression)))
640
if ((expression.
IsParentKind
(SyntaxKind.NameEquals) && expression.Parent.
IsParentKind
(SyntaxKind.AttributeArgument)) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
255
nodeParent.
IsParentKind
(SyntaxKind.CasePatternSwitchLabel))
566
(binaryExpression.
IsParentKind
(SyntaxKind.Argument) || binaryExpression.Parent is InitializerExpressionSyntax))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (10)
226
variableDeclaration.
IsParentKind
(SyntaxKind.FieldDeclaration))
233
if (type.
IsParentKind
(SyntaxKind.ObjectCreationExpression) &&
234
type.Parent.
IsParentKind
(SyntaxKind.EqualsValueClause) &&
235
type.Parent.Parent.
IsParentKind
(SyntaxKind.VariableDeclarator) &&
237
variableDeclaration.
IsParentKind
(SyntaxKind.FieldDeclaration))
274
if (type.
IsParentKind
(SyntaxKind.Parameter) && type.Parent.
IsParentKind
(SyntaxKind.ParameterList))
286
if (type.Parent.Parent.
IsParentKind
(SyntaxKind.ConstructorDeclaration))
298
variableDeclaration.
IsParentKind
(SyntaxKind.EventFieldDeclaration))
308
if (type.
IsParentKind
(SyntaxKind.TypeConstraint))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SimpleNameSyntaxExtensions.cs (1)
16
Debug.Assert(name.IsSimpleMemberAccessExpressionName() || name.IsMemberBindingExpressionName() || name.IsRightSideOfQualifiedName() || name.
IsParentKind
(SyntaxKind.NameMemberCref));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
48
if (node.
IsParentKind
(kind))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (3)
77
=> token.IsOpenParenInParameterList() && token.Parent.
IsParentKind
(SyntaxKind.ConversionOperatorDeclaration);
80
=> token.IsOpenParenInParameterList() && token.Parent.
IsParentKind
(SyntaxKind.OperatorDeclaration);
144
return node.
IsParentKind
(SyntaxKind.AnonymousMethodExpression);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
143
currentToken.Parent.
IsParentKind
(SyntaxKind.IfStatement))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (2)
293
previousToken.Parent.
IsParentKind
(SyntaxKind.Parameter))
471
previousToken.Parent?.
IsParentKind
(SyntaxKind.ArrayType) == true)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (4)
625
node.
IsParentKind
(SyntaxKind.NameColon) &&
626
node.Parent.
IsParentKind
(SyntaxKind.Subpattern);
638
if (identifier.Parent.
IsParentKind
(SyntaxKind.WithInitializerExpression))
644
else if (identifier.Parent.
IsParentKind
(SyntaxKind.ObjectInitializerExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
552
if (castNode.
IsParentKind
(SyntaxKind.Interpolation) && originalConversionOperation.Type?.SpecialType is SpecialType.System_Object)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
515
else if (destinationMember is StatementSyntax statement && statement.
IsParentKind
(SyntaxKind.GlobalStatement))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
481
if (targetToken.Parent.
IsParentKind
(SyntaxKind.InvocationExpression) && !targetToken.IsInvocationOfVarExpression())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (20)
115
(parent is MemberDeclarationSyntax && parent.
IsParentKind
(SyntaxKind.CompilationUnit)))
510
if (token.Parent.
IsParentKind
(SyntaxKind.CompilationUnit))
1007
if (name.
IsParentKind
(SyntaxKind.LessThanExpression) &&
1009
conditional.
IsParentKind
(SyntaxKind.ExpressionStatement) &&
1010
conditional.Parent.
IsParentKind
(SyntaxKind.GlobalStatement))
1231
token.Parent.
IsParentKind
(SyntaxKind.ParenthesizedLambdaExpression))
1278
return parent.IsKind(SyntaxKind.ParameterList) && parent.
IsParentKind
(SyntaxKind.AnonymousMethodExpression);
1421
leftToken.Parent.
IsParentKind
(SyntaxKind.Subpattern))
1800
if (parent.
IsParentKind
(SyntaxKind.VariableDeclaration) &&
2077
if (equalsValue.
IsParentKind
(SyntaxKind.VariableDeclarator) &&
2078
equalsValue.Parent.
IsParentKind
(SyntaxKind.VariableDeclaration))
2096
if (equalsValue.
IsParentKind
(SyntaxKind.EnumMemberDeclaration))
2102
if (equalsValue.
IsParentKind
(SyntaxKind.Parameter))
2119
token.Parent.
IsParentKind
(SyntaxKind.AttributeArgument))
2127
token.Parent.
IsParentKind
(SyntaxKind.AttributeArgument))
2209
token.Parent.
IsParentKind
(SyntaxKind.UsingDirective))
2347
if (type.
IsParentKind
(SyntaxKind.VariableDeclaration) &&
2455
if (token.Parent.
IsParentKind
(SyntaxKind.ParenthesizedExpression))
2467
token.Parent.
IsParentKind
(SyntaxKind.Argument))
2997
targetToken.Parent.
IsParentKind
(SyntaxKind.EnumDeclaration);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
64
(i == 0 && currentUsing.
IsParentKind
(SyntaxKind.FileScopedNamespaceDeclaration)))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (8)
323
if (argument.Parent.
IsParentKind
(SyntaxKind.ImplicitElementAccess) &&
324
argument.Parent.Parent.
IsParentKind
(SyntaxKind.SimpleAssignmentExpression) &&
325
argument.Parent.Parent.Parent.
IsParentKind
(SyntaxKind.ObjectInitializerExpression) &&
1220
if (equalsValue.
IsParentKind
(SyntaxKind.Parameter) &&
1414
else if (initializerExpression.
IsParentKind
(SyntaxKind.SimpleAssignmentExpression))
1729
memberAccessExpression.Parent.
IsParentKind
(SyntaxKind.AwaitExpression))
2192
if (variableDeclaration.
IsParentKind
(SyntaxKind.UsingStatement))
2196
if (variableDeclaration.
IsParentKind
(SyntaxKind.ForStatement))