42 references to IsParentKind
Microsoft.CodeAnalysis.CSharp.CodeStyle (42)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (1)
278while (result.IsParentKind(SyntaxKind.ElseClause))
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
351return current.IsParentKind(SyntaxKind.Block)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (4)
73if (node.IsParentKind(SyntaxKind.UsingDirective)) 79if (node.IsParentKind(SyntaxKind.SimpleBaseType)) 91if (node.IsParentKind(SyntaxKind.NameEquals) && node.Parent.IsParentKind(SyntaxKind.UsingDirective))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
69if (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); 187if (expression.IsParentKind(SyntaxKind.ConstantPattern)) 275if (!expr.IsParentKind(SyntaxKind.Argument)) 400return nameEquals.IsParentKind(SyntaxKind.AttributeArgument); 485if (expression is LiteralExpressionSyntax && !expression.IsParentKind(SyntaxKind.UnaryMinusExpression)) 598if (!(expression is LiteralExpressionSyntax && expression.IsParentKind(SyntaxKind.UnaryMinusExpression))) 639if ((expression.IsParentKind(SyntaxKind.NameEquals) && expression.Parent.IsParentKind(SyntaxKind.AttributeArgument)) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
251nodeParent.IsParentKind(SyntaxKind.CasePatternSwitchLabel)) 545(binaryExpression.IsParentKind(SyntaxKind.Argument) || binaryExpression.Parent is InitializerExpressionSyntax))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (10)
226variableDeclaration.IsParentKind(SyntaxKind.FieldDeclaration)) 233if (type.IsParentKind(SyntaxKind.ObjectCreationExpression) && 234type.Parent.IsParentKind(SyntaxKind.EqualsValueClause) && 235type.Parent.Parent.IsParentKind(SyntaxKind.VariableDeclarator) && 237variableDeclaration.IsParentKind(SyntaxKind.FieldDeclaration)) 274if (type.IsParentKind(SyntaxKind.Parameter) && type.Parent.IsParentKind(SyntaxKind.ParameterList)) 286if (type.Parent.Parent.IsParentKind(SyntaxKind.ConstructorDeclaration)) 298variableDeclaration.IsParentKind(SyntaxKind.EventFieldDeclaration)) 308if (type.IsParentKind(SyntaxKind.TypeConstraint))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SimpleNameSyntaxExtensions.cs (1)
16Debug.Assert(name.IsSimpleMemberAccessExpressionName() || name.IsMemberBindingExpressionName() || name.IsRightSideOfQualifiedName() || name.IsParentKind(SyntaxKind.NameMemberCref));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
48if (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); 144return node.IsParentKind(SyntaxKind.AnonymousMethodExpression);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
143currentToken.Parent.IsParentKind(SyntaxKind.IfStatement))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (2)
289previousToken.Parent.IsParentKind(SyntaxKind.Parameter)) 467previousToken.Parent?.IsParentKind(SyntaxKind.ArrayType) == true)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (4)
636node.IsParentKind(SyntaxKind.NameColon) && 637node.Parent.IsParentKind(SyntaxKind.Subpattern); 649if (identifier.Parent.IsParentKind(SyntaxKind.WithInitializerExpression)) 655else if (identifier.Parent.IsParentKind(SyntaxKind.ObjectInitializerExpression))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
514if (castNode.IsParentKind(SyntaxKind.Interpolation) && originalConversionOperation.Type?.SpecialType is SpecialType.System_Object)