24 references to GetLeadingTrivia
Microsoft.CodeAnalysis (3)
Syntax\SyntaxDiffer.cs (2)
442foreach (var tr in node1.GetLeadingTrivia()) 454foreach (var tr in node2.GetLeadingTrivia())
Syntax\SyntaxNodeOrToken.cs (1)
352public bool HasLeadingTrivia => this.GetLeadingTrivia().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.Features (1)
ConvertAnonymousType\CSharpConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
63.WithAppendedTrailingTrivia(list[^1].GetLeadingTrivia())
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (10)
Syntax\SyntaxNodeTests.cs (10)
3765Assert.Equal(1, nodeOrToken.GetLeadingTrivia().Count); 3766Assert.Equal(0, nodeOrToken.GetLeadingTrivia().Span.Length); // zero-width elastic trivia 3774Assert.Equal(1, nodeOrToken.GetLeadingTrivia().Count); 3775Assert.Equal(0, nodeOrToken.GetLeadingTrivia().Span.Length); // zero-width elastic trivia 3783Assert.Equal(0, nodeOrToken.GetLeadingTrivia().Count); 3790Assert.Equal(0, nodeOrToken.GetLeadingTrivia().Count); 3797Assert.Equal(1, nodeOrToken.GetLeadingTrivia().Count); 3798Assert.Equal(1, nodeOrToken.GetLeadingTrivia().Span.Length); // zero-width elastic trivia 3806Assert.Equal(1, nodeOrToken.GetLeadingTrivia().Count); 3807Assert.Equal(1, nodeOrToken.GetLeadingTrivia().Span.Length); // zero-width elastic trivia
Microsoft.CodeAnalysis.VisualBasic (1)
Syntax\VisualBasicSyntaxNode.vb (1)
221ProcessTrivia(tree, errorList, nodesToProcess, nodeOrToken.GetLeadingTrivia())
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (1)
139For Each trivia In child.GetLeadingTrivia.Reverse
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (5)
ParserTestUtilities.vb (5)
130For Each trivia In token.GetLeadingTrivia() 345Dim trivia = node.GetLeadingTrivia() 679For Each leadingTrivia In tk.GetLeadingTrivia() 709For Each tr In node.GetLeadingTrivia() 734If TryFindNodeOrTokenInTrivia(tk.GetLeadingTrivia(), kind, occurrence, foundNode) Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (1)
139For Each trivia In child.GetLeadingTrivia.Reverse
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeOrTokenExtensions.cs (1)
54=> nodesOrTokens.SelectMany(nodeOrToken => nodeOrToken.GetLeadingTrivia().Concat(nodeOrToken.GetTrailingTrivia())).ToArray();