86 references to IsParentKind
Microsoft.CodeAnalysis.CSharp.CodeStyle (41)
src\roslyn\src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (1)
277
while (result.
IsParentKind
(SyntaxKind.ElseClause))
src\roslyn\src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
318
return current.
IsParentKind
(SyntaxKind.Block)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (5)
73
if (node.
IsParentKind
(SyntaxKind.UsingDirective))
79
if (node.
IsParentKind
(SyntaxKind.SimpleBaseType))
91
if (node.
IsParentKind
(SyntaxKind.NameEquals) && node.Parent.
IsParentKind
(SyntaxKind.UsingDirective))
101
if (node.
IsParentKind
(SyntaxKind.Attribute))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
69
if (equalsValueClause.
IsParentKind
(SyntaxKind.VariableDeclarator) &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (8)
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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
284
nodeParent.
IsParentKind
(SyntaxKind.CasePatternSwitchLabel))
608
(binaryExpression.
IsParentKind
(SyntaxKind.Argument) || binaryExpression.Parent is InitializerExpressionSyntax))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (10)
225
variableDeclaration.
IsParentKind
(SyntaxKind.FieldDeclaration))
232
if (type.
IsParentKind
(SyntaxKind.ObjectCreationExpression) &&
233
type.Parent.
IsParentKind
(SyntaxKind.EqualsValueClause) &&
234
type.Parent.Parent.
IsParentKind
(SyntaxKind.VariableDeclarator) &&
236
variableDeclaration.
IsParentKind
(SyntaxKind.FieldDeclaration))
273
if (type.
IsParentKind
(SyntaxKind.Parameter) && type.Parent.
IsParentKind
(SyntaxKind.ParameterList))
285
if (type.Parent.Parent.
IsParentKind
(SyntaxKind.ConstructorDeclaration))
297
variableDeclaration.
IsParentKind
(SyntaxKind.EventFieldDeclaration))
307
if (type.
IsParentKind
(SyntaxKind.TypeConstraint))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SimpleNameSyntaxExtensions.cs (1)
16
Debug.Assert(name.IsSimpleMemberAccessExpressionName() || name.IsMemberBindingExpressionName() || name.IsRightSideOfQualifiedName() || name.
IsParentKind
(SyntaxKind.NameMemberCref));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
50
if (node.
IsParentKind
(kind))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (3)
78
=> token.IsOpenParenInParameterList() && token.Parent.
IsParentKind
(SyntaxKind.ConversionOperatorDeclaration);
81
=> token.IsOpenParenInParameterList() && token.Parent.
IsParentKind
(SyntaxKind.OperatorDeclaration);
145
return node.
IsParentKind
(SyntaxKind.AnonymousMethodExpression);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
143
currentToken.Parent.
IsParentKind
(SyntaxKind.IfStatement))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (2)
340
previousToken.Parent.
IsParentKind
(SyntaxKind.Parameter))
524
previousToken.Parent?.
IsParentKind
(SyntaxKind.ArrayType) == true)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
570
if (castNode.
IsParentKind
(SyntaxKind.Interpolation) && originalConversionOperation.Type?.SpecialType is SpecialType.System_Object)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (45)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
100
editor.RemoveNode(nextStatement.
IsParentKind
(SyntaxKind.GlobalStatement) ? nextStatement.GetRequiredParent() : nextStatement);
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (1)
35
=> _invocationExpression.
IsParentKind
(SyntaxKind.RefExpression) ? RefKind.Ref : RefKind.None;
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (2)
135
var onYield = node.
IsParentKind
(SyntaxKind.YieldReturnStatement);
260
if (node.
IsParentKind
(SyntaxKind.ArrowExpressionClause) &&
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (1)
81
return node.
IsParentKind
(SyntaxKind.Subpattern)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (1)
88
newIf = originalIf.
IsParentKind
(SyntaxKind.ElseClause)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
515
else if (destinationMember is StatementSyntax statement && statement.
IsParentKind
(SyntaxKind.GlobalStatement))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (4)
120
return statement != null && !statement.
IsParentKind
(SyntaxKind.GlobalStatement) &&
211
memberDeclaration.
IsParentKind
(SyntaxKind.CompilationUnit))
230
memberDeclaration.
IsParentKind
(SyntaxKind.CompilationUnit))
480
if (targetToken.Parent.
IsParentKind
(SyntaxKind.InvocationExpression) && !targetToken.IsInvocationOfVarExpression())
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (25)
61
token.Parent.
IsParentKind
(SyntaxKind.Attribute))
69
token.Parent.
IsParentKind
(SyntaxKind.Attribute))
116
(parent is MemberDeclarationSyntax && parent.
IsParentKind
(SyntaxKind.CompilationUnit)))
511
if (token.Parent.
IsParentKind
(SyntaxKind.CompilationUnit))
840
token.Parent.
IsParentKind
(SyntaxKind.SimpleBaseType) &&
841
token.Parent.Parent.
IsParentKind
(SyntaxKind.BaseList))
1015
if (name.
IsParentKind
(SyntaxKind.LessThanExpression) &&
1017
conditional.
IsParentKind
(SyntaxKind.ExpressionStatement) &&
1018
conditional.Parent.
IsParentKind
(SyntaxKind.GlobalStatement))
1239
token.Parent.
IsParentKind
(SyntaxKind.ParenthesizedLambdaExpression))
1286
return parent.IsKind(SyntaxKind.ParameterList) && parent.
IsParentKind
(SyntaxKind.AnonymousMethodExpression);
1429
leftToken.Parent.
IsParentKind
(SyntaxKind.Subpattern))
1617
leftToken.Parent.
IsParentKind
(SyntaxKind.ParenthesizedVariableDesignation))
1808
if (parent.
IsParentKind
(SyntaxKind.VariableDeclaration) &&
2085
if (equalsValue.
IsParentKind
(SyntaxKind.VariableDeclarator) &&
2086
equalsValue.Parent.
IsParentKind
(SyntaxKind.VariableDeclaration))
2104
if (equalsValue.
IsParentKind
(SyntaxKind.EnumMemberDeclaration))
2110
if (equalsValue.
IsParentKind
(SyntaxKind.Parameter))
2127
token.Parent.
IsParentKind
(SyntaxKind.AttributeArgument))
2135
token.Parent.
IsParentKind
(SyntaxKind.AttributeArgument))
2217
token.Parent.
IsParentKind
(SyntaxKind.UsingDirective))
2355
if (type.
IsParentKind
(SyntaxKind.VariableDeclaration) &&
2463
if (token.Parent.
IsParentKind
(SyntaxKind.ParenthesizedExpression))
2475
token.Parent.
IsParentKind
(SyntaxKind.Argument))
3020
targetToken.Parent.
IsParentKind
(SyntaxKind.EnumDeclaration);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
63
(i == 0 && currentUsing.
IsParentKind
(SyntaxKind.FileScopedNamespaceDeclaration)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (8)
327
if (argument.Parent.
IsParentKind
(SyntaxKind.ImplicitElementAccess) &&
328
argument.Parent.Parent.
IsParentKind
(SyntaxKind.SimpleAssignmentExpression) &&
329
argument.Parent.Parent.Parent.
IsParentKind
(SyntaxKind.ObjectInitializerExpression) &&
1224
if (equalsValue.
IsParentKind
(SyntaxKind.Parameter) &&
1492
else if (initializerExpression.
IsParentKind
(SyntaxKind.SimpleAssignmentExpression))
1807
memberAccessExpression.Parent.
IsParentKind
(SyntaxKind.AwaitExpression))
2270
if (variableDeclaration.
IsParentKind
(SyntaxKind.UsingStatement))
2274
if (variableDeclaration.
IsParentKind
(SyntaxKind.ForStatement))