202 references to WithLeadingTrivia
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
605logMethod = logMethod.WithLeadingTrivia(line);
Microsoft.AspNetCore.App.CodeFixes (2)
Kestrel\ListenOnIPv6AnyFixer.cs (1)
69.WithLeadingTrivia(invocationExpressionSyntax.GetLeadingTrivia())
WebApplicationBuilderFixer.cs (1)
111.NormalizeWhitespace().WithLeadingTrivia(indentation);
Microsoft.CodeAnalysis (1)
Syntax\SyntaxNodeExtensions.cs (1)
325return syntax.WithLeadingTrivia(node.GetLeadingTrivia()).WithTrailingTrivia(node.GetTrailingTrivia());
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
980return node.WithLeadingTrivia(other.GetLeadingTriviaIncludingMissingTokens());
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (2)
173return root.WithLeadingTrivia(newHeaderTrivia); 197return root.WithLeadingTrivia(newTrivia);
src\Analyzers\Core\CodeFixes\QualifyMemberAccess\AbstractQualifyMemberAccessCodeFixProvider.cs (1)
50.WithLeadingTrivia(node.GetLeadingTrivia());
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
222newWhenTrueStatement = newWhenTrueStatement.WithLeadingTrivia(ifStatement.GetLeadingTrivia());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (1)
74newImports[0] = newImports[0].WithLeadingTrivia(originalFirstUsing.GetLeadingTrivia());
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
196? returnStatement.Expression.WithLeadingTrivia(returnStatement.GetLeadingTrivia())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
885.WithLeadingTrivia(expression.GetLeadingTrivia())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberAccessExpressionSyntaxExtensions.cs (1)
18.WithLeadingTrivia(GetLeadingTriviaForSimplifiedMemberAccess(memberAccess))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\StatementSyntaxExtensions.cs (1)
14=> statement.WithLeadingTrivia(statement.GetLeadingTrivia().WithoutLeadingBlankLines());
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (19)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
101.WithLeadingTrivia(leadingTrivia);
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (1)
84return elementNode.WithLeadingTrivia(
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
418var newCompilationUnit = syntaxRoot.WithLeadingTrivia(leadingTrivia);
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
129=> node.WithLeadingTrivia(node.GetLeadingTrivia().Insert(0, trivia));
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
79newWhenTrueStatement = newWhenTrueStatement.WithLeadingTrivia(ifStatement.GetLeadingTrivia());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (13)
790.WithLeadingTrivia(delegateDeclarationSyntax.ReturnType.GetLeadingTrivia()) 798.WithLeadingTrivia(methodDeclarationSyntax.ReturnType.GetLeadingTrivia()) 806.WithLeadingTrivia(operatorDeclarationSyntax.ReturnType.GetLeadingTrivia()) 814.WithLeadingTrivia(conversionOperatorDeclarationSyntax.Type.GetLeadingTrivia()) 822.WithLeadingTrivia(propertyDeclaration.Type.GetLeadingTrivia()) 830.WithLeadingTrivia(eventDeclarationSyntax.Type.GetLeadingTrivia()) 838.WithLeadingTrivia(indexerDeclarationSyntax.Type.GetLeadingTrivia()) 850.WithLeadingTrivia(parameterSyntax.Type.GetLeadingTrivia()) 864.WithLeadingTrivia(incompleteMemberSyntax.Type.GetLeadingTrivia()) 874.WithLeadingTrivia(arrayTypeSyntax.ElementType.GetLeadingTrivia()) 882.WithLeadingTrivia(pointerTypeSyntax.ElementType.GetLeadingTrivia()) 890.WithLeadingTrivia(variableDeclarationSyntax.Type.GetLeadingTrivia()) 898.WithLeadingTrivia(catchDeclarationSyntax.Type.GetLeadingTrivia())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
85currentUsings[nextIndex] = nextUsing.WithLeadingTrivia(leadingTrivia);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
81.WithLeadingTrivia(leadingTrivia);
Microsoft.CodeAnalysis.CSharp.Features (26)
ChangeSignature\CSharpChangeSignatureService.cs (1)
383.WithLeadingTrivia(lambda.Parameter.GetLeadingTrivia())
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (1)
174return attributeList.WithLeadingTrivia(leadingTrivia);
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
133method = method.WithoutLeadingTrivia().WithAttributeLists(localFunction.AttributeLists).WithLeadingTrivia(method.GetLeadingTrivia());
ConvertCast\CSharpConvertDirectCastToTryCastCodeRefactoringProvider.cs (2)
56typeNode = typeNode.WithLeadingTrivia(castExpression.OpenParenToken.TrailingTrivia); 64.WithLeadingTrivia(newLeadingTrivia)
ConvertCast\CSharpConvertTryCastToDirectCastCodeRefactoringProvider.cs (1)
63.WithLeadingTrivia(newLeadingTrivia)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
131statements.Add(BreakStatement().WithLeadingTrivia(block.CloseBraceToken.LeadingTrivia));
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider_DocumentationComments.cs (2)
69return typeDeclaration.WithLeadingTrivia(updatedTriviaList); 74return typeDeclaration.WithLeadingTrivia(triviaList.Replace(trivia, updatedTrivia));
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (2)
141statements.Add(FixupComments(statement.WithLeadingTrivia(commentsToPreserve))); 168return node.WithLeadingTrivia(leadingTrivia);
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
205expressionBody: otherMethod.ExpressionBody).WithLeadingTrivia(otherMethod.GetLeadingTrivia()));
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
207newNode = newNode.WithLeadingTrivia(newNode.GetLeadingTrivia().Add(Whitespace(indentation)));
Copilot\CSharpCopilotCodeFixProvider.cs (1)
129.WithLeadingTrivia(memberDeclaration.HasLeadingTrivia ? memberDeclaration.GetLeadingTrivia() : method.GetLeadingTrivia())
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
78.WithLeadingTrivia(fieldSyntax.GetLeadingTrivia())
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
460.WithLeadingTrivia(newLeadingTrivia));
FullyQualify\CSharpFullyQualifyService.cs (2)
46var newName = simpleName.WithLeadingTrivia(SyntaxTriviaList.Empty); 49.WithLeadingTrivia(leadingTrivia);
IntroduceVariable\CSharpIntroduceVariableService.Rewriter.cs (1)
34.WithLeadingTrivia(expression.GetLeadingTrivia())
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
235.WithLeadingTrivia(leadingTrivia) 494newStatement.WithLeadingTrivia(nextStatementLeading).WithTrailingTrivia(precedingEndOfLine),
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (1)
101.WithLeadingTrivia(leadingTrivia);
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (1)
84return elementNode.WithLeadingTrivia(
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
418var newCompilationUnit = syntaxRoot.WithLeadingTrivia(leadingTrivia);
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
129=> node.WithLeadingTrivia(node.GetLeadingTrivia().Insert(0, trivia));
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (1)
79newWhenTrueStatement = newWhenTrueStatement.WithLeadingTrivia(ifStatement.GetLeadingTrivia());
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Syntax\SyntaxDiffingTests.cs (2)
317.WithLeadingTrivia(leadingTrivia); 379.WithLeadingTrivia(leadingTrivia);
Microsoft.CodeAnalysis.CSharp.Workspaces (40)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
2235.WithLeadingTrivia(lambda.GetLeadingTrivia())
Simplification\CSharpSimplificationService.Expander.cs (11)
267.WithLeadingTrivia(node.GetLeadingTrivia()); 336.WithLeadingTrivia(node.GetLeadingTrivia())) 403.WithLeadingTrivia(SyntaxTriviaList.Empty)) 404.WithLeadingTrivia(node.GetLeadingTrivia()) 411rewrittenname).WithLeadingTrivia(node.GetLeadingTrivia()) 708.WithLeadingTrivia(identifiersLeadingTrivia)); 920.WithLeadingTrivia(rewrittenNode.GetLeadingTrivia())); 945.WithLeadingTrivia(rewrittenNode.GetLeadingTrivia()) 998result = result.WithLeadingTrivia(leadingTrivia); 1109.WithLeadingTrivia(thisExpression.GetFirstToken().LeadingTrivia); 1114var thisArgument = Argument(thisExpression).WithLeadingTrivia(SyntaxTriviaList.Empty);
Simplification\Reducers\CSharpExtensionMethodReducer.cs (1)
105newMemberAccess = newMemberAccess.WithLeadingTrivia(node.GetLeadingTrivia());
Simplification\Reducers\CSharpVarReducer.Rewriter.cs (1)
48.WithLeadingTrivia(typeSyntax.GetLeadingTrivia())
Simplification\Simplifiers\NameSimplifier.cs (6)
89.WithLeadingTrivia(genericName.GetLeadingTrivia()) 294.WithLeadingTrivia(name.GetLeadingTrivia()) 313.WithLeadingTrivia(name.GetLeadingTrivia()); 327replacementNode = ((QualifiedNameSyntax)name).Right.WithLeadingTrivia(name.GetLeadingTrivia()); 527.WithLeadingTrivia(name.GetLeadingTrivia()); 532.WithLeadingTrivia(name.GetLeadingTrivia());
Simplification\Simplifiers\QualifiedCrefSimplifier.cs (1)
94replacement = replacement.WithLeadingTrivia(crefSyntax.GetLeadingTrivia());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
196? returnStatement.Expression.WithLeadingTrivia(returnStatement.GetLeadingTrivia())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
885.WithLeadingTrivia(expression.GetLeadingTrivia())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\MemberAccessExpressionSyntaxExtensions.cs (1)
18.WithLeadingTrivia(GetLeadingTriviaForSimplifiedMemberAccess(memberAccess))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\StatementSyntaxExtensions.cs (1)
14=> statement.WithLeadingTrivia(statement.GetLeadingTrivia().WithoutLeadingBlankLines());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (13)
790.WithLeadingTrivia(delegateDeclarationSyntax.ReturnType.GetLeadingTrivia()) 798.WithLeadingTrivia(methodDeclarationSyntax.ReturnType.GetLeadingTrivia()) 806.WithLeadingTrivia(operatorDeclarationSyntax.ReturnType.GetLeadingTrivia()) 814.WithLeadingTrivia(conversionOperatorDeclarationSyntax.Type.GetLeadingTrivia()) 822.WithLeadingTrivia(propertyDeclaration.Type.GetLeadingTrivia()) 830.WithLeadingTrivia(eventDeclarationSyntax.Type.GetLeadingTrivia()) 838.WithLeadingTrivia(indexerDeclarationSyntax.Type.GetLeadingTrivia()) 850.WithLeadingTrivia(parameterSyntax.Type.GetLeadingTrivia()) 864.WithLeadingTrivia(incompleteMemberSyntax.Type.GetLeadingTrivia()) 874.WithLeadingTrivia(arrayTypeSyntax.ElementType.GetLeadingTrivia()) 882.WithLeadingTrivia(pointerTypeSyntax.ElementType.GetLeadingTrivia()) 890.WithLeadingTrivia(variableDeclarationSyntax.Type.GetLeadingTrivia()) 898.WithLeadingTrivia(catchDeclarationSyntax.Type.GetLeadingTrivia())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (2)
85currentUsings[nextIndex] = nextUsing.WithLeadingTrivia(leadingTrivia); 116currentUsings[i] = currentUsing.WithLeadingTrivia(currentUsingLeadingTrivia.WithoutLeadingBlankLines());
Microsoft.CodeAnalysis.Features (7)
ChangeSignature\AbstractChangeSignatureService.cs (2)
1007updatedNodeList.Add(permutedParamNodes[index].WithLeadingTrivia(content.GetLeadingTrivia()).WithTrailingTrivia(content.GetTrailingTrivia())); 1017newDocComments = newDocComments.WithLeadingTrivia(structuredTrivia.GetLeadingTrivia()).WithTrailingTrivia(structuredTrivia.GetTrailingTrivia());
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
48.WithLeadingTrivia(ifStatement.GetLeadingTrivia())
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
93localStatement = localStatement.WithLeadingTrivia(expression.GetLeadingTrivia());
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (1)
396newIdentifierName = newIdentifierName.WithLeadingTrivia(_identifierName.GetLeadingTrivia());
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (2)
173return root.WithLeadingTrivia(newHeaderTrivia); 197return root.WithLeadingTrivia(newTrivia);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (9)
src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (1)
103.WithLeadingTrivia(methodBlock.EndBlockStatement.GetLeadingTrivia()) _
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (1)
121newFunctionNode = methodStatementNode.WithLeadingTrivia(CType(Nothing, SyntaxTriviaList))
src\Analyzers\VisualBasic\CodeFixes\MakeMethodAsynchronous\VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (2)
145Return node.WithSubOrFunctionHeader(header).WithLeadingTrivia(node.GetLeadingTrivia()) 150Return node.WithSubOrFunctionHeader(header).WithLeadingTrivia(node.GetLeadingTrivia())
src\Analyzers\VisualBasic\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.vb (2)
40Return node.WithSubOrFunctionHeader(header).WithLeadingTrivia(node.GetLeadingTrivia()) 45Return node.WithSubOrFunctionHeader(header).WithLeadingTrivia(node.GetLeadingTrivia())
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (2)
111.WithLeadingTrivia(leadingTrivia) _ 119.WithLeadingTrivia(leadingTrivia) _
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\MemberAccessExpressionSyntaxExtensions.vb (1)
17.WithLeadingTrivia(GetLeadingTriviaForSimplifiedMemberAccess(memberAccess)) _
Microsoft.CodeAnalysis.VisualBasic.Features (20)
CodeFixes\CorrectNextControlVariable\CorrectNextControlVariableCodeFixProvider.vb (1)
63WithLeadingTrivia(nodeToReplace.GetLeadingTrivia()).
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (2)
204.WithLeadingTrivia(exitStatement.GetLeadingTrivia()) _ 223.WithLeadingTrivia(continueStatement.GetLeadingTrivia()) _
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.AddKeywordAction.vb (1)
69newNode = newNode.WithLeadingTrivia(trivia)
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (4)
137attributeStatement = attributeStatement.WithLeadingTrivia(attributeStatement.GetLeadingTrivia.Add(SyntaxFactory.ElasticCarriageReturnLineFeed)) 148Return compilationRoot.AddAttributes(attributeStatement).WithLeadingTrivia(leadingTrivia) 250.WithLeadingTrivia(pragmaWarning.GetLeadingTrivia) _ 259.WithLeadingTrivia(pragmaWarning.GetLeadingTrivia) _
ConvertForEachToFor\VisualBasicConvertForEachToForCodeRefactoringProvider.vb (1)
108forBlock = forBlock.WithLeadingTrivia(SyntaxFactory.TriviaList())
EncapsulateField\VisualBasicEncapsulateFieldService.vb (1)
59.WithLeadingTrivia(fieldDeclaration.GetLeadingTrivia()) _
FullyQualify\VisualBasicFullyQualifyService.vb (2)
63Dim newName = simpleName.WithLeadingTrivia(CType(Nothing, SyntaxTriviaList)) 66WithLeadingTrivia(leadingTrivia).
IntroduceVariable\VisualBasicIntroduceVariableService.Rewriter.vb (1)
28WithLeadingTrivia(expression.GetLeadingTrivia()).
InvertIf\VisualBasicInvertIfCodeRefactoringProvider.MultiLine.vb (1)
59Dim newEndIfStatement = SyntaxFactory.EndIfStatement().WithLeadingTrivia(ifNode.ElseBlock.GetLeadingTrivia())
src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (1)
103.WithLeadingTrivia(methodBlock.EndBlockStatement.GetLeadingTrivia()) _
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (1)
121newFunctionNode = methodStatementNode.WithLeadingTrivia(CType(Nothing, SyntaxTriviaList))
src\Analyzers\VisualBasic\CodeFixes\MakeMethodAsynchronous\VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (2)
145Return node.WithSubOrFunctionHeader(header).WithLeadingTrivia(node.GetLeadingTrivia()) 150Return node.WithSubOrFunctionHeader(header).WithLeadingTrivia(node.GetLeadingTrivia())
src\Analyzers\VisualBasic\CodeFixes\RemoveAsyncModifier\RemoveAsyncModifierHelpers.vb (2)
40Return node.WithSubOrFunctionHeader(header).WithLeadingTrivia(node.GetLeadingTrivia()) 45Return node.WithSubOrFunctionHeader(header).WithLeadingTrivia(node.GetLeadingTrivia())
Microsoft.CodeAnalysis.VisualBasic.Workspaces (23)
CodeCleanup\AsyncOrIteratorFunctionReturnTypeFixer.vb (1)
205.WithLeadingTrivia(leadingTrivia) _
CodeCleanup\Providers\AddMissingTokensCodeCleanupProvider.vb (1)
265newParamList = newParamList.WithLeadingTrivia(n.ParameterList.GetLeadingTrivia)
Simplification\Reducers\VisualBasicCallReducer.vb (1)
39.WithLeadingTrivia(leading)
Simplification\Simplifiers\ExpressionSimplifier.vb (2)
90.WithLeadingTrivia(memberAccess.GetLeadingTrivia()) 280replacementNode = memberAccess.Expression.WithLeadingTrivia(memberAccess.GetLeadingTrivia())
Simplification\Simplifiers\NameSimplifier.vb (5)
48replacementNode = SyntaxFactory.IdentifierName(genericName.Identifier).WithLeadingTrivia(genericName.GetLeadingTrivia()).WithTrailingTrivia(genericName.GetTrailingTrivia()) 208replacementNode = SyntaxFactory.NullableType(oldType).WithLeadingTrivia(name.GetLeadingTrivia()) 229replacementNode = qualifiedName.Right.WithLeadingTrivia(name.GetLeadingTrivia()) 336replacementNode = name.Left.WithLeadingTrivia(name.GetLeadingTrivia()) 388replacementNode = SyntaxFactory.IdentifierName(newIdentifierToken).WithLeadingTrivia(name.GetLeadingTrivia())
Simplification\VisualBasicSimplificationService.Expander.vb (10)
153newExpressionStatement = newExpressionStatement.WithLeadingTrivia({SyntaxFactory.WhitespaceTrivia(" ")}.ToSyntaxTriviaList()) 156.WithLeadingTrivia(leadingTrivia) _ 255Dim newMemberAccess = SyntaxFactory.SimpleMemberAccessExpression(SyntaxFactory.ParseExpression(containingType), oldMemberAccess.OperatorToken, oldMemberAccess.Name).WithLeadingTrivia(thisExpression.GetFirstToken().LeadingTrivia) 266.WithLeadingTrivia(SyntaxTriviaList.Empty) _ 312WithLeadingTrivia(node.GetLeadingTrivia()) 385WithLeadingTrivia(node.GetLeadingTrivia()). 673.WithLeadingTrivia(identifiersLeadingTrivia) 693.WithLeadingTrivia(newNode.GetLeadingTrivia()) _ 740.WithLeadingTrivia(rewrittenNode.GetLeadingTrivia()) _ 787result = result.WithLeadingTrivia(leadingTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (2)
111.WithLeadingTrivia(leadingTrivia) _ 119.WithLeadingTrivia(leadingTrivia) _
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\MemberAccessExpressionSyntaxExtensions.vb (1)
17.WithLeadingTrivia(GetLeadingTriviaForSimplifiedMemberAccess(memberAccess)) _
Microsoft.CodeAnalysis.Workspaces (4)
Editing\SyntaxGenerator.cs (2)
1066return node.WithLeadingTrivia(RemoveCommentLines(node.GetLeadingTrivia())) 1486replacement.WithLeadingTrivia(original.GetLeadingTrivia().AddRange(replacement.GetLeadingTrivia()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
980return node.WithLeadingTrivia(other.GetLeadingTriviaIncludingMissingTokens());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (1)
74newImports[0] = newImports[0].WithLeadingTrivia(originalFirstUsing.GetLeadingTrivia());
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
SolutionTests\SolutionTests.cs (1)
3997var newRoot = root.WithLeadingTrivia(root.GetLeadingTrivia().Add(CS.SyntaxFactory.Whitespace(" ")));
Microsoft.Interop.SourceGeneration (1)
GeneratedStatements.cs (1)
86statementsToUpdate[0] = firstStatementInStage.WithLeadingTrivia(newLeadingTrivia);
Microsoft.VisualStudio.LanguageServices.CSharp (4)
CodeModel\CSharpCodeModelService.cs (3)
907.WithLeadingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticMarker)) 916.WithLeadingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticMarker)) 3355list = list.WithLeadingTrivia(trivia);
CodeModel\ModifierFlagsExtensions.cs (1)
109member = member.WithLeadingTrivia(SyntaxTriviaList.Empty);
Microsoft.VisualStudio.LanguageServices.VisualBasic (26)
CodeModel\ModifierFlagsExtensions.vb (1)
161.WithLeadingTrivia(leadingTrivia)
CodeModel\VisualBasicCodeModelService.vb (25)
967.WithLeadingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticMarker)) _ 985.WithLeadingTrivia(SyntaxFactory.TriviaList(SyntaxFactory.ElasticMarker)) _ 2978.WithLeadingTrivia(SyntaxTriviaList.Empty) _ 3019.WithLeadingTrivia(leadingTrivia) _ 3031.WithLeadingTrivia(SyntaxTriviaList.Empty) _ 3052.WithLeadingTrivia(leadingTrivia) _ 3069.WithLeadingTrivia(SyntaxTriviaList.Empty) _ 3082.WithLeadingTrivia(leadingTrivia) _ 3107.WithLeadingTrivia(firstParameter.GetLeadingTrivia()) _ 3142.WithLeadingTrivia(SyntaxTriviaList.Empty) _ 3190Return declareStatement.WithLeadingTrivia(leadingTrivia).WithTrailingTrivia(trailingTrivia) 3198.WithLeadingTrivia(SyntaxTriviaList.Empty) _ 3243.WithLeadingTrivia(leadingTrivia) _ 3252.WithLeadingTrivia(SyntaxTriviaList.Empty) _ 3272.WithLeadingTrivia(leadingTrivia) _ 3285.WithLeadingTrivia(SyntaxTriviaList.Empty) _ 3301.WithLeadingTrivia(leadingTrivia) _ 3314.WithLeadingTrivia(SyntaxTriviaList.Empty) _ 3330.WithLeadingTrivia(leadingTrivia) _ 3343.WithLeadingTrivia(SyntaxTriviaList.Empty) _ 3371.WithLeadingTrivia(firstParameter.GetLeadingTrivia()) _ 3384.WithLeadingTrivia(leadingTrivia) _ 3397.WithLeadingTrivia(SyntaxTriviaList.Empty) _ 3413.WithLeadingTrivia(leadingTrivia) _ 3820list = list.WithLeadingTrivia(trivia)
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
329=> method.WithLeadingTrivia(nodeToFix.GetLeadingTrivia()).WithTrailingTrivia(nodeToFix.GetTrailingTrivia());
System.Windows.Forms.Analyzers.CodeFixes.CSharp (2)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (2)
95newProperty = newProperty.WithLeadingTrivia(leadingTrivia); 134.WithLeadingTrivia(firstNodesLeadingTrivia.Value
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (2)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (2)
103WithLeadingTrivia(leadingTrivia) 146compilationUnit.WithLeadingTrivia(firstNodesLeadingTrivia.Value.