128 references to ChildNodes
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (1)
HubClientProxyGenerator.Parser.cs (1)
255&& memberAccess.Parent.ChildNodes().FirstOrDefault(x => x is ArgumentListSyntax) is
Microsoft.CodeAnalysis (1)
Syntax\SyntaxNode.cs (1)
720/// The node that contains this node in its <see cref="ChildNodes"/> collection.
Microsoft.CodeAnalysis.CodeStyle (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
124nodes.AddRangeAtHead(currentNode.ChildNodes());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (2)
66documentationComment.ChildNodes().OfType<TXmlElementSyntax>() 100foreach (var node in summaryElement.ChildNodes())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
875=> node.ChildNodes().Any(c => c.RawKind == syntaxFacts.SyntaxKinds.GlobalStatement);
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (3)
103var nodeAfterNewParamNode = paramNodes.FirstOrDefault() ?? newDocComment.ChildNodes().First(); 116GetNewNode(parameterName, nodeAfterNewParamNode == newDocComment.ChildNodes().First()) 127var nodes = docComment.ChildNodes().OfType<TXmlElementSyntax>()
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
262var left = QualifiedNameToMemberAccess(qualifiedNameSyntaxKind, memberAccessExpressionSyntaxKind, expression.ChildNodes().First(), generator); 263var right = expression.ChildNodes().Last();
Microsoft.CodeAnalysis.CSharp (1)
Syntax\SyntaxFactory.cs (1)
2348var lastNode = compilation.ChildNodes().LastOrDefault();
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\MisplacedUsingDirectives\MisplacedUsingDirectivesDiagnosticAnalyzer.cs (1)
94return compilationUnit.ChildNodes().Any(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
265for (var current = expression; current != null; current = current.ChildNodes().FirstOrDefault() as ExpressionSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
302var expression = (ExpressionSyntax)currentReplacedNode.ChildNodes().First();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
65var invocationExpression = node.ChildNodes().FirstOrDefault(n => n.IsKind(SyntaxKind.InvocationExpression));
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (1)
76var elementNode = (XmlElementSyntax)newDocCommentNode.ChildNodes().ElementAt(0);
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
44var nameNode = node.ChildNodes().FirstOrDefault(n => n.IsKind(SyntaxKind.IdentifierName));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Utilities\CSharpServiceTestExtensions.cs (2)
25foreach (var child in node.ChildNodes()) 40return node.ChildNodes().OfType<T>().First();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (9)
Semantics\PrimaryConstructorTests.cs (9)
20610var typeDeclaration = tree.GetRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Single(); 20644var typeDeclaration1 = root.ChildNodes().OfType<TypeDeclarationSyntax>().First(); 20655var typeDeclaration2 = root.ChildNodes().OfType<TypeDeclarationSyntax>().Last(); 20688var typeDeclaration1 = root.ChildNodes().OfType<TypeDeclarationSyntax>().First(); 20699var typeDeclaration2 = root.ChildNodes().OfType<TypeDeclarationSyntax>().Last(); 20735var typeDeclaration1 = root.ChildNodes().OfType<TypeDeclarationSyntax>().First(); 20744var typeDeclaration2 = root.ChildNodes().OfType<TypeDeclarationSyntax>().Last(); 20785var typeDeclaration1 = root.ChildNodes().OfType<TypeDeclarationSyntax>().First(); 20796var typeDeclaration2 = root.ChildNodes().OfType<TypeDeclarationSyntax>().Last();
Microsoft.CodeAnalysis.CSharp.Features (11)
ChangeSignature\CSharpChangeSignatureService.cs (3)
189var parameters = matchingNode.ChildNodes().OfType<BaseParameterListSyntax>().SingleOrDefault(); 219var lastAttributes = matchingNode.ChildNodes().LastOrDefault(n => n is AttributeListSyntax); 229var parameterList = matchingNode.ChildNodes().LastOrDefault(n => n is ParameterListSyntax);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1625unit.ChildNodes().FirstOrDefault();
EditAndContinue\SyntaxComparer.cs (1)
1281foreach (var child in block.ChildNodes())
Highlighting\KeywordHighlighters\LoopHighlighter.cs (1)
95foreach (var child in node.ChildNodes())
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
291? scope.ChildNodes().OfType<GlobalStatementSyntax>()
src\Analyzers\CSharp\Analyzers\MisplacedUsingDirectives\MisplacedUsingDirectivesDiagnosticAnalyzer.cs (1)
94return compilationUnit.ChildNodes().Any(
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (1)
65var invocationExpression = node.ChildNodes().FirstOrDefault(n => n.IsKind(SyntaxKind.InvocationExpression));
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (1)
76var elementNode = (XmlElementSyntax)newDocCommentNode.ChildNodes().ElementAt(0);
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
44var nameNode = node.ChildNodes().FirstOrDefault(n => n.IsKind(SyntaxKind.IdentifierName));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (17)
Semantics\BindingTests.cs (3)
2889var param = node.ChildNodes().Where(n => n.IsKind(SyntaxKind.Parameter)).Single(); 2927var param = lambda.ChildNodes().Where(n => n.IsKind(SyntaxKind.Parameter)).Single(); 2969var param = lambda.ChildNodes().Where(n => n.IsKind(SyntaxKind.Parameter)).Single();
Semantics\NullableReferenceTypesTests.cs (1)
3695var param = lambda.ChildNodes().Where(n => n.IsKind(SyntaxKind.Parameter)).Single();
Semantics\QueryTests.cs (11)
1453var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Query").Single(); 1662var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Query").Single(); 1722var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Query").Single(); 1760var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Query").Single(); 2897var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "C").Single(); 2930var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "C").Single(); 3420var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Query").Single(); 3464var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Query").Single(); 3511var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Test").Single(); 3550var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "Test2").Single(); 3598var classC = tree.GetCompilationUnitRoot().ChildNodes().OfType<TypeDeclarationSyntax>().Where(t => t.Identifier.ValueText == "QueryExpressionTest").Single();
Semantics\ScriptSemanticsTests.cs (2)
522var statements = root.ChildNodes().Select(n => ((GlobalStatementSyntax)n).Statement).ToArray(); 538var declarations = root.ChildNodes().Select(n => ((FieldDeclarationSyntax)n).Declaration.Variables[0]).ToArray();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (10)
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (8)
3384var node = root.ChildNodes().First(); 5127var node = root.ChildNodes().First(); 5307.ChildNodes() 5402.ChildNodes() 5450.ChildNodes() 5493.ChildNodes() 5588.ChildNodes() 5636.ChildNodes()
Symbols\AnonymousTypesSemanticsTests.cs (2)
2012current = current.ChildNodes().Single(); 2065foreach (var child in node.ChildNodes())
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (11)
LexicalAndXml\PreprocessorTests.cs (1)
2382var classDeclaration = node.ChildNodes().Single(n => n is ClassDeclarationSyntax);
Parsing\ParsingErrorRecoveryTests.cs (1)
7383Assert.Equal(3, foreachNode.ChildNodes().ToList().Count);
Parsing\ScriptParsingTests.cs (6)
9611Assert.Equal(1, tree.GetCompilationUnitRoot().ChildNodes().Count()); 9612Assert.Equal(SyntaxKind.GlobalStatement, tree.GetCompilationUnitRoot().ChildNodes().ToList()[0].Kind()); 9636Assert.Empty(root.ChildNodes()); 9647Assert.Empty(root.ChildNodes()); 9663var statement = root.ChildNodes().Single(); 9710Assert.Empty(root.ChildNodes());
Syntax\SyntaxNodeTests.cs (3)
74var nodes = expression.ChildNodes().ToList(); 732var classDecl = (TypeDeclarationSyntax)root.ChildNodes().First(); 750var classDecl2 = (TypeDeclarationSyntax)root.ChildNodes().Last();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
1337bool hasTopLevelStatements = syntaxTrees.Any(s => s.GetRoot().ChildNodes().OfType<GlobalStatementSyntax>().Any());
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
Rename\LabelConflictVisitor.cs (1)
23foreach (var child in node.ChildNodes())
Rename\LocalConflictVisitor.cs (4)
24foreach (var child in node.ChildNodes()) 166foreach (var child in body.ChildNodes().Where(c => c.Kind() != SyntaxKind.QueryContinuation)) 186var statements = node.ChildNodes().Where(x => x.IsKind(SyntaxKind.SwitchSection)).SelectMany(x => x.ChildNodes());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
265for (var current = expression; current != null; current = current.ChildNodes().FirstOrDefault() as ExpressionSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
302var expression = (ExpressionSyntax)currentReplacedNode.ChildNodes().First();
Microsoft.CodeAnalysis.Features (7)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (1)
88if (r.ChildNodes().All(n => syntaxFacts.IsUsingOrExternOrImport(n) || Fixer.IsAttributeListWithAssemblyAttributes(n)))
ExtractMethod\Extensions.cs (1)
54foreach (var child in node.ChildNodes())
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (3)
103var nodeAfterNewParamNode = paramNodes.FirstOrDefault() ?? newDocComment.ChildNodes().First(); 116GetNewNode(parameterName, nodeAfterNewParamNode == newDocComment.ChildNodes().First()) 127var nodes = docComment.ChildNodes().OfType<TXmlElementSyntax>()
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
262var left = QualifiedNameToMemberAccess(qualifiedNameSyntaxKind, memberAccessExpressionSyntaxKind, expression.ChildNodes().First(), generator); 263var right = expression.ChildNodes().Last();
Microsoft.CodeAnalysis.Test.Utilities (1)
CommonTestBase.cs (1)
629foreach (var child in node.ChildNodes())
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (4)
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (1)
172Dim argumentList = invocationNode.ChildNodes.OfType(Of ArgumentListSyntax).FirstOrDefault()
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicCommonGenerationServiceMethods.vb (1)
15Dim optionStatement = CType(root.ChildNodes().FirstOrDefault(Function(n) n.IsKind(SyntaxKind.OptionStatement)), OptionStatementSyntax)
src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (2)
103ifStatement.ChildNodes().Last(), 104ifStatement.ChildNodes().Last().WithPrependedLeadingTrivia(trivia))
Microsoft.CodeAnalysis.VisualBasic.Features (15)
ChangeSignature\VisualBasicChangeSignatureService.vb (4)
153Dim parameters = matchingNode.ChildNodes().OfType(Of ParameterListSyntax)().SingleOrDefault() 178Dim lastAttributes = matchingNode.ChildNodes().LastOrDefault( 187Dim asClause = matchingNode.ChildNodes().LastOrDefault(Function(n) TypeOf n Is AsClauseSyntax) 193Dim parameterList = matchingNode.ChildNodes().LastOrDefault(
EditAndContinue\DeclarationBody\VisualBasicLambdaBody.vb (2)
69Dim comparer = New SyntaxComparer(_node.Parent, newLambdaBody._node.Parent, _node.Parent.ChildNodes(), newLambdaBody._node.Parent.ChildNodes(), matchingLambdas:=True, compareStatementSyntax:=True)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
1091Dim globalNode = unit.ChildNodes().FirstOrDefault()
Highlighting\KeywordHighlighters\ForLoopBlockHighlighter.vb (1)
106forBlockChild = forBlockChild.ChildNodes().OfType(Of ForOrForEachBlockSyntax).LastOrDefault()
Highlighting\KeywordHighlightingHelpers.vb (3)
36For Each child In node.ChildNodes() 108For Each child In node.ChildNodes() 121For Each child In node.ChildNodes()
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (1)
172Dim argumentList = invocationNode.ChildNodes.OfType(Of ArgumentListSyntax).FirstOrDefault()
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicCommonGenerationServiceMethods.vb (1)
15Dim optionStatement = CType(root.ChildNodes().FirstOrDefault(Function(n) n.IsKind(SyntaxKind.OptionStatement)), OptionStatementSyntax)
src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (2)
103ifStatement.ChildNodes().Last(), 104ifStatement.ChildNodes().Last().WithPrependedLeadingTrivia(trivia))
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (3)
Compilation\SemanticModelAPITests.vb (2)
2699Dim arg = DirectCast(argList.ChildNodes().First(), SimpleArgumentSyntax).Expression 2708arg = DirectCast(argList.ChildNodes().First(), SimpleArgumentSyntax).Expression
Compilation\SuppressAccessibilityChecksTests.vb (1)
244propertyDecl.ReplaceNode(propertyDecl.Accessors(0), blockStatement.ChildNodes().OfType(Of PropertyBlockSyntax).Single().Accessors(0))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (4)
TestSyntaxNodes.vb (4)
2259Dim classDecl = DirectCast(root.ChildNodes().First(), TypeBlockSyntax) 2278Dim classDecl2 = DirectCast(root.ChildNodes().Last(), TypeBlockSyntax) 2362Dim nodes = expression.ChildNodes().ToList() 2958For Each node In tree.GetRoot.ChildNodes
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
Rename\LabelConflictVisitor.vb (1)
19For Each child In node.ChildNodes()
Rename\LocalConflictVisitor.vb (1)
24For Each child In node.ChildNodes()
Microsoft.CodeAnalysis.Workspaces (5)
Differencing\AbstractSyntaxComparer.cs (1)
93foreach (var child in node.ChildNodes())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
124nodes.AddRangeAtHead(currentNode.ChildNodes());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (2)
66documentationComment.ChildNodes().OfType<TXmlElementSyntax>() 100foreach (var node in summaryElement.ChildNodes())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
875=> node.ChildNodes().Any(c => c.RawKind == syntaxFacts.SyntaxKinds.GlobalStatement);
Microsoft.ML.InternalCodeAnalyzer (1)
InstanceInitializerAnalyzer.cs (1)
72if (!syntax.ChildNodes().Any(s => s.IsKind(SyntaxKind.EqualsValueClause)))