30 references to GetTrailingTrivia
Microsoft.CodeAnalysis (3)
Syntax\SyntaxDiffer.cs (2)
448foreach (var tr in node1.GetTrailingTrivia()) 463foreach (var tr in node2.GetTrailingTrivia())
Syntax\SyntaxNodeOrToken.cs (1)
376public bool HasTrailingTrivia => this.GetTrailingTrivia().Count > 0;
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeOrTokenExtensions.cs (1)
54=> nodesOrTokens.SelectMany(nodeOrToken => nodeOrToken.GetLeadingTrivia().Concat(nodeOrToken.GetTrailingTrivia())).ToArray();
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
858var trivia = nodeOrToken.GetTrailingTrivia();
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
81if (addLineBreak && item.GetTrailingTrivia() is not [.., (kind: SyntaxKind.EndOfLineTrivia)])
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
43var trailingTrivia = lastMember.GetTrailingTrivia();
Microsoft.CodeAnalysis.CSharp.Features (3)
ConvertAnonymousType\CSharpConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
64.WithAppendedTrailingTrivia(list[^1].GetTrailingTrivia()))
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
858var trivia = nodeOrToken.GetTrailingTrivia();
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
81if (addLineBreak && item.GetTrailingTrivia() is not [.., (kind: SyntaxKind.EndOfLineTrivia)])
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (10)
Syntax\SyntaxNodeTests.cs (10)
3768Assert.Equal(1, nodeOrToken.GetTrailingTrivia().Count); 3769Assert.Equal(0, nodeOrToken.GetTrailingTrivia().Span.Length); // zero-width elastic trivia 3777Assert.Equal(1, nodeOrToken.GetTrailingTrivia().Count); 3778Assert.Equal(0, nodeOrToken.GetTrailingTrivia().Span.Length); // zero-width elastic trivia 3785Assert.Equal(0, nodeOrToken.GetTrailingTrivia().Count); 3792Assert.Equal(0, nodeOrToken.GetTrailingTrivia().Count); 3800Assert.Equal(1, nodeOrToken.GetTrailingTrivia().Count); 3801Assert.Equal(2, nodeOrToken.GetTrailingTrivia().Span.Length); // zero-width elastic trivia 3809Assert.Equal(1, nodeOrToken.GetTrailingTrivia().Count); 3810Assert.Equal(2, nodeOrToken.GetTrailingTrivia().Span.Length); // zero-width elastic trivia
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (1)
43var trailingTrivia = lastMember.GetTrailingTrivia();
Microsoft.CodeAnalysis.VisualBasic (1)
Syntax\VisualBasicSyntaxNode.vb (1)
222ProcessTrivia(tree, errorList, nodesToProcess, nodeOrToken.GetTrailingTrivia())
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (1)
133For Each trivia In child.GetTrailingTrivia.Reverse
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (1)
TestSyntaxNodes.vb (1)
2029Dim trivia = tk_nonzero1.GetTrailingTrivia()
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (4)
ParserTestUtilities.vb (4)
146For Each trivia In token.GetTrailingTrivia() 688For Each trailingTrivia In tk.GetTrailingTrivia() 715For Each tr In node.GetTrailingTrivia() 737If TryFindNodeOrTokenInTrivia(tk.GetTrailingTrivia(), kind, occurrence, foundNode) Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (1)
133For Each trivia In child.GetTrailingTrivia.Reverse
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeOrTokenExtensions.cs (1)
54=> nodesOrTokens.SelectMany(nodeOrToken => nodeOrToken.GetLeadingTrivia().Concat(nodeOrToken.GetTrailingTrivia())).ToArray();