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)
46=> expression.IsParentKind(SyntaxKind.NameMemberCref) && expression.Parent.IsParentKind(SyntaxKind.QualifiedCref); 110=> name.IsParentKind(SyntaxKind.ExplicitInterfaceSpecifier); 188if (expression.IsParentKind(SyntaxKind.ConstantPattern)) 276if (!expr.IsParentKind(SyntaxKind.Argument)) 401return nameEquals.IsParentKind(SyntaxKind.AttributeArgument); 486if (expression is LiteralExpressionSyntax && !expression.IsParentKind(SyntaxKind.UnaryMinusExpression)) 599if (!(expression is LiteralExpressionSyntax && expression.IsParentKind(SyntaxKind.UnaryMinusExpression))) 640if ((expression.IsParentKind(SyntaxKind.NameEquals) && expression.Parent.IsParentKind(SyntaxKind.AttributeArgument)) ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
255nodeParent.IsParentKind(SyntaxKind.CasePatternSwitchLabel)) 549(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)
532if (castNode.IsParentKind(SyntaxKind.Interpolation) && originalConversionOperation.Type?.SpecialType is SpecialType.System_Object)