70 references to Parent
Microsoft.CodeAnalysis.CSharp (70)
Binder\Binder_QueryErrors.cs (2)
136for (CSharpSyntaxNode parent = node.Parent; parent != null; parent = parent.Parent) 152for (CSharpSyntaxNode parent = node.Parent; parent != null; parent = parent.Parent)
Binder\Binder_Statements.cs (2)
828if (declarationNode.Parent.Kind() == SyntaxKind.LocalDeclarationStatement && 1903hasUnsafeModifier: node.Parent?.Kind() == SyntaxKind.UnsafeStatement,
Binder\BinderFactory.BinderFactoryVisitor.cs (7)
267return VisitCore(parent.Parent); 277resultBinder = VisitCore(parent.Parent); 281var propertyOrEventDecl = parent.Parent.Parent; 441if (node.Parent.Kind() == SyntaxKind.CompilationUnit && syntaxTree.Options.Kind != SourceCodeKind.Regular) 1436curr = curr.Parent; 1448for (; !SyntaxFacts.IsDocumentationCommentTrivia(curr.Kind()); curr = curr.Parent)
Binder\ExpressionVariableFinder.cs (2)
55Debug.Assert(node.Parent is ConstructorInitializerSyntax || node.Parent is PrimaryConstructorBaseTypeSyntax);
Compilation\AttributeSemanticModel.cs (2)
70var parent = node.Parent; 73parent = parent.Parent;
Compilation\CSharpSemanticModel.cs (4)
93if (!isSpeculative && node.Parent != null && node.Parent.Kind() == SyntaxKind.NameEquals && node.Parent.Parent.Kind() == SyntaxKind.UsingDirective)
Compilation\InitializerSemanticModel.cs (1)
196this.Root == node.Parent /*field initializer*/;
Compilation\MemberSemanticModel.cs (9)
1554if (current.Parent == null || current.Parent.Kind() != SyntaxKind.LocalFunctionStatement) 2180return node.Parent; 2212var parent = node.Parent; 2237var grandparent = parent.Parent; 2282CSharpSyntaxNode? parent = node.Parent; 2303var pp = parent.Parent; 2322case { RawKind: (int)SyntaxKind.SimpleMemberAccessExpression, Parent.RawKind: (int)SyntaxKind.InvocationExpression }: 2323bindableParent = bindableParent.Parent;
Compilation\SyntaxTreeSemanticModel.cs (18)
247else if (node.Parent.Kind() == SyntaxKind.XmlNameAttribute && (attrSyntax = (XmlNameAttributeSyntax)node.Parent).Identifier == node) 940return GetOrAddModel((CompilationUnitSyntax)memberDecl.Parent); 962return GetMemberModel(memberDecl.Parent); 1116ExceptionUtilities.UnexpectedValue(node.Parent); 1120switch (node.Parent.Kind()) 1124var variableDecl = (VariableDeclaratorSyntax)node.Parent; 1137var propertyDecl = (PropertyDeclarationSyntax)node.Parent; 1150ParameterSyntax parameterDecl = (ParameterSyntax)node.Parent; 1165var enumDecl = (EnumMemberDeclarationSyntax)node.Parent; 1177throw ExceptionUtilities.UnexpectedValue(node.Parent.Kind()); 1186if (node.Parent is BasePropertyDeclarationSyntax) 1193ExceptionUtilities.UnexpectedValue(node.Parent); 1208var parent = node.Parent; 1577var propertyOrEventDecl = declarationSyntax.Parent.Parent; 2301if (memberDeclaration.Parent.Kind() == SyntaxKind.CompilationUnit) 2325var container = GetDeclaredNamespaceOrType(memberDeclaration.Parent);
Compiler\MethodCompiler.cs (2)
2134var parent = child.Parent; 2139parent = child.Parent;
DocumentationComments\SourceDocumentationCommentUtils.cs (1)
53curr = curr.Parent;
Parser\LanguageParser.cs (3)
142return node != null ? node.Parent : null; 2412return (this.CurrentNode.Parent is Syntax.CompilationUnitSyntax); 4648CSharp.CSharpSyntaxNode grandparent = parent.Parent;
Symbols\Source\SourceEventSymbol.cs (4)
150Debug.Assert(syntax.Parent!.Parent is object); 151return ((EventFieldDeclarationSyntax)syntax.Parent.Parent).AttributeLists;
Symbols\Source\SourceMemberFieldSymbol.cs (2)
408return (BaseFieldDeclarationSyntax)declarator.Parent.Parent;
Syntax\CSharpSyntaxNode.cs (3)
72var parent = node.Parent; 407curr = curr.Parent; 524var parent = this.Parent;
Syntax\NamespaceDeclarationSyntaxReference.cs (1)
37node = node.Parent;
Syntax\SyntaxExtensions.cs (2)
262return node.Parent != null && IsInContextWhichNeedsDynamicAttribute(node.Parent);
Syntax\SyntaxFactory.cs (5)
2141CSharpSyntaxNode? parent = node.Parent; 2188CSharpSyntaxNode? grandparent = parent.Parent; 2229if (parent.Parent.IsKind(SyntaxKind.Subpattern)) 2231return parent.Parent; 2254currentNode = currentNode.Parent;