65 references to DescendantTrivia
AnalyzerRunner (1)
Program.cs (1)
214var numberOfTrivia = root.DescendantTrivia(descendIntoTrivia: true).Count();
Microsoft.CodeAnalysis (4)
Syntax\SyntaxNode.cs (3)
1317return this.DescendantTrivia(n => n.ContainsAnnotations, descendIntoTrivia: true) 1326return this.DescendantTrivia(n => n.ContainsAnnotations, descendIntoTrivia: true) 1335return this.DescendantTrivia(n => n.ContainsAnnotations, descendIntoTrivia: true)
Syntax\SyntaxNodeOrToken.cs (1)
871foreach (var trivia in node.DescendantTrivia(node => node.ContainsDirectives, descendIntoTrivia: true))
Microsoft.CodeAnalysis.CodeStyle (1)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
241foreach (var trivia in root.DescendantTrivia(node => node.ContainsDirectives))
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (1)
36var endOfLine = root.DescendantTrivia().FirstOrNull((trivia, syntaxFacts) => syntaxFacts.IsEndOfLineTrivia(trivia), syntaxFacts) ?? syntaxFacts.ElasticCarriageReturnLineFeed;
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (1)
112foreach (var t in structure.DescendantTrivia())
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (5)
Emit\NumericIntPtrTests.cs (5)
11172var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 11195var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 11223var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 11248var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 11293var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (5)
RefReadonlyParameterTests.cs (2)
7102var docComment = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single(); 7130var docComment = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single();
Semantics\PrimaryConstructorTests.cs (1)
6090var doc = tree.GetRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single();
Semantics\RecordTests.cs (2)
28186var doc = tree.GetRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().First(); 28343var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Microsoft.CodeAnalysis.CSharp.Features (1)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
69if (_source.DescendantTrivia().Any(trivia => trivia is (kind:
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Diagnostics\Suppression\SuppressionTests.cs (1)
1106foreach (var trivia in context.Node.DescendantTrivia().Where(t => t.Kind() is SyntaxKind.SingleLineCommentTrivia or SyntaxKind.MultiLineCommentTrivia))
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (10)
Semantics\NativeIntegerTests.cs (6)
15316var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15337var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15360var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15388var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15411var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 15441var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Semantics\RecordStructTests.cs (4)
3242var doc = tree.GetRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>().Single(); 3284var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 3332var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>(); 3383var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
DocumentationComments\CrefTests.cs (2)
6333var nonCrefPosition = tree.GetRoot().DescendantTrivia().Single(t => t.IsKind(SyntaxKind.SingleLineDocumentationCommentTrivia)).SpanStart; 6618var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
DocumentationComments\ParameterTests.cs (1)
841var docComments = tree.GetCompilationUnitRoot().DescendantTrivia().Select(trivia => trivia.GetStructure()).OfType<DocumentationCommentTriviaSyntax>();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (10)
LexicalAndXml\PreprocessorTests.cs (1)
1450Assert.True(node.DescendantTrivia().All(trivia => trivia.Width > 0));
Syntax\StructuredTriviaTests.cs (2)
167var trivia = tree.GetCompilationUnitRoot().DescendantTrivia().Single(t => t.Kind() == SyntaxKind.SingleLineDocumentationCommentTrivia); 183var trivia = tree.GetCompilationUnitRoot().DescendantTrivia().Single(t => t.Kind() == SyntaxKind.MultiLineDocumentationCommentTrivia);
Syntax\SyntaxNodeTests.cs (7)
629var list = expr.DescendantTrivia().ToList(); 646var list = expr.DescendantTrivia(descendIntoTrivia: true).ToList(); 2382var deepTrivia = expr.GetDirectives().SelectMany(d => d.DescendantTrivia().Where(tr => tr.Kind() == SyntaxKind.WhitespaceTrivia)).ToList(); 2406var trivia = expr.DescendantTrivia().Where(tr => tr.IsKind(SyntaxKind.WhitespaceTrivia)).ToList(); 3496Assert.Equal(1, node.DescendantTrivia().Count()); 3507Assert.Equal(1, node.DescendantTrivia().Count()); 3530var trivia = root.DescendantTrivia().First();
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (1)
112foreach (var t in structure.DescendantTrivia())
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
Formatting\FormattingTriviaTests.cs (1)
1745tree = tree.ReplaceTrivia(tree.DescendantTrivia().Where(tr => tr.IsKind(SyntaxKind.EndOfLineTrivia)), (o, r) => SyntaxFactory.ElasticMarker);
Microsoft.CodeAnalysis.Features (4)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (3)
139(trivia.HasStructure && fixer.IsEndOfLine(trivia.GetStructure().DescendantTrivia().FirstOrDefault())); 145(trivia.HasStructure && fixer.IsEndOfLine(trivia.GetStructure().DescendantTrivia().LastOrDefault())); 151(trivia.HasStructure && trivia.GetStructure().DescendantTrivia().Any(fixer.IsEndOfLine));
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
241foreach (var trivia in root.DescendantTrivia(node => node.ContainsDirectives))
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (1)
205var comments = context.Tree.GetRoot().DescendantTrivia()
Microsoft.CodeAnalysis.VisualBasic.Features (3)
ConvertForEachToFor\VisualBasicConvertForEachToForCodeRefactoringProvider.vb (1)
29Return Not foreachNode.DescendantTrivia().Any(Function(t) t.IsKind(SyntaxKind.ColonTrivia))
TaskList\VisualBasicTaskListService.vb (2)
28Dim commentTrivia = trivia.GetStructure().DescendantTrivia().First(Function(t) t.RawKind = SyntaxKind.CommentTrivia) 106trivia.GetStructure().DescendantTrivia().Any(Function(t) t.RawKind = SyntaxKind.CommentTrivia)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (9)
Syntax\ManualTests.vb (2)
108Assert.Equal(1, node.DescendantTrivia().Count()) 118Assert.Equal(1, node.DescendantTrivia().Count())
Syntax\SyntaxTokenFactoryTests.vb (3)
184Dim trivia = (From tr In expr.DescendantTrivia() 197Dim trivia = (From tr In expr.DescendantTrivia() 209Dim tr = expr.DescendantTrivia().First()
TestSyntaxNodes.vb (4)
1584Dim trivia = expr.DescendantTrivia().Where(Function(tr) tr.IsKind(SyntaxKind.WhitespaceTrivia)).ToList() 2480Dim list = expr.DescendantTrivia().ToList() 2496Dim list = expr.DescendantTrivia(descendIntoTrivia:=True).ToList() 2527Dim trivia = root.DescendantTrivia().First()
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
Formatting\FormattingTests.vb (1)
4595tree = tree.ReplaceTrivia(tree.DescendantTrivia().Where(Function(tr) tr.IsKind(SyntaxKind.EndOfLineTrivia)), Function(o, r) SyntaxFactory.ElasticMarker)
Microsoft.CodeAnalysis.Workspaces (2)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
388.DescendantTrivia(descendIntoTrivia: true)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (1)
36var endOfLine = root.DescendantTrivia().FirstOrNull((trivia, syntaxFacts) => syntaxFacts.IsEndOfLineTrivia(trivia), syntaxFacts) ?? syntaxFacts.ElasticCarriageReturnLineFeed;