42 references to IsParentKind
Microsoft.CodeAnalysis.CSharp.CodeStyle (42)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (1)
278
while (result.
IsParentKind
(SyntaxKind.ElseClause))
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
351
return current.
IsParentKind
(SyntaxKind.Block)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (4)
73
if (node.
IsParentKind
(SyntaxKind.UsingDirective))
79
if (node.
IsParentKind
(SyntaxKind.SimpleBaseType))
91
if (node.
IsParentKind
(SyntaxKind.NameEquals) && node.Parent.
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)
45
=> expression.
IsParentKind
(SyntaxKind.NameMemberCref) && expression.Parent.
IsParentKind
(SyntaxKind.QualifiedCref);
109
=> name.
IsParentKind
(SyntaxKind.ExplicitInterfaceSpecifier);
187
if (expression.
IsParentKind
(SyntaxKind.ConstantPattern))
275
if (!expr.
IsParentKind
(SyntaxKind.Argument))
400
return nameEquals.
IsParentKind
(SyntaxKind.AttributeArgument);
485
if (expression is LiteralExpressionSyntax && !expression.
IsParentKind
(SyntaxKind.UnaryMinusExpression))
598
if (!(expression is LiteralExpressionSyntax && expression.
IsParentKind
(SyntaxKind.UnaryMinusExpression)))
639
if ((expression.
IsParentKind
(SyntaxKind.NameEquals) && expression.Parent.
IsParentKind
(SyntaxKind.AttributeArgument)) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
251
nodeParent.
IsParentKind
(SyntaxKind.CasePatternSwitchLabel))
545
(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)
289
previousToken.Parent.
IsParentKind
(SyntaxKind.Parameter))
467
previousToken.Parent?.
IsParentKind
(SyntaxKind.ArrayType) == true)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (4)
636
node.
IsParentKind
(SyntaxKind.NameColon) &&
637
node.Parent.
IsParentKind
(SyntaxKind.Subpattern);
649
if (identifier.Parent.
IsParentKind
(SyntaxKind.WithInitializerExpression))
655
else if (identifier.Parent.
IsParentKind
(SyntaxKind.ObjectInitializerExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
514
if (castNode.
IsParentKind
(SyntaxKind.Interpolation) && originalConversionOperation.Type?.SpecialType is SpecialType.System_Object)