46 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)
91return node.WithLeadingTrivia(leadingTriviaToKeep.Skip(index)); 161return 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)
716declarationStatement = 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)
167declarationStatement = 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)
177=> node.WithLeadingTrivia(node.GetLeadingTrivia().SkipWhile(t => t.Kind() == SyntaxKind.EndOfLineTrivia));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (1)
71(current, _) => current.WithLeadingTrivia(current.GetLeadingTrivia().Concat(throwStatement.GetTrailingTrivia())));
Microsoft.CodeAnalysis.CSharp.Features (6)
ChangeSignature\CSharpChangeSignatureService.cs (1)
313updatedNode = updatedNode.WithLeadingTrivia(updatedLeadingTrivia);
DocumentationComments\DocCommentConverter.cs (1)
73node = node.WithLeadingTrivia(newLeadingTrivia);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
440newStatement.WithLeadingTrivia(nextStatementLeading.Take(endOfLineIndex)), 441nextStatement.WithLeadingTrivia(nextStatementLeading.Skip(endOfLineIndex)),
ReplacePropertyWithMethods\CSharpReplacePropertyWithMethodsService.cs (1)
234return methodDeclaration.WithLeadingTrivia(leadingTrivia.Select(trivia => ConvertTrivia(trivia, documentationCommentRewriter)));
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)
1462c = 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)
177=> 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)
716declarationStatement = 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)
56Return newStatement.WithLeadingTrivia(totalTrivia)
Microsoft.CodeAnalysis.VisualBasic.Features (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)
56Return newStatement.WithLeadingTrivia(totalTrivia)
Microsoft.CodeAnalysis.Workspaces (11)
Editing\SyntaxGenerator.cs (1)
1480.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)
91return node.WithLeadingTrivia(leadingTriviaToKeep.Skip(index)); 161return 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)
142newNextStatement.WithAdditionalAnnotations(Formatter.Annotation).WithLeadingTrivia( 167declarationStatement = declarationStatement.WithLeadingTrivia(
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\CSharpCodeModelService.cs (2)
1325return memberDeclaration.WithLeadingTrivia(leadingTriviaList); 1447return memberDeclaration.WithLeadingTrivia(leadingTriviaList);