176 references to DescendantNodesAndSelf
IdeCoreBenchmarks (1)
FormatterBenchmarks.cs (1)
71_ = formattedRoot.DescendantNodesAndSelf().ToImmutableArray();
Microsoft.Analyzers.Extra (2)
Utilities\SyntaxNodeExtensions.cs (2)
111var foundNode = currentNode.DescendantNodesAndSelf() 123.DescendantNodesAndSelf()
Microsoft.CodeAnalysis (5)
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
2889foreach (var node in declaredNode.DescendantNodesAndSelf(descendIntoChildren: shouldAddNode, descendIntoTrivia: true))
DiagnosticAnalyzer\AnalyzerExecutor.cs (2)
712return cb.DescendantNodesAndSelf(descendIntoChildren: filter).Where(filter); 716return cb.DescendantNodesAndSelf();
SourceGeneration\GeneratorSyntaxWalker.cs (1)
28foreach (var child in node.DescendantNodesAndSelf())
SourceGeneration\Nodes\PredicateSyntaxStrategy.cs (1)
121foreach (var node in root.DescendantNodesAndSelf())
Microsoft.CodeAnalysis.CodeStyle (16)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
237foreach (var identifierName in codeBlock.DescendantNodesAndSelf().OfType<TIdentifierName>())
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
171foreach (var identifier in whenPartToAnalyze.DescendantNodesAndSelf())
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
110foreach (var subExpression in expression.DescendantNodesAndSelf().OfType<TExpressionSyntax>())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
79node.DescendantNodesAndSelf(n => n != previous && n.Span.IntersectsWith(span) && !span.Contains(n.Span))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
261Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 263Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 285Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 287Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 297Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 299Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 307Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 309Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 319Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 321Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (3)
56var nodes = root.DescendantNodesAndSelf(OverlapsWithSpan).Where(OverlapsWithSpan); 155var first = root.DescendantNodesAndSelf().First(x => x.HasAnnotation(annotation)); 156var last = root.DescendantNodesAndSelf().Last(x => x.HasAnnotation(annotation));
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder.IdentifierUsedAsValueFinder.cs (1)
33var nodesOfInterest = node.DescendantNodesAndSelf(descendIntoChildren: childrenNeedChecking, descendIntoTrivia: false);
Compiler\MethodCompiler.cs (2)
2218if (body1?.DescendantNodesAndSelf().Where(n => (object)n == _id).Any() == true || 2219body2?.DescendantNodesAndSelf().Where(n => (object)n == _id).Any() == true)
Syntax\SyntaxFacts.cs (1)
546return node.DescendantNodesAndSelf(child => !IsNestedFunction(child)).Any(
Microsoft.CodeAnalysis.CSharp.CodeStyle (13)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
279return !expression.DescendantNodesAndSelf().All(
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (5)
72foreach (var argument in codeBlock.DescendantNodesAndSelf().OfType<ArgumentSyntax>()) 86foreach (var refExpression in codeBlock.DescendantNodesAndSelf().OfType<RefExpressionSyntax>()) 91foreach (var addressOfExpression in codeBlock.DescendantNodesAndSelf().OfType<PrefixUnaryExpressionSyntax>()) 97foreach (var memberAccess in codeBlock.DescendantNodesAndSelf().OfType<MemberAccessExpressionSyntax>()) 264foreach (var descendant in syntax.DescendantNodesAndSelf())
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
214foreach (var identifierName in statement.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>())
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
831if (assignmentExpression.Right.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().Any(
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (2)
253foreach (var node in _enclosingBlock.DescendantNodesAndSelf()) 269if (_declarator.DescendantNodesAndSelf().OfType<ExpressionSyntax>().Any(
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
68foreach (var typeArgumentList in invocation.DescendantNodesAndSelf().OfType<TypeArgumentListSyntax>())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
130.DescendantNodesAndSelf(descendIntoChildren: node => node is not AnonymousFunctionExpressionSyntax) 280if (initializer.DescendantNodesAndSelf()
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
78var descendentStatements = startStatement.DescendantNodesAndSelf().OfType<StatementSyntax>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (1)
162foreach (var node in container.DescendantNodesAndSelf())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2214foreach (var descendant in container.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>())
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
ExtractMethod\ExtractMethodBase.cs (1)
202var iterator = root.DescendantNodesAndSelf().Cast<SyntaxNode>();
SymbolKey\SymbolKeyTests.cs (1)
296var varDecl = root.DescendantNodesAndSelf().OfType<VariableDeclaratorSyntax>().Single();
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenDeconstructTests.cs (2)
5000var nodes = comp.SyntaxTrees[0].GetCompilationUnitRoot().DescendantNodesAndSelf(); 5123var nodes = comp.SyntaxTrees[0].GetCompilationUnitRoot().DescendantNodesAndSelf();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (10)
Diagnostics\DiagnosticAnalyzerTests.cs (1)
4153var syntaxKinds = baseListNode.DescendantNodesAndSelf().Select(node => node.Kind()).Distinct().AsImmutable();
FlowAnalysis\RegionAnalysisTests.cs (4)
3102var statement = compilation.SyntaxTrees[0].GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<StatementSyntax>().First(); 4526var stmt1 = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<StatementSyntax>().Where(n => n.ToString() == "IntPtr p;").Single(); 4527var stmt2 = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<StatementSyntax>().Where(n => n.ToString().StartsWith(keyword)).First(); 7909var stmt = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<ForEachStatementSyntax>().Single().Statement;
Semantics\OutVarTests.cs (1)
20658Assert.Equal(1, compilation.SyntaxTrees[0].GetRoot().DescendantNodesAndSelf().OfType<DeclarationExpressionSyntax>().Count());
Semantics\PatternMatchingTests2.cs (4)
2160foreach (var pat in tree.GetRoot().DescendantNodesAndSelf().OfType<PatternSyntax>()) 2251var patterns = tree.GetRoot().DescendantNodesAndSelf().OfType<PatternSyntax>().ToArray(); 2295var patterns = tree.GetRoot().DescendantNodesAndSelf().OfType<PatternSyntax>().ToArray(); 2341var patterns = tree.GetRoot().DescendantNodesAndSelf().OfType<PatternSyntax>().ToArray();
Microsoft.CodeAnalysis.CSharp.Features (19)
AddImport\CSharpAddImportFeatureService.cs (1)
501var aliasQualifiedName = nameSyntax.DescendantNodesAndSelf()
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
219var descendantNodesAndSelf = expression.DescendantNodesAndSelf();
Diagnostics\Analyzers\CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs (1)
53Debug.Assert(context.CodeBlock.DescendantNodesAndSelf().Contains(root));
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
197from node in root.DescendantNodesAndSelf()
EditAndContinue\SyntaxUtilities.cs (2)
241=> body.DescendantNodesAndSelf(LambdaUtilities.IsNotLambda).Where(SyntaxBindingUtilities.BindsToResumableStateMachineState); 245=> body.DescendantNodesAndSelf(LambdaUtilities.IsNotLambda).Any(n => n is YieldStatementSyntax);
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
279return !expression.DescendantNodesAndSelf().All(
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (5)
72foreach (var argument in codeBlock.DescendantNodesAndSelf().OfType<ArgumentSyntax>()) 86foreach (var refExpression in codeBlock.DescendantNodesAndSelf().OfType<RefExpressionSyntax>()) 91foreach (var addressOfExpression in codeBlock.DescendantNodesAndSelf().OfType<PrefixUnaryExpressionSyntax>()) 97foreach (var memberAccess in codeBlock.DescendantNodesAndSelf().OfType<MemberAccessExpressionSyntax>()) 264foreach (var descendant in syntax.DescendantNodesAndSelf())
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (1)
214foreach (var identifierName in statement.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>())
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
831if (assignmentExpression.Right.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().Any(
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (2)
253foreach (var node in _enclosingBlock.DescendantNodesAndSelf()) 269if (_declarator.DescendantNodesAndSelf().OfType<ExpressionSyntax>().Any(
src\Analyzers\CSharp\Analyzers\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfDiagnosticAnalyzer.cs (1)
68foreach (var typeArgumentList in invocation.DescendantNodesAndSelf().OfType<TypeArgumentListSyntax>())
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
78var descendentStatements = startStatement.DescendantNodesAndSelf().OfType<StatementSyntax>();
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (1)
217foreach (var node in spanNode.DescendantNodesAndSelf())
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\LambdaTests.cs (6)
2417var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First(); 2463var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First(); 2509var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First(); 2542var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First(); 2575var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First(); 2612var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First();
Semantics\NullableReferenceTypesTests.cs (1)
3336var reference = lambda.Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().First();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (10)
Compilation\GetSemanticInfoBrokenCodeTests.cs (2)
384return node.DescendantNodesAndSelf(descendIntoTrivia: true).OfType<ExpressionSyntax>(); 389return node.DescendantNodesAndSelf().OfType<StatementSyntax>();
Compilation\GetSemanticInfoTests.cs (5)
4212var syntax = tree.GetCompilationUnitRoot().FindToken(position).Parent.DescendantNodesAndSelf().OfType<OmittedTypeArgumentSyntax>().Single(); 4242var syntax = tree.GetCompilationUnitRoot().FindToken(position).Parent.DescendantNodesAndSelf().OfType<OmittedTypeArgumentSyntax>().Single(); 4272var syntax = tree.GetCompilationUnitRoot().FindToken(position).Parent.DescendantNodesAndSelf().OfType<GenericNameSyntax>().Single(); 4323var initializerSyntax = speculativeSyntax.DescendantNodesAndSelf().OfType<InitializerExpressionSyntax>().Single(); 4884var newSyntaxMemberAccess = newSyntax.DescendantNodesAndSelf().OfType<MemberAccessExpressionSyntax>().
Compilation\SemanticModelAPITests.cs (1)
3128Body.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().Single();
DocumentationComments\CrefTests.cs (1)
6216var alias = model.GetAliasInfo(crefSyntax.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>().Single());
Symbols\IndexerTests.cs (1)
2539node.DescendantNodesAndSelf().Where(s => s.IsKind(SyntaxKind.ElementAccessExpression)).Cast<ElementAccessExpressionSyntax>();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (20)
Diagnostics\LineSpanDirectiveTests.cs (2)
443foreach (var syntax in tree.GetRoot().DescendantNodesAndSelf()) 463var directives = tree.GetRoot().DescendantNodesAndSelf(descendIntoTrivia: true).OfType<DirectiveTriviaSyntax>();
IncrementalParsing\IncrementalParsingTests.cs (12)
492Assert.True(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is AttributeSyntax)); 493Assert.False(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is CollectionExpressionSyntax)); 502Assert.False(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is AttributeSyntax)); 503Assert.True(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is CollectionExpressionSyntax)); 524Assert.False(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is AttributeSyntax)); 525Assert.True(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is CollectionExpressionSyntax)); 534Assert.True(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is AttributeSyntax)); 535Assert.False(tree.GetRoot().DescendantNodesAndSelf().Any(n => n is CollectionExpressionSyntax)); 565var localFunc1 = tree.GetRoot().DescendantNodesAndSelf().Single(n => n is LocalFunctionStatementSyntax); 566var innerConditionalExpr1 = localFunc1.DescendantNodesAndSelf().Single(n => n is ConditionalExpressionSyntax); 582var localFunc2 = tree.GetRoot().DescendantNodesAndSelf().Single(n => n is LocalFunctionStatementSyntax); 583var innerConditionalExpr2 = localFunc2.DescendantNodesAndSelf().Single(n => n is ConditionalExpressionSyntax);
Syntax\SyntaxNodeTests.cs (6)
181var nodes = statement.DescendantNodesAndSelf().ToList(); 186nodes = statement.DescendantNodesAndSelf(descendIntoTrivia: true).ToList(); 193nodes = statement.DescendantNodesAndSelf(n => n is StatementSyntax).ToList(); 198nodes = statement.DescendantNodesAndSelf(n => n is StatementSyntax, descendIntoTrivia: true).ToList(); 337var descendantDirectives = expr.DescendantNodesAndSelf(n => n.ContainsDirectives, descendIntoTrivia: true).OfType<DirectiveTriviaSyntax>().ToList(); 519var nodesWithMyAnnotations = exprWithAnnotations.DescendantNodesAndSelf(n => n.ContainsAnnotations).Where(n => n.HasAnnotation(myAnnotation)).ToList();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
SemanticModelTestBase.cs (1)
110var constructorInitializers = node.DescendantNodesAndSelf(n => !(n is ExpressionSyntax)).Where(isConstructorInitializer);
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
Simplification\CSharpSimplificationService.Expander.cs (1)
770var typeArgumentListSyntax = simpleName.DescendantNodesAndSelf().Where(n => n is TypeArgumentListSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (2)
130.DescendantNodesAndSelf(descendIntoChildren: node => node is not AnonymousFunctionExpressionSyntax) 280if (initializer.DescendantNodesAndSelf()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (1)
162foreach (var node in container.DescendantNodesAndSelf())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
2214foreach (var descendant in container.DescendantNodesAndSelf().OfType<IdentifierNameSyntax>())
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.cs (1)
47root = root.ReplaceNodes(root.DescendantNodesAndSelf().OfType<TypeSyntax>(),
Microsoft.CodeAnalysis.Features (14)
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
196var childCreationNodes = containingMember.DescendantNodesAndSelf()
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (2)
643var childCreationNodes = containingMember.DescendantNodesAndSelf() 756var childTupleNodes = containingMember.DescendantNodesAndSelf()
EditAndContinue\DeclarationBody.cs (1)
43foreach (var node in root.DescendantNodesAndSelf(descendIntoChildren))
ExtractMethod\SelectionResult.cs (1)
168foreach (var node in SemanticDocument.Root.DescendantNodesAndSelf())
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (1)
673var matches = from nodeInCurrent in _containerMethod.DescendantNodesAndSelf().OfType<TExpressionSyntax>()
IntroduceVariable\AbstractIntroduceVariableService.cs (1)
307from descendantExpression in startingNode.DescendantNodesAndSelf().OfType<TExpressionSyntax>()
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (2)
381return statementRange.FirstStatement.DescendantNodesAndSelf().All(IsNoOpSyntaxNode); 389if (!statements[i].DescendantNodesAndSelf().All(IsNoOpSyntaxNode))
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
91foreach (var node in top.DescendantNodesAndSelf(DescendIntoChildren))
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
66foreach (var name in node.DescendantNodesAndSelf(DescendIntoChildren).OfType<TSimpleName>())
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
237foreach (var identifierName in codeBlock.DescendantNodesAndSelf().OfType<TIdentifierName>())
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
171foreach (var identifier in whenPartToAnalyze.DescendantNodesAndSelf())
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
110foreach (var subExpression in expression.DescendantNodesAndSelf().OfType<TExpressionSyntax>())
Microsoft.CodeAnalysis.Test.Utilities (3)
Compilation\CompilationExtensions.cs (2)
292foreach (var node in root.DescendantNodesAndSelf()) 394var nodes = tree.GetRoot().DescendantNodesAndSelf();
Compilation\ControlFlowGraphVerifier.cs (1)
577conditional.WhenNotNull.DescendantNodesAndSelf().
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (1)
156For Each node In container.DescendantNodesAndSelf()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
229Dim descendentExpressions = expression.DescendantNodesAndSelf().OfType(Of ExpressionSyntax).Where(Function(e) span.Contains(e.Span)).ToSet()
Microsoft.CodeAnalysis.VisualBasic.Features (4)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (1)
161Dim unaryExpression = TryCast(handlerStatement.DelegateExpression.DescendantNodesAndSelf().Where(Function(n) n.IsKind(SyntaxKind.AddressOfExpression)).FirstOrDefault, UnaryExpressionSyntax)
Diagnostics\Analyzers\VisualBasicSimplifyTypeNamesDiagnosticAnalyzer.vb (1)
39Debug.Assert(context.CodeBlock.DescendantNodesAndSelf().Contains(root))
ExtractMethod\Extensions.vb (2)
228Return node.DescendantNodesAndSelf().Any(Function(n) TypeOf n Is FieldInitializerSyntax) 242Return node.DescendantNodesAndSelf().Any(predicate)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (4)
Compilation\GetSemanticInfoBrokenCodeTests.vb (3)
494For Each node In node.DescendantNodesAndSelf() 500Return node.DescendantNodesAndSelf(descendIntoTrivia:=True).OfType(Of ExpressionSyntax)() 504Return node.DescendantNodesAndSelf().OfType(Of ExecutableStatementSyntax)()
Compilation\SemanticModelAPITests.vb (1)
4132Dim newSyntaxMemberAccess = newSyntax.DescendantNodesAndSelf().OfType(Of MemberAccessExpressionSyntax)().
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (2)
TestSyntaxNodes.vb (2)
2444Dim nodes = statement.DescendantNodesAndSelf().ToList() 2449nodes = statement.DescendantNodesAndSelf(descendIntoTrivia:=True).ToList()
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (1)
156For Each node In container.DescendantNodesAndSelf()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
229Dim descendentExpressions = expression.DescendantNodesAndSelf().OfType(Of ExpressionSyntax).Where(Function(e) span.Contains(e.Span)).ToSet()
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.vb (1)
52root = root.ReplaceNodes(root.DescendantNodesAndSelf().OfType(Of TypeSyntax)(),
Microsoft.CodeAnalysis.Workspaces (17)
Rename\Renamer.RenameSymbolDocumentAction.cs (1)
74var typeDeclarations = syntaxRoot.DescendantNodesAndSelf(n => !syntaxFacts.IsMethodBody(n)).Where(syntaxFacts.IsTypeDeclaration);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
79node.DescendantNodesAndSelf(n => n != previous && n.Span.IntersectsWith(span) && !span.Contains(n.Span))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (12)
261Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 263Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 285Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 287Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 297Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 299Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 307Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 309Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 319Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 321Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (3)
56var nodes = root.DescendantNodesAndSelf(OverlapsWithSpan).Where(OverlapsWithSpan); 155var first = root.DescendantNodesAndSelf().First(x => x.HasAnnotation(annotation)); 156var last = root.DescendantNodesAndSelf().Last(x => x.HasAnnotation(annotation));
Microsoft.Interop.SourceGeneration (1)
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (1)
414originalTypeSyntax.DescendantNodesAndSelf().OfType<TypeSyntax>().Where(t => t.IsEquivalentTo(marshalInfo.PlaceholderTypeParameter.Syntax)),
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (1)
116.DescendantNodesAndSelf()
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (1)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (1)
130DescendantNodesAndSelf().