47 references to WithLeadingTrivia
Microsoft.CodeAnalysis (3)
Syntax\SyntaxNodeExtensions.cs (2)
375return node.WithLeadingTrivia((IEnumerable<SyntaxTrivia>?)null); 385return node.WithLeadingTrivia((IEnumerable<SyntaxTrivia>?)trivia);
Syntax\SyntaxNodeOrToken.cs (1)
406return _nodeOrParent.WithLeadingTrivia(trivia);
Microsoft.CodeAnalysis.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
709return node.WithLeadingTrivia(trivia.Concat(node.GetLeadingTrivia())); 761return node.WithLeadingTrivia(leadingTrivia).WithTrailingTrivia(trailingTrivia);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
93return node.WithLeadingTrivia(leadingTriviaToKeep.Skip(index)); 163return node.WithLeadingTrivia(leadingTriviaToKeep.Skip(index));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
349.WithLeadingTrivia(leadingTrivia)
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
714declarationStatement = declarationStatement.WithLeadingTrivia(leadingTrivia.Skip(lastDirectiveIndex + 1));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
175return node.WithLeadingTrivia(leadingTrivia);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (1)
90parameterDeclaration.WithLeadingTrivia(firstLeadingIndentation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (1)
45var newFirstUsing = newImports[0].WithLeadingTrivia(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
168declarationStatement = declarationStatement.WithLeadingTrivia(
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (2)
882.WithLeadingTrivia(leadingTrivia.Concat(node.GetLeadingTrivia()).FilterComments(addElasticMarker: false)) 889.WithLeadingTrivia(node.GetLeadingTrivia().FilterComments(addElasticMarker: true));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (1)
186=> node.WithLeadingTrivia(node.GetLeadingTrivia().SkipWhile(t => t.Kind() == SyntaxKind.EndOfLineTrivia));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (1)
111editor.ReplaceNode(node, node.WithLeadingTrivia(finalLeadingTrivia));
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (1)
71(current, _) => current.WithLeadingTrivia(current.GetLeadingTrivia().Concat(throwStatement.GetTrailingTrivia())));
Microsoft.CodeAnalysis.CSharp.Features (5)
ChangeSignature\CSharpChangeSignatureService.cs (1)
315updatedNode = updatedNode.WithLeadingTrivia(updatedLeadingTrivia);
DocumentationComments\DocCommentConverter.cs (1)
73node = node.WithLeadingTrivia(newLeadingTrivia);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (1)
495nextStatement.WithLeadingTrivia(nextStatementLeading.Skip(nextStatementLeading.IndexOf(precedingEndOfLine) + 1)),
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (1)
111editor.ReplaceNode(node, node.WithLeadingTrivia(finalLeadingTrivia));
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (1)
71(current, _) => current.WithLeadingTrivia(current.GetLeadingTrivia().Concat(throwStatement.GetTrailingTrivia())));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Syntax\SyntaxNodeTests.cs (1)
1485c = c.WithLeadingTrivia(c.GetLeadingTrivia().Concat(c.GetLeadingTrivia()));
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (2)
882.WithLeadingTrivia(leadingTrivia.Concat(node.GetLeadingTrivia()).FilterComments(addElasticMarker: false)) 889.WithLeadingTrivia(node.GetLeadingTrivia().FilterComments(addElasticMarker: true));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\UsingsAndExternAliasesOrganizer.cs (1)
186=> node.WithLeadingTrivia(node.GetLeadingTrivia().SkipWhile(t => t.Kind() == SyntaxKind.EndOfLineTrivia));
Microsoft.CodeAnalysis.Features (2)
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (1)
496newTrailing[0] = newTrailing[0].WithLeadingTrivia(leadingTrivia);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
714declarationStatement = declarationStatement.WithLeadingTrivia(leadingTrivia.Skip(lastDirectiveIndex + 1));
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
69Dim result = newStatement.WithLeadingTrivia(totalTrivia).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseObjectInitializer\VisualBasicUseObjectInitializerCodeFixProvider.vb (1)
71Return newStatement.WithLeadingTrivia(totalTrivia)
Microsoft.CodeAnalysis.VisualBasic.Features (3)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
296vbnode = vbnode.WithLeadingTrivia(updatedLeadingTrivia)
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
69Dim result = newStatement.WithLeadingTrivia(totalTrivia).WithAdditionalAnnotations(Formatter.Annotation)
src\Analyzers\VisualBasic\CodeFixes\UseObjectInitializer\VisualBasicUseObjectInitializerCodeFixProvider.vb (1)
71Return newStatement.WithLeadingTrivia(totalTrivia)
Microsoft.CodeAnalysis.Workspaces (11)
Editing\SyntaxGenerator.cs (1)
1479.WithLeadingTrivia(node.GetLeadingTrivia().Concat(changedNode.GetLeadingTrivia()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
709return node.WithLeadingTrivia(trivia.Concat(node.GetLeadingTrivia())); 761return node.WithLeadingTrivia(leadingTrivia).WithTrailingTrivia(trailingTrivia);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
93return node.WithLeadingTrivia(leadingTriviaToKeep.Skip(index)); 163return node.WithLeadingTrivia(leadingTriviaToKeep.Skip(index));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
349.WithLeadingTrivia(leadingTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
175return node.WithLeadingTrivia(leadingTrivia);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (1)
90parameterDeclaration.WithLeadingTrivia(firstLeadingIndentation));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (1)
45var newFirstUsing = newImports[0].WithLeadingTrivia(
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (2)
143newNextStatement.WithAdditionalAnnotations(Formatter.Annotation).WithLeadingTrivia( 168declarationStatement = declarationStatement.WithLeadingTrivia(
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\CSharpCodeModelService.cs (2)
1325return memberDeclaration.WithLeadingTrivia(leadingTriviaList); 1447return memberDeclaration.WithLeadingTrivia(leadingTriviaList);