448 references to WithSyntaxRoot
GenerateDocumentationAndConfigFiles (16)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
76
document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodes.Select(static t => t.diagnosticNode))),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
89
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
252
var newDocument = oldDocument.
WithSyntaxRoot
(currentRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
167
return document.
WithSyntaxRoot
(root);
250
return document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (2)
171
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodePairs.SelectMany(pair => pair.nodes.additionalNodes.Concat(pair.nodes.semanticNode))));
185
document = document.
WithSyntaxRoot
(replacementRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (1)
27
return document.
WithSyntaxRoot
(syntaxFormatting.Format(root, annotation, options, rules, cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
127
var newDocument = document.
WithSyntaxRoot
(editor.GetChangedRoot());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
115
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (4)
106
document = document.
WithSyntaxRoot
(root);
134
document = document.
WithSyntaxRoot
(root);
235
var newDocument = document.
WithSyntaxRoot
(newRoot);
304
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (1)
28
var newDocument = this.Document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
37
var newDocument = this.Document.
WithSyntaxRoot
(root);
Microsoft.AspNetCore.App.CodeFixes (7)
Authorization\AddAuthorizationBuilderFixer.cs (1)
138
return Task.FromResult(document.
WithSyntaxRoot
(
DetectMismatchedParameterOptionalityFixer.cs (1)
49
return document.
WithSyntaxRoot
(root.ReplaceNode(parameterSyntax, newParam));
Http\HeaderDictionaryAddFixer.cs (2)
74
return Task.FromResult(document.
WithSyntaxRoot
(
103
return Task.FromResult(document.
WithSyntaxRoot
(root.ReplaceNode(diagnosticTarget, assignment)));
Http\HeaderDictionaryIndexerFixer.cs (1)
60
return document.
WithSyntaxRoot
(root.ReplaceNode(elementAccessExpressionSyntax, newExpression));
RouteParameterUnusedParameterFixer.cs (1)
99
return document.
WithSyntaxRoot
(updatedSyntaxTree);
WebApplicationBuilderFixer.cs (1)
81
return Task.FromResult(document.
WithSyntaxRoot
(root.ReplaceNode(diagnosticTarget, invocation)));
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
57
return Task.FromResult(document.
WithSyntaxRoot
(newSyntaxRoot));
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Verifiers\CodeFixVerifier.cs (1)
109
document = document.
WithSyntaxRoot
(Formatter.Format(document.GetSyntaxRootAsync().Result, Formatter.Annotation, document.Project.Solution.Workspace));
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
57
return Task.FromResult(document.
WithSyntaxRoot
(newSyntaxRoot));
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Verifiers\CodeFixVerifier.cs (1)
109
document = document.
WithSyntaxRoot
(Formatter.Format(document.GetSyntaxRootAsync().Result, Formatter.Annotation, document.Project.Solution.Workspace));
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
AddResponseTypeAttributeCodeFixAction.cs (1)
124
return document.
WithSyntaxRoot
(root);
Microsoft.CodeAnalysis.Analyzers (20)
MetaAnalyzers\Fixers\ApplyDiagnosticAnalyzerAttributeFix.cs (1)
78
return Task.FromResult(document.
WithSyntaxRoot
(newRoot));
MetaAnalyzers\Fixers\ConfigureGeneratedCodeAnalysisFix.cs (1)
84
return document.
WithSyntaxRoot
(root.ReplaceNode(methodDeclaration, newMethodDeclaration));
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.cs (1)
168
return document.
WithSyntaxRoot
(newRoot).Project.Solution;
MetaAnalyzers\Fixers\EnableConcurrentExecutionFix.cs (1)
69
return document.
WithSyntaxRoot
(root.ReplaceNode(methodDeclaration, newMethodDeclaration));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
76
document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodes.Select(static t => t.diagnosticNode))),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
89
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
252
var newDocument = oldDocument.
WithSyntaxRoot
(currentRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
167
return document.
WithSyntaxRoot
(root);
250
return document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (2)
171
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodePairs.SelectMany(pair => pair.nodes.additionalNodes.Concat(pair.nodes.semanticNode))));
185
document = document.
WithSyntaxRoot
(replacementRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (1)
27
return document.
WithSyntaxRoot
(syntaxFormatting.Format(root, annotation, options, rules, cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
127
var newDocument = document.
WithSyntaxRoot
(editor.GetChangedRoot());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
115
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (4)
106
document = document.
WithSyntaxRoot
(root);
134
document = document.
WithSyntaxRoot
(root);
235
var newDocument = document.
WithSyntaxRoot
(newRoot);
304
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (1)
28
var newDocument = this.Document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
37
var newDocument = this.Document.
WithSyntaxRoot
(root);
Microsoft.CodeAnalysis.BannedApiAnalyzers (16)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
76
document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodes.Select(static t => t.diagnosticNode))),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
89
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
252
var newDocument = oldDocument.
WithSyntaxRoot
(currentRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
167
return document.
WithSyntaxRoot
(root);
250
return document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (2)
171
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodePairs.SelectMany(pair => pair.nodes.additionalNodes.Concat(pair.nodes.semanticNode))));
185
document = document.
WithSyntaxRoot
(replacementRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (1)
27
return document.
WithSyntaxRoot
(syntaxFormatting.Format(root, annotation, options, rules, cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
127
var newDocument = document.
WithSyntaxRoot
(editor.GetChangedRoot());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
115
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (4)
106
document = document.
WithSyntaxRoot
(root);
134
document = document.
WithSyntaxRoot
(root);
235
var newDocument = document.
WithSyntaxRoot
(newRoot);
304
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (1)
28
var newDocument = this.Document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
37
var newDocument = this.Document.
WithSyntaxRoot
(root);
Microsoft.CodeAnalysis.CodeStyle.Fixes (37)
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
102
return Task.FromResult(document.
WithSyntaxRoot
(root.ReplaceNode(finalTarget, replacement)));
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
64
return Task.FromResult(document.
WithSyntaxRoot
(newRoot));
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (1)
64
token => Task.FromResult(otherDocument.
WithSyntaxRoot
(newRoot)),
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
121
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
82
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
46
=> document.
WithSyntaxRoot
(await GetTransformedSyntaxRootAsync(document, cancellationToken).ConfigureAwait(false));
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (1)
85
return context.Document.
WithSyntaxRoot
(formattedRoot);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
39
var newDocument = _document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
117
return _document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (2)
78
var docWithAllMembers = docWithCoreMembers.
WithSyntaxRoot
(
108
return document.
WithSyntaxRoot
(finalRoot);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
109
var newDocument = document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
57
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
60
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (4)
281
return document.
WithSyntaxRoot
(root);
783
var newDocument = document.
WithSyntaxRoot
(currentRoot);
851
document = document.
WithSyntaxRoot
(rootWithTrackedNodes);
905
document = document.
WithSyntaxRoot
(rootWithRemovedDeclaration);
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (3)
252
var updatedFieldDocument = fieldDocument.
WithSyntaxRoot
(editor.GetChangedRoot());
267
var updatedFieldDocument = fieldDocument.
WithSyntaxRoot
(newFieldTreeRoot);
268
var updatedPropertyDocument = propertyDocument.
WithSyntaxRoot
(newPropertyTreeRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
76
document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodes.Select(static t => t.diagnosticNode))),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
89
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
252
var newDocument = oldDocument.
WithSyntaxRoot
(currentRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
167
return document.
WithSyntaxRoot
(root);
250
return document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (2)
171
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodePairs.SelectMany(pair => pair.nodes.additionalNodes.Concat(pair.nodes.semanticNode))));
185
document = document.
WithSyntaxRoot
(replacementRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (1)
27
return document.
WithSyntaxRoot
(syntaxFormatting.Format(root, annotation, options, rules, cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
127
var newDocument = document.
WithSyntaxRoot
(editor.GetChangedRoot());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
115
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (4)
106
document = document.
WithSyntaxRoot
(root);
134
document = document.
WithSyntaxRoot
(root);
235
var newDocument = document.
WithSyntaxRoot
(newRoot);
304
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (1)
28
var newDocument = this.Document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
37
var newDocument = this.Document.
WithSyntaxRoot
(root);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (22)
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
121
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (2)
44
var updatedDocument = document.
WithSyntaxRoot
(updatedRoot);
246
var updatedDocument = document.
WithSyntaxRoot
(updatedRoot);
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.AddNewKeywordAction.cs (1)
28
return document.
WithSyntaxRoot
(root.ReplaceNode(node, GetNewNode(node, modifierOrder)));
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
84
_ => Task.FromResult(document.
WithSyntaxRoot
(root)),
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (4)
79
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(node, newMethodDeclarationSyntax));
85
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(node, newOperator));
90
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(oldAccessor, oldAccessor.WithType(newReturnType)));
95
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(oldIndexer, oldIndexer.WithType(newReturnType)));
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
35
return document.
WithSyntaxRoot
(syntaxEditor.GetChangedRoot());
src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
76
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
158
var newDocument = document.
WithSyntaxRoot
(newCompilationUnitWithHeader);
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
58
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
85
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
58
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
93
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (1)
63
return document.
WithSyntaxRoot
(root.ReplaceNode(
src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (1)
64
return document.
WithSyntaxRoot
(root.ReplaceNode(
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
73
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
127
var newDocument = document.
WithSyntaxRoot
(newRoot.ReplaceNode(creationExpression, dummyObjectCreation));
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
68
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (1)
74
return document.
WithSyntaxRoot
(formattedRoot);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (2)
213
documentWithNameAndAnnotationsAdded.
WithSyntaxRoot
(updatedRoot), Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false);
283
return documentWithNameAdded.
WithSyntaxRoot
(rootWithUpdatedEventHookupExpression);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (5)
CodeGeneration\SyntaxGeneratorTests.cs (1)
46
var newDocument = document.
WithSyntaxRoot
(newRoot);
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
84
var newDocument = context.Document.
WithSyntaxRoot
(newRoot);
Formatting\CodeCleanupTests.TestFixers.cs (3)
40
return context.Document.
WithSyntaxRoot
(newRoot);
109
document = document.
WithSyntaxRoot
(newRoot);
165
document = document.
WithSyntaxRoot
(newRoot);
Microsoft.CodeAnalysis.CSharp.Features (65)
AddImport\CSharpAddImportFeatureService.cs (2)
350
return document.
WithSyntaxRoot
(newRoot);
404
return document.
WithSyntaxRoot
(newRoot);
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (2)
223
document = document.
WithSyntaxRoot
(editor.GetChangedRoot());
249
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (1)
126
return document.
WithSyntaxRoot
(newRoot);
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (3)
68
_ => Task.FromResult(document.
WithSyntaxRoot
(replacementFunc(root))),
598
document = document.
WithSyntaxRoot
(editor.OriginalRoot.TrackNodes(nodes));
617
document = document.
WithSyntaxRoot
(replacementFunc(root));
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
172
return document.
WithSyntaxRoot
(finalRoot);
ConvertBetweenRegularAndVerbatimString\AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider.cs (1)
91
return document.
WithSyntaxRoot
(root.ReplaceNode(stringExpression, newStringExpression));
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (1)
56
return document.
WithSyntaxRoot
(newRoot);
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (2)
45
return document.
WithSyntaxRoot
(rootWithGlobalStatements);
81
var documentWithImportsAdded = document.
WithSyntaxRoot
(addImportsService.AddImports(
ConvertToExtension\ConvertToExtensionCodeRefactoringProvider.cs (1)
208
return document.
WithSyntaxRoot
(newRoot);
ConvertToExtension\ConvertToExtensionFixAllProvider.cs (1)
56
return document.
WithSyntaxRoot
(newRoot);
ConvertToRawString\ConvertStringToRawStringCodeRefactoringProvider.cs (1)
139
return document.
WithSyntaxRoot
(root.ReplaceNode(expression, replacement));
DecompiledSource\CSharpDecompiledSourceService.cs (2)
95
return document.
WithSyntaxRoot
(newRoot);
104
return document.
WithSyntaxRoot
(newSyntaxRoot);
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
63
document = document.
WithSyntaxRoot
(root);
84
document = document.
WithSyntaxRoot
(root);
ExtractMethod\CSharpMethodExtractor.cs (1)
201
document = document.
WithSyntaxRoot
(root.ReplaceNode(originalMethodDefinition, methodDefinition));
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
1128
return originalDocument.Document.
WithSyntaxRoot
(newRoot);
ExtractMethod\CSharpSelectionResult.cs (1)
38
var newDocument = await SemanticDocument.CreateAsync(document.Document.
WithSyntaxRoot
(AddAnnotations(
Formatting\CSharpAccessibilityModifiersNewDocumentFormattingProvider.cs (1)
75
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (1)
40
var currentSolution = document.
WithSyntaxRoot
(trackedRoot).Project.Solution;
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (2)
64
return Task.FromResult(document.Document.
WithSyntaxRoot
(newRoot));
77
return Task.FromResult(document.Document.
WithSyntaxRoot
(newRoot));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (4)
133
return document.Document.
WithSyntaxRoot
(
262
return document.Document.
WithSyntaxRoot
(newRoot);
352
return document.Document.
WithSyntaxRoot
(editor.GetChangedRoot());
421
return document.Document.
WithSyntaxRoot
(newRoot);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (2)
72
return document.Document.
WithSyntaxRoot
(newRoot);
91
return document.Document.
WithSyntaxRoot
(newRoot);
MetadataAsSource\CSharpMetadataAsSourceService.cs (3)
55
return document.
WithSyntaxRoot
(newRoot);
67
return document.
WithSyntaxRoot
(newSyntaxRoot);
121
return document.
WithSyntaxRoot
(newRoot);
Organizing\CSharpOrganizingService.cs (1)
29
return document.
WithSyntaxRoot
(rewriter.Visit(root));
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
303
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
Snippets\AbstractCSharpTypeSnippetProvider.cs (1)
107
return document.
WithSyntaxRoot
(newRoot);
Snippets\CSharpIntMainSnippetProvider.cs (1)
63
return document.
WithSyntaxRoot
(updatedRoot);
Snippets\CSharpSnippetHelpers.cs (1)
59
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
121
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (2)
44
var updatedDocument = document.
WithSyntaxRoot
(updatedRoot);
246
var updatedDocument = document.
WithSyntaxRoot
(updatedRoot);
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.AddNewKeywordAction.cs (1)
28
return document.
WithSyntaxRoot
(root.ReplaceNode(node, GetNewNode(node, modifierOrder)));
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
84
_ => Task.FromResult(document.
WithSyntaxRoot
(root)),
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (4)
79
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(node, newMethodDeclarationSyntax));
85
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(node, newOperator));
90
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(oldAccessor, oldAccessor.WithType(newReturnType)));
95
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(oldIndexer, oldIndexer.WithType(newReturnType)));
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
35
return document.
WithSyntaxRoot
(syntaxEditor.GetChangedRoot());
src\Analyzers\CSharp\CodeFixes\MakeRefStruct\MakeRefStructCodeFixProvider.cs (1)
76
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
158
var newDocument = document.
WithSyntaxRoot
(newCompilationUnitWithHeader);
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
58
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
85
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
58
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
93
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (1)
63
return document.
WithSyntaxRoot
(root.ReplaceNode(
src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (1)
64
return document.
WithSyntaxRoot
(root.ReplaceNode(
src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
73
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
127
var newDocument = document.
WithSyntaxRoot
(newRoot.ReplaceNode(creationExpression, dummyObjectCreation));
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
68
return document.
WithSyntaxRoot
(newRoot);
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (2)
166
return document.
WithSyntaxRoot
(newRoot);
248
document = document.
WithSyntaxRoot
(currentRoot);
UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeRefactoringProvider.cs (1)
203
return document.
WithSyntaxRoot
(newRoot);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
OrganizeImports\CSharpOrganizeImportsService.cs (1)
28
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (1)
74
return document.
WithSyntaxRoot
(formattedRoot);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.cs (1)
55
doc = doc.
WithSyntaxRoot
(root);
Microsoft.CodeAnalysis.EditorFeatures (1)
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
192
var documentWithOriginalName = document.
WithSyntaxRoot
(syntaxTreeWithOriginalName.GetRoot(cancellationToken));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (7)
CodeGeneration\AbstractCodeGenerationTests.cs (1)
39
var annotatedDocument = document.
WithSyntaxRoot
(
CodeGeneration\CodeGenerationTests.cs (6)
94
testContext.Result = testContext.Document.
WithSyntaxRoot
(newRoot);
318
testContext.Result = testContext.Document.
WithSyntaxRoot
((await testContext.Document.GetSyntaxRootAsync()).ReplaceNode(oldSyntax, newSyntax));
334
testContext.Result = testContext.Document.
WithSyntaxRoot
((await testContext.Document.GetSyntaxRootAsync()).ReplaceNode(oldMemberSyntax, newMemberSyntax));
560
testContext.Result = testContext.Document.
WithSyntaxRoot
(testContext.SemanticModel.SyntaxTree.GetRoot().ReplaceNode(oldNode, newNode));
579
testContext.Result = testContext.Document.
WithSyntaxRoot
(testContext.SemanticModel.SyntaxTree.GetRoot().ReplaceNode(declarationNode, newNode));
631
testContext.Result = testContext.Document.
WithSyntaxRoot
(testContext.SemanticModel.SyntaxTree.GetRoot().ReplaceNode(declarationNode, updatedDeclarationNode));
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
CodeFixes\CodeFixServiceTests.vb (2)
229
context.RegisterCodeFix(CodeAction.Create("FIX_TEST0000", Function(ct) Task.FromResult(context.Document.
WithSyntaxRoot
(root))), context.Diagnostics)
254
context.RegisterCodeFix(CodeAction.Create("FIX_TEST1111", Function(ct) Task.FromResult(context.Document.
WithSyntaxRoot
(root))), context.Diagnostics)
Simplification\ParameterSimplificationTests.vb (1)
26
Dim annotatedDocument = document.
WithSyntaxRoot
(
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (1)
AddPackage\AspNetCoreAddPackageCodeAction.cs (1)
89
var updatedDocument = document.
WithSyntaxRoot
(newRoot);
Microsoft.CodeAnalysis.Features (100)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (1)
68
return Task.FromResult<Solution?>(constructorDocument.
WithSyntaxRoot
(newRoot).Project.Solution);
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
176
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
AddFileBanner\AbstractAddFileBannerNewDocumentFormattingProvider.cs (2)
39
return document.
WithSyntaxRoot
(rootWithFileHeader);
49
return document.
WithSyntaxRoot
(rootWithBanner);
AddFileBanner\AddFileBannerHelpers.cs (1)
41
return destinationDocument.
WithSyntaxRoot
(newRoot);
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (1)
71
var updatedDocument = newDocument.
WithSyntaxRoot
(updatedRoot);
AddImport\References\Reference.cs (1)
93
var newDocument = document.
WithSyntaxRoot
(root);
ChangeSignature\AbstractChangeSignatureService.cs (1)
423
var updatedDoc = currentSolution.GetRequiredDocument(docId).
WithSyntaxRoot
(updatedRoots[docId]);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs (1)
34
return suppressionsDoc.
WithSyntaxRoot
(suppressionsRoot);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (1)
147
var result = suppressionsDoc.
WithSyntaxRoot
(suppressionsRoot);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.LocalSuppressMessageCodeAction.cs (1)
34
return _document.
WithSyntaxRoot
(newRoot);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (2)
62
return document.
WithSyntaxRoot
(newRoot);
267
document = document.
WithSyntaxRoot
(root);
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (1)
137
return document.
WithSyntaxRoot
(finalRoot);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (2)
635
var formattedDocument = documentWithAddedImports.
WithSyntaxRoot
(root);
885
document = document.
WithSyntaxRoot
(root);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (2)
101
document = document.
WithSyntaxRoot
(annotatedRoot).WithFrozenPartialSemantics(forceFreeze: true, cancellationToken);
222
var document = memberContainingDocument.
WithSyntaxRoot
(root);
Completion\Providers\ImportCompletionProvider\ImportCompletionProviderHelpers.cs (1)
44
var documentWithImport = document.
WithSyntaxRoot
(rootWithImport);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
140
var updatedDocument = document.
WithSyntaxRoot
(editor.GetChangedRoot());
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
121
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
126
return document.
WithSyntaxRoot
(newRoot);
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
77
return document.
WithSyntaxRoot
(newRoot);
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
425
return document.
WithSyntaxRoot
(newRoot);
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
382
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
200
document = document.
WithSyntaxRoot
(editor.OriginalRoot.TrackNodes(ifStatements));
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
55
return document.
WithSyntaxRoot
(root);
ConvertLinq\AbstractConvertLinqQueryToForEachProvider.cs (1)
49
c => Task.FromResult(document.
WithSyntaxRoot
(documentUpdateInfo.UpdateRoot(root))),
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (1)
155
return Task.FromResult(document.
WithSyntaxRoot
(rootWithLinqUsing));
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (1)
128
return Task.FromResult(document.
WithSyntaxRoot
(updatedRoot));
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
124
return document.
WithSyntaxRoot
(root.ReplaceNode(top, interpolatedString));
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
310
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (1)
110
return Task.FromResult(document.
WithSyntaxRoot
(
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
259
return document.
WithSyntaxRoot
(newRoot).Project.Solution;
EncapsulateField\AbstractEncapsulateFieldService.cs (2)
179
document = document.
WithSyntaxRoot
(fieldDeclaration.SyntaxTree.GetRoot(cancellationToken).ReplaceNode(fieldDeclaration.GetSyntax(cancellationToken),
202
document = await Formatter.FormatAsync(document.
WithSyntaxRoot
(rewrittenFieldDeclaration), Formatter.Annotation, formattingOptions, cancellationToken).ConfigureAwait(false);
ExtractClass\ExtractClassWithDialogCodeAction.cs (1)
255
unformattedSolution = document.
WithSyntaxRoot
(currentRoot).Project.Solution;
ExtractInterface\AbstractExtractInterfaceService.cs (1)
345
unformattedSolution = document.
WithSyntaxRoot
(editor.GetChangedRoot()).Project.Solution;
ExtractMethod\MethodExtractor.cs (2)
150
var annotatedDocument = document.
WithSyntaxRoot
(root);
157
var formattedDocument = simplifiedDocument.
WithSyntaxRoot
(
FullyQualify\AbstractFullyQualifyService.cs (1)
221
var newDocument = document.
WithSyntaxRoot
(newRoot);
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (1)
307
return document.
WithSyntaxRoot
(newRoot);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (1)
118
var newDocument = _document.
WithSyntaxRoot
(oldRoot.ReplaceNode(oldType, newType));
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (3)
627
return document.
WithSyntaxRoot
(newRoot);
688
return document.
WithSyntaxRoot
(newRoot);
929
return document.
WithSyntaxRoot
(newRoot);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (2)
377
var currentSolution = document.
WithSyntaxRoot
(trackedRoot).Project.Solution;
525
var documentWithMemberAdded = document.
WithSyntaxRoot
(editor.GetChangedRoot());
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (5)
179
return document.
WithSyntaxRoot
(root.ReplaceNode(
193
return document.
WithSyntaxRoot
(root.ReplaceNode(declarationStatement, usingDeclarationStatement));
226
return document.
WithSyntaxRoot
(newRoot);
259
return document.
WithSyntaxRoot
(root.ReplaceNode(
268
return document.
WithSyntaxRoot
(root.ReplaceNode(
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
105
return document.
WithSyntaxRoot
(newRoot);
IntroduceVariable\AbstractIntroduceVariableService.cs (2)
426
var newDocument = semanticDocument.Document.
WithSyntaxRoot
(newRoot);
456
newDocument = newSemanticDocument.Document.
WithSyntaxRoot
(newRoot);
InvertConditional\AbstractInvertConditionalCodeRefactoringProvider.cs (1)
58
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (1)
300
return document.
WithSyntaxRoot
(
InvertLogical\AbstractInvertLogicalCodeRefactoringProvider.cs (2)
108
return document.
WithSyntaxRoot
(root.ReplaceNode(
134
return document.
WithSyntaxRoot
(root.ReplaceNode(
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (1)
85
var sourceDoc = _document.
WithSyntaxRoot
(root);
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
88
return document.
WithSyntaxRoot
(newRoot);
OrganizeImports\OrganizeImportsCodeRefactoringProvider.cs (1)
91
cancellationToken => Task.FromResult(document.
WithSyntaxRoot
(newRoot))),
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (2)
215
return document.
WithSyntaxRoot
(newRoot);
257
return document.
WithSyntaxRoot
(newRoot);
Shared\Extensions\DocumentExtensions.cs (2)
39
return document.
WithSyntaxRoot
(newRoot);
49
return document.
WithSyntaxRoot
(newRoot);
Shared\Utilities\AnnotatedSymbolMapping.cs (1)
101
annotatedSolution = document.
WithSyntaxRoot
(root.Value).Project.Solution;
Shared\Utilities\ExtractTypeHelpers.cs (2)
46
var newDocument = document.
WithSyntaxRoot
(editor.GetChangedRoot());
107
newTypeDocument = newTypeDocument.
WithSyntaxRoot
(annotatedRoot);
Snippets\SnippetFunctionService.cs (1)
154
var documentWithAnnotations = documentWithFullyQualifiedTypeName.
WithSyntaxRoot
(updatedRoot);
Snippets\SnippetProviders\AbstractSnippetProvider.cs (3)
96
var annotatedReformattedDocument = documentWithIndentation.
WithSyntaxRoot
(reformattedRoot);
185
return snippetDocument.
WithSyntaxRoot
(root);
201
document = document.
WithSyntaxRoot
(annotatedSnippetRoot);
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
225
return document.
WithSyntaxRoot
(newRoot);
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (1)
77
return document.
WithSyntaxRoot
(newRoot);
SplitOrMergeIfStatements\AbstractSplitIfStatementCodeRefactoringProvider.cs (1)
75
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
102
return Task.FromResult(document.
WithSyntaxRoot
(root.ReplaceNode(finalTarget, replacement)));
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
64
return Task.FromResult(document.
WithSyntaxRoot
(newRoot));
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (1)
64
token => Task.FromResult(otherDocument.
WithSyntaxRoot
(newRoot)),
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
121
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
82
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
46
=> document.
WithSyntaxRoot
(await GetTransformedSyntaxRootAsync(document, cancellationToken).ConfigureAwait(false));
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (1)
85
return context.Document.
WithSyntaxRoot
(formattedRoot);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
39
var newDocument = _document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
117
return _document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (2)
78
var docWithAllMembers = docWithCoreMembers.
WithSyntaxRoot
(
108
return document.
WithSyntaxRoot
(finalRoot);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
109
var newDocument = document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
57
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
60
return document.
WithSyntaxRoot
(newRoot);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (4)
281
return document.
WithSyntaxRoot
(root);
783
var newDocument = document.
WithSyntaxRoot
(currentRoot);
851
document = document.
WithSyntaxRoot
(rootWithTrackedNodes);
905
document = document.
WithSyntaxRoot
(rootWithRemovedDeclaration);
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (3)
252
var updatedFieldDocument = fieldDocument.
WithSyntaxRoot
(editor.GetChangedRoot());
267
var updatedFieldDocument = fieldDocument.
WithSyntaxRoot
(newFieldTreeRoot);
268
var updatedPropertyDocument = propertyDocument.
WithSyntaxRoot
(newPropertyTreeRoot);
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
146
return Task.FromResult(document.
WithSyntaxRoot
(newRoot));
Wrapping\AbstractCodeActionComputer.cs (1)
166
var newDocument = OriginalDocument.
WithSyntaxRoot
(rewrittenRoot);
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
ExternalAccess\Razor\SimplifyMethodHandler.cs (1)
64
var annotatedDocument = originalDocument.
WithSyntaxRoot
(annotatedSyntaxRoot);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (16)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
76
document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodes.Select(static t => t.diagnosticNode))),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
89
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
252
var newDocument = oldDocument.
WithSyntaxRoot
(currentRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
167
return document.
WithSyntaxRoot
(root);
250
return document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (2)
171
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodePairs.SelectMany(pair => pair.nodes.additionalNodes.Concat(pair.nodes.semanticNode))));
185
document = document.
WithSyntaxRoot
(replacementRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (1)
27
return document.
WithSyntaxRoot
(syntaxFormatting.Format(root, annotation, options, rules, cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
127
var newDocument = document.
WithSyntaxRoot
(editor.GetChangedRoot());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
115
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (4)
106
document = document.
WithSyntaxRoot
(root);
134
document = document.
WithSyntaxRoot
(root);
235
var newDocument = document.
WithSyntaxRoot
(newRoot);
304
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (1)
28
var newDocument = this.Document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
37
var newDocument = this.Document.
WithSyntaxRoot
(root);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (4)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
53
Function(c) Task.FromResult(document.
WithSyntaxRoot
(root)),
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (2)
99
Return CodeAction.Create(title, Function(c) Task.FromResult(document.
WithSyntaxRoot
(root)), title)
107
Return CodeAction.Create(title, Function(c) Task.FromResult(document.
WithSyntaxRoot
(root)), title)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
79
Dim trackedDocument = document.
WithSyntaxRoot
(trackedRoot)
Microsoft.CodeAnalysis.VisualBasic.Features (14)
CodeFixes\CorrectNextControlVariable\CorrectNextControlVariableCodeFixProvider.CodeAction.vb (1)
32
Return _document.
WithSyntaxRoot
(updatedRoot)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.AddKeywordCodeAction.vb (1)
43
Return _document.
WithSyntaxRoot
(updatedRoot)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.ReplaceKeywordCodeAction.vb (1)
42
Return _document.
WithSyntaxRoot
(updatedRoot)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.ReplaceTokenKeywordCodeAction.vb (1)
35
Return _document.
WithSyntaxRoot
(rootWithoutToken)
CodeFixes\IncorrectFunctionReturnType\IncorrectFunctionReturnTypeCodeFixProvider.vb (1)
83
Dim newDocument = document.
WithSyntaxRoot
(newRoot)
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.AddKeywordAction.vb (1)
48
Return _document.
WithSyntaxRoot
(newRoot)
CodeRefactorings\RemoveStatementCodeAction.vb (1)
32
Return _document.
WithSyntaxRoot
(updatedRoot)
MetadataAsSource\VisualBasicMetadataAsSourceService.vb (2)
50
Return document.
WithSyntaxRoot
(newRoot)
63
Return document.
WithSyntaxRoot
(newSyntaxRoot)
Organizing\VisualBasicOrganizerService.vb (1)
25
Return document.
WithSyntaxRoot
(rewriter.Visit(root))
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
53
Function(c) Task.FromResult(document.
WithSyntaxRoot
(root)),
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (2)
99
Return CodeAction.Create(title, Function(c) Task.FromResult(document.
WithSyntaxRoot
(root)), title)
107
Return CodeAction.Create(title, Function(c) Task.FromResult(document.
WithSyntaxRoot
(root)), title)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
79
Dim trackedDocument = document.
WithSyntaxRoot
(trackedRoot)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
CodeCleanup\Providers\AbstractTokensCodeCleanupProvider.vb (1)
27
Return If(root Is newRoot, document, document.
WithSyntaxRoot
(newRoot))
OrganizeImports\VisualBasicOrganizeImportsService.vb (1)
24
Return document.
WithSyntaxRoot
(newRoot)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (1)
47
Return document.
WithSyntaxRoot
(newRoot)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.vb (1)
60
doc = doc.
WithSyntaxRoot
(root)
Microsoft.CodeAnalysis.Workspaces (25)
CaseCorrection\AbstractCaseCorrectionService.cs (1)
38
return (root == newRoot) ? document : document.
WithSyntaxRoot
(newRoot);
CodeCleanup\AbstractCodeCleanerService.cs (1)
63
var annotatedDocument = document.
WithSyntaxRoot
(annotatedRoot);
CodeCleanup\Providers\FormatCodeCleanupProvider.cs (1)
29
: document.
WithSyntaxRoot
(result.GetFormattedRoot(cancellationToken));
CodeRefactorings\SyntaxEditorBasedCodeRefactoringProvider.cs (1)
76
return document.
WithSyntaxRoot
(newRoot);
Editing\DocumentEditor.cs (1)
54
=> OriginalDocument.
WithSyntaxRoot
(this.GetChangedRoot());
Editing\SolutionEditor.cs (1)
49
var newDoc = currentDoc.
WithSyntaxRoot
(docEd.GetChangedRoot());
Formatting\Formatter.cs (2)
96
return document.
WithSyntaxRoot
(Format(root, spans, services, options, rules, cancellationToken));
141
return document.
WithSyntaxRoot
(Format(root, annotation, services, formattingOptions, rules, cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
76
document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodes.Select(static t => t.diagnosticNode))),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
89
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
252
var newDocument = oldDocument.
WithSyntaxRoot
(currentRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
167
return document.
WithSyntaxRoot
(root);
250
return document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (2)
171
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodePairs.SelectMany(pair => pair.nodes.additionalNodes.Concat(pair.nodes.semanticNode))));
185
document = document.
WithSyntaxRoot
(replacementRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (1)
27
return document.
WithSyntaxRoot
(syntaxFormatting.Format(root, annotation, options, rules, cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
127
var newDocument = document.
WithSyntaxRoot
(editor.GetChangedRoot());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
115
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (4)
106
document = document.
WithSyntaxRoot
(root);
134
document = document.
WithSyntaxRoot
(root);
235
var newDocument = document.
WithSyntaxRoot
(newRoot);
304
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (1)
28
var newDocument = this.Document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
37
var newDocument = this.Document.
WithSyntaxRoot
(root);
Workspace\Solution\SourceGeneratedDocument.cs (1)
34
=> (SourceGeneratedDocument)base.
WithSyntaxRoot
(root);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (3)
349
var newDoc = d1.
WithSyntaxRoot
(newRoot);
2872
var doc2 = document.
WithSyntaxRoot
(gen.CompilationUnit()); // empty CU
2886
var doc3 = document.
WithSyntaxRoot
(gen.CompilationUnit()); // empty CU
Microsoft.CodeAnalysis.Workspaces.UnitTests (13)
BatchFixAllProviderTests.cs (1)
118
return document.
WithSyntaxRoot
(root.ReplaceToken(token, newToken));
CodeCleanup\CodeCleanupTests.cs (8)
145
document = document.
WithSyntaxRoot
((await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(annotation));
160
document = document.
WithSyntaxRoot
((await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(annotation));
193
return document.
WithSyntaxRoot
(root);
214
return document.
WithSyntaxRoot
(root);
235
return document.
WithSyntaxRoot
(root);
256
return document.
WithSyntaxRoot
(root);
321
document = document.
WithSyntaxRoot
(root);
365
return document.
WithSyntaxRoot
(root);
SolutionTests\SolutionTests.cs (2)
3273
var documentWithAttribute = document.
WithSyntaxRoot
(newSyntaxRoot);
4039
var newDoc = doc.
WithSyntaxRoot
(newRoot);
SyntaxNodeTests.cs (1)
112
doc = doc.
WithSyntaxRoot
(trackedRoot);
WorkspaceTests\AdhocWorkspaceTests.cs (1)
347
var newDoc = doc.
WithSyntaxRoot
(newRoot);
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckNameofFixProvider.cs (2)
173
return document.
WithSyntaxRoot
(newRoot);
184
return document.
WithSyntaxRoot
(newRoot);
Microsoft.VisualStudio.LanguageServices (1)
Venus\ContainedLanguageCodeSupport.cs (1)
226
targetDocument.
WithSyntaxRoot
(newRoot), Simplifier.Annotation, options.CleanupOptions.SimplifierOptions, cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetSyntaxRootSynchronously(cancellationToken);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\CSharpSnippetExpansionLanguageHelper.cs (1)
99
var newDocument = document.
WithSyntaxRoot
(newRoot);
Roslyn.Diagnostics.Analyzers (30)
AbstractApplyTraitToClass`1.cs (1)
119
return state.Document.
WithSyntaxRoot
(syntaxRoot.ReplaceNode(typeDeclaration, newTypeDeclaration));
AbstractCreateTestAccessor`1.cs (1)
97
return document.
WithSyntaxRoot
(syntaxRoot.ReplaceNode(typeDeclaration, newTypeDeclaration));
AbstractExposeMemberForTesting`1.cs (1)
167
return document.
WithSyntaxRoot
(syntaxRoot.ReplaceNode(testAccessorTypeDeclaration, newTypeDeclaration)).Project.Solution;
AbstractRunIterations`1.cs (1)
133
return document.
WithSyntaxRoot
(root.ReplaceNode(method, updatedMethod));
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (3)
138
return document.
WithSyntaxRoot
(root.ReplaceNode(declaration, newDeclaration));
155
return document.
WithSyntaxRoot
(root.ReplaceNode(declaration, newDeclaration));
205
return document.
WithSyntaxRoot
(root.ReplaceNode(declaration, newDeclaration));
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (5)
114
return document.
WithSyntaxRoot
(root.ReplaceNode(declaration, newDeclaration));
135
return document.
WithSyntaxRoot
(root.ReplaceNode(declaration, newDeclaration));
160
return document.
WithSyntaxRoot
(root.ReplaceNode(argumentToReplace, descriptionArgument));
179
return document.
WithSyntaxRoot
(root.ReplaceNode(declaration, newDeclaration));
203
return document.
WithSyntaxRoot
(root.ReplaceNode(argumentToReplace, errorArgument));
PartsExportedWithMEFv2MustBeMarkedAsShared.Fixer.cs (1)
65
return Task.FromResult(document.
WithSyntaxRoot
(root.ReplaceNode(declaration, newDeclaration)));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
76
document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodes.Select(static t => t.diagnosticNode))),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
89
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
252
var newDocument = oldDocument.
WithSyntaxRoot
(currentRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
167
return document.
WithSyntaxRoot
(root);
250
return document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (2)
171
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodePairs.SelectMany(pair => pair.nodes.additionalNodes.Concat(pair.nodes.semanticNode))));
185
document = document.
WithSyntaxRoot
(replacementRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (1)
27
return document.
WithSyntaxRoot
(syntaxFormatting.Format(root, annotation, options, rules, cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
127
var newDocument = document.
WithSyntaxRoot
(editor.GetChangedRoot());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
115
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (4)
106
document = document.
WithSyntaxRoot
(root);
134
document = document.
WithSyntaxRoot
(root);
235
var newDocument = document.
WithSyntaxRoot
(newRoot);
304
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (1)
28
var newDocument = this.Document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
37
var newDocument = this.Document.
WithSyntaxRoot
(root);
TestExportsShouldNotBeDiscoverableCodeFixProvider.cs (1)
103
return document.
WithSyntaxRoot
(root.ReplaceNode(declaration, newDeclaration));
Roslyn.Diagnostics.CSharp.Analyzers (3)
CSharpDoNotUseDebugAssertForInterpolatedStringsFixer.cs (1)
80
return document.
WithSyntaxRoot
(newRoot);
PreferNullLiteralCodeFixProvider.cs (1)
77
return document.
WithSyntaxRoot
(root.ReplaceNode(syntax, newSyntax));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (1)
74
return document.
WithSyntaxRoot
(formattedRoot);
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
240
return document.
WithSyntaxRoot
(root.ReplaceNode(typeDeclarationOrCompilationUnit, newTypeDeclarationOrCompilationUnit));
System.Windows.Forms.Analyzers.CodeFixes.CSharp (2)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (2)
105
document = document.
WithSyntaxRoot
(root);
147
document = document.
WithSyntaxRoot
(
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (2)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (2)
119
document = document.
WithSyntaxRoot
(root)
163
document = document.
WithSyntaxRoot
(
Text.Analyzers (16)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
76
document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodes.Select(static t => t.diagnosticNode))),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
89
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
252
var newDocument = oldDocument.
WithSyntaxRoot
(currentRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
167
return document.
WithSyntaxRoot
(root);
250
return document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (2)
171
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodePairs.SelectMany(pair => pair.nodes.additionalNodes.Concat(pair.nodes.semanticNode))));
185
document = document.
WithSyntaxRoot
(replacementRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Formatting\FormatterShared.cs (1)
27
return document.
WithSyntaxRoot
(syntaxFormatting.Format(root, annotation, options, rules, cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (1)
127
var newDocument = document.
WithSyntaxRoot
(editor.GetChangedRoot());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
115
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (4)
106
document = document.
WithSyntaxRoot
(root);
134
document = document.
WithSyntaxRoot
(root);
235
var newDocument = document.
WithSyntaxRoot
(newRoot);
304
return document.
WithSyntaxRoot
(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SemanticDocument.cs (1)
28
var newDocument = this.Document.
WithSyntaxRoot
(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
37
var newDocument = this.Document.
WithSyntaxRoot
(root);