318 references to WithSyntaxRoot
Microsoft.CodeAnalysis.CodeStyle.Fixes (23)
AbstractAddDocCommentNodesCodeFixProvider.cs (1)
122
return document.
WithSyntaxRoot
(newRoot);
AbstractAddExplicitCastCodeFixProvider.cs (1)
93
cancellationToken => Task.FromResult(document.
WithSyntaxRoot
(
AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
65
return Task.FromResult(document.
WithSyntaxRoot
(newRoot));
AbstractCodeGenerationService.cs (1)
257
var newDocument = oldDocument.
WithSyntaxRoot
(currentRoot);
AbstractConvertToAsyncCodeFixProvider.cs (1)
76
token => Task.FromResult(otherDocument.
WithSyntaxRoot
(newRoot)),
AbstractFileHeaderCodeFixProvider.cs (1)
47
=> document.
WithSyntaxRoot
(await GetTransformedSyntaxRootAsync(document, fallbackOptions, cancellationToken).ConfigureAwait(false));
AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
197
var newDocument = document.
WithSyntaxRoot
(newRoot);
AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
109
var newDocument = document.
WithSyntaxRoot
(newRoot);
AbstractMoveDeclarationNearReferenceService.cs (1)
113
return document.
WithSyntaxRoot
(newRoot);
AbstractMultipleBlankLinesCodeFixProvider.cs (1)
64
return document.
WithSyntaxRoot
(newRoot);
AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
83
return document.
WithSyntaxRoot
(newRoot);
AbstractRemoveUnusedValuesCodeFixProvider.cs (4)
269
return document.
WithSyntaxRoot
(root);
773
var newDocument = document.
WithSyntaxRoot
(currentRoot);
846
document = document.
WithSyntaxRoot
(rootWithTrackedNodes);
895
document = document.
WithSyntaxRoot
(rootWithRemovedDeclaration);
AbstractUseCollectionInitializerCodeFixProvider.cs (2)
78
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalObjectCreationNodes));
105
document = document.
WithSyntaxRoot
(subEditor.GetChangedRoot());
AbstractUseObjectInitializerCodeFixProvider.cs (2)
76
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalObjectCreationNodes));
108
document = document.
WithSyntaxRoot
(subEditor.GetChangedRoot());
ConsecutiveStatementPlacementCodeFixProvider.cs (1)
61
return document.
WithSyntaxRoot
(newRoot);
SyntaxEditorBasedCodeFixProvider.cs (1)
87
return document.
WithSyntaxRoot
(newRoot);
SyntaxEditorExtensions.cs (2)
171
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodePairs.SelectMany(pair => pair.nodes.additionalNodes.Concat(pair.nodes.semanticNode))));
185
document = document.
WithSyntaxRoot
(replacementRoot);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (21)
ConsecutiveBracePlacementCodeFixProvider.cs (1)
62
return document.
WithSyntaxRoot
(newRoot);
ConstructorInitializerPlacementCodeFixProvider.cs (1)
89
return document.
WithSyntaxRoot
(newRoot);
ConvertNamespaceTransform.cs (2)
55
var updatedDocument = document.
WithSyntaxRoot
(updatedRoot);
163
return document.
WithSyntaxRoot
(root.ReplaceNode(fileScopedNamespace, ConvertFileScopedNamespace(fileScopedNamespace)));
CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
125
return document.
WithSyntaxRoot
(newRoot);
CSharpAddYieldCodeFixProvider.cs (1)
87
_ => Task.FromResult(document.
WithSyntaxRoot
(root)),
CSharpChangeToIEnumerableCodeFixProvider.cs (4)
85
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(node, newMethodDeclarationSyntax));
91
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(node, newOperator));
97
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(oldAccessor, oldAccessor.WithType(newReturnType)));
103
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(oldIndexer, oldIndexer.WithType(newReturnType)));
CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
98
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
CSharpRemoveUnnecessaryImportsService.cs (1)
84
return document.
WithSyntaxRoot
(formattedRoot);
CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
78
return document.
WithSyntaxRoot
(newRoot);
EmbeddedStatementPlacementCodeFixProvider.cs (1)
60
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
HideBaseCodeFixProvider.AddNewKeywordAction.cs (1)
44
return _document.
WithSyntaxRoot
(newRoot);
MakeLocalFunctionStaticCodeFixHelper.cs (1)
38
return document.
WithSyntaxRoot
(syntaxEditor.GetChangedRoot());
MakeRefStructCodeFixProvider.cs (1)
82
return document.
WithSyntaxRoot
(newRoot);
MisplacedUsingDirectivesCodeFixProvider.cs (1)
158
var newDocument = document.
WithSyntaxRoot
(newCompilationUnitWithHeader);
RemoveInKeywordCodeFixProvider.cs (1)
68
return document.
WithSyntaxRoot
(root.ReplaceNode(
RemoveNewModifierCodeFixProvider.cs (1)
69
return document.
WithSyntaxRoot
(root.ReplaceNode(
UseExplicitTypeForConstCodeFixProvider.cs (1)
73
return document.
WithSyntaxRoot
(newRoot);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (4)
DecompiledSource\CSharpDecompiledSourceService.cs (2)
146
return document.
WithSyntaxRoot
(newRoot);
155
return document.
WithSyntaxRoot
(newSyntaxRoot);
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (2)
176
var simplifiedDocument = Simplifier.ReduceAsync(documentWithNameAndAnnotationsAdded.
WithSyntaxRoot
(updatedRoot), Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken).WaitAndGetResult(cancellationToken);
223
return documentWithNameAdded.
WithSyntaxRoot
(rootWithUpdatedEventHookupExpression);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (5)
CodeGeneration\SyntaxGeneratorTests.cs (1)
47
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 (60)
AddImport\CSharpAddImportFeatureService.cs (2)
349
return document.
WithSyntaxRoot
(newRoot);
403
return document.
WithSyntaxRoot
(newRoot);
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (2)
234
document = document.
WithSyntaxRoot
(editor.GetChangedRoot());
260
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (1)
132
return document.
WithSyntaxRoot
(newRoot);
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (3)
69
_ => Task.FromResult(document.
WithSyntaxRoot
(replacementFunc(root))),
539
document = document.
WithSyntaxRoot
(editor.OriginalRoot.TrackNodes(nodes));
558
document = document.
WithSyntaxRoot
(replacementFunc(root));
ConsecutiveBracePlacementCodeFixProvider.cs (1)
62
return document.
WithSyntaxRoot
(newRoot);
ConstructorInitializerPlacementCodeFixProvider.cs (1)
89
return document.
WithSyntaxRoot
(newRoot);
ConvertBetweenRegularAndVerbatimString\AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider.cs (1)
91
return document.
WithSyntaxRoot
(root.ReplaceNode(stringExpression, newStringExpression));
ConvertNamespaceTransform.cs (2)
55
var updatedDocument = document.
WithSyntaxRoot
(updatedRoot);
163
return document.
WithSyntaxRoot
(root.ReplaceNode(fileScopedNamespace, ConvertFileScopedNamespace(fileScopedNamespace)));
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (1)
59
return document.
WithSyntaxRoot
(newRoot);
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (2)
44
return document.
WithSyntaxRoot
(rootWithGlobalStatements);
80
var documentWithImportsAdded = document.
WithSyntaxRoot
(addImportsService.AddImports(
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (1)
203
return document.
WithSyntaxRoot
(root.ReplaceToken(token, replacement));
CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
125
return document.
WithSyntaxRoot
(newRoot);
CSharpAddYieldCodeFixProvider.cs (1)
87
_ => Task.FromResult(document.
WithSyntaxRoot
(root)),
CSharpChangeToIEnumerableCodeFixProvider.cs (4)
85
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(node, newMethodDeclarationSyntax));
91
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(node, newOperator));
97
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(oldAccessor, oldAccessor.WithType(newReturnType)));
103
newDocument = document.
WithSyntaxRoot
(root.ReplaceNode(oldIndexer, oldIndexer.WithType(newReturnType)));
CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
98
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
CSharpReplaceDefaultLiteralCodeFixProvider.cs (1)
78
return document.
WithSyntaxRoot
(newRoot);
EmbeddedStatementPlacementCodeFixProvider.cs (1)
60
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
64
document = document.
WithSyntaxRoot
(root);
88
document = document.
WithSyntaxRoot
(root);
ExtractMethod\CSharpMethodExtractor.cs (1)
229
document = document.
WithSyntaxRoot
(root.ReplaceNode(originalMethodDefinition, methodDefinition));
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
833
return originalDocument.Document.
WithSyntaxRoot
(newRoot);
ExtractMethod\CSharpSelectionResult.cs (1)
42
var newDocument = await SemanticDocument.CreateAsync(document.Document.
WithSyntaxRoot
(root.AddAnnotations(
Formatting\CSharpAccessibilityModifiersNewDocumentFormattingProvider.cs (1)
75
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
HideBaseCodeFixProvider.AddNewKeywordAction.cs (1)
44
return _document.
WithSyntaxRoot
(newRoot);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs (2)
62
return Task.FromResult(document.Document.
WithSyntaxRoot
(newRoot));
75
return Task.FromResult(document.Document.
WithSyntaxRoot
(newRoot));
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (3)
115
return document.Document.
WithSyntaxRoot
(newRoot);
245
return document.Document.
WithSyntaxRoot
(newRoot);
353
return document.Document.
WithSyntaxRoot
(newRoot);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs (2)
73
return Task.FromResult(document.Document.
WithSyntaxRoot
(newRoot));
92
return document.Document.
WithSyntaxRoot
(newRoot);
MakeLocalFunctionStaticCodeFixHelper.cs (1)
38
return document.
WithSyntaxRoot
(syntaxEditor.GetChangedRoot());
MakeRefStructCodeFixProvider.cs (1)
82
return document.
WithSyntaxRoot
(newRoot);
MetadataAsSource\CSharpMetadataAsSourceService.cs (3)
55
return document.
WithSyntaxRoot
(newRoot);
67
return document.
WithSyntaxRoot
(newSyntaxRoot);
120
return document.
WithSyntaxRoot
(newRoot);
MisplacedUsingDirectivesCodeFixProvider.cs (1)
158
var newDocument = document.
WithSyntaxRoot
(newCompilationUnitWithHeader);
Organizing\CSharpOrganizingService.cs (1)
34
return document.
WithSyntaxRoot
(rewriter.Visit(root));
RemoveInKeywordCodeFixProvider.cs (1)
68
return document.
WithSyntaxRoot
(root.ReplaceNode(
RemoveNewModifierCodeFixProvider.cs (1)
69
return document.
WithSyntaxRoot
(root.ReplaceNode(
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
302
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
Snippets\AbstractCSharpTypeSnippetProvider.cs (1)
105
return document.
WithSyntaxRoot
(newRoot);
Snippets\CSharpConstructorSnippetProvider.cs (1)
94
return document.
WithSyntaxRoot
(newRoot);
Snippets\CSharpElseSnippetProvider.cs (1)
116
return document.
WithSyntaxRoot
(newRoot);
Snippets\CSharpForEachLoopSnippetProvider.cs (1)
103
return document.
WithSyntaxRoot
(newRoot);
Snippets\CSharpIfSnippetProvider.cs (1)
80
return document.
WithSyntaxRoot
(newRoot);
Snippets\CSharpWhileLoopSnippetProvider.cs (1)
80
return document.
WithSyntaxRoot
(newRoot);
UseExplicitTypeForConstCodeFixProvider.cs (1)
73
return document.
WithSyntaxRoot
(newRoot);
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (2)
172
return document.
WithSyntaxRoot
(newRoot);
254
document = document.
WithSyntaxRoot
(currentRoot);
UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeRefactoringProvider.cs (1)
211
return document.
WithSyntaxRoot
(newRoot);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
CSharpRemoveUnnecessaryImportsService.cs (1)
84
return document.
WithSyntaxRoot
(formattedRoot);
OrganizeImports\CSharpOrganizeImportsService.cs (1)
35
return document.
WithSyntaxRoot
(newRoot);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.cs (1)
55
doc = doc.
WithSyntaxRoot
(root);
Microsoft.CodeAnalysis.EditorFeatures (1)
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
190
var documentWithOriginalName = document.
WithSyntaxRoot
(syntaxTreeWithOriginalName.GetRoot(cancellationToken));
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (2)
Snippets\CSharpSnippets\SnippetFunctions\SnippetFunctionGenerateSwitchCases.cs (1)
97
var documentWithAnnotations = documentWithCaseAdded.
WithSyntaxRoot
(updatedRoot);
Snippets\CSharpSnippets\SnippetFunctions\SnippetFunctionSimpleTypeName.cs (1)
38
var documentWithAnnotations = documentWithFullyQualifiedTypeName.
WithSyntaxRoot
(updatedRoot);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (7)
CodeGeneration\AbstractCodeGenerationTests.cs (1)
39
var annotatedDocument = document.
WithSyntaxRoot
(
CodeGeneration\CodeGenerationTests.cs (6)
99
testContext.Result = testContext.Document.
WithSyntaxRoot
(newRoot);
325
testContext.Result = testContext.Document.
WithSyntaxRoot
((await testContext.Document.GetSyntaxRootAsync()).ReplaceNode(oldSyntax, newSyntax));
341
testContext.Result = testContext.Document.
WithSyntaxRoot
((await testContext.Document.GetSyntaxRootAsync()).ReplaceNode(oldMemberSyntax, newMemberSyntax));
556
testContext.Result = testContext.Document.
WithSyntaxRoot
(testContext.SemanticModel.SyntaxTree.GetRoot().ReplaceNode(oldNode, newNode));
575
testContext.Result = testContext.Document.
WithSyntaxRoot
(testContext.SemanticModel.SyntaxTree.GetRoot().ReplaceNode(declarationNode, newNode));
627
testContext.Result = testContext.Document.
WithSyntaxRoot
(testContext.SemanticModel.SyntaxTree.GetRoot().ReplaceNode(declarationNode, updatedDeclarationNode));
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (6)
CodeFixes\CodeFixServiceTests.vb (2)
242
context.RegisterCodeFix(CodeAction.Create("FIX_TEST0000", Function(ct) Task.FromResult(context.Document.
WithSyntaxRoot
(root))), context.Diagnostics)
267
context.RegisterCodeFix(CodeAction.Create("FIX_TEST1111", Function(ct) Task.FromResult(context.Document.
WithSyntaxRoot
(root))), context.Diagnostics)
Expansion\AbstractExpansionTest.vb (2)
42
document = document.
WithSyntaxRoot
(root)
48
document = document.
WithSyntaxRoot
(root)
Simplification\AbstractSimplificationTests.vb (1)
113
document = document.
WithSyntaxRoot
(root)
Simplification\ParameterSimplificationTests.vb (1)
26
Dim annotatedDocument = document.
WithSyntaxRoot
(
Microsoft.CodeAnalysis.Features (102)
AbstractAddDocCommentNodesCodeFixProvider.cs (1)
122
return document.
WithSyntaxRoot
(newRoot);
AbstractAddExplicitCastCodeFixProvider.cs (1)
93
cancellationToken => Task.FromResult(document.
WithSyntaxRoot
(
AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
65
return Task.FromResult(document.
WithSyntaxRoot
(newRoot));
AbstractConvertToAsyncCodeFixProvider.cs (1)
76
token => Task.FromResult(otherDocument.
WithSyntaxRoot
(newRoot)),
AbstractFileHeaderCodeFixProvider.cs (1)
47
=> document.
WithSyntaxRoot
(await GetTransformedSyntaxRootAsync(document, fallbackOptions, cancellationToken).ConfigureAwait(false));
AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
197
var newDocument = document.
WithSyntaxRoot
(newRoot);
AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
109
var newDocument = document.
WithSyntaxRoot
(newRoot);
AbstractMultipleBlankLinesCodeFixProvider.cs (1)
64
return document.
WithSyntaxRoot
(newRoot);
AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
83
return document.
WithSyntaxRoot
(newRoot);
AbstractRemoveUnusedValuesCodeFixProvider.cs (4)
269
return document.
WithSyntaxRoot
(root);
773
var newDocument = document.
WithSyntaxRoot
(currentRoot);
846
document = document.
WithSyntaxRoot
(rootWithTrackedNodes);
895
document = document.
WithSyntaxRoot
(rootWithRemovedDeclaration);
AbstractUseCollectionInitializerCodeFixProvider.cs (2)
78
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalObjectCreationNodes));
105
document = document.
WithSyntaxRoot
(subEditor.GetChangedRoot());
AbstractUseObjectInitializerCodeFixProvider.cs (2)
76
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalObjectCreationNodes));
108
document = document.
WithSyntaxRoot
(subEditor.GetChangedRoot());
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (1)
74
return Task.FromResult<Solution?>(constructorDocument.
WithSyntaxRoot
(newRoot).Project.Solution);
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
177
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (1)
138
return Task.FromResult(document.
WithSyntaxRoot
(newRoot));
AddFileBanner\AbstractAddFileBannerNewDocumentFormattingProvider.cs (2)
40
return document.
WithSyntaxRoot
(rootWithFileHeader);
50
return document.
WithSyntaxRoot
(rootWithBanner);
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (1)
75
var updatedDocument = newDocument.
WithSyntaxRoot
(updatedRoot);
AddImport\References\Reference.cs (1)
97
var newDocument = document.
WithSyntaxRoot
(root);
ChangeSignature\AbstractChangeSignatureService.cs (1)
420
var updatedDoc = currentSolution.GetRequiredDocument(docId).
WithSyntaxRoot
(updatedRoots[docId]);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs (1)
48
return suppressionsDoc.
WithSyntaxRoot
(suppressionsRoot);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (1)
155
var result = suppressionsDoc.
WithSyntaxRoot
(suppressionsRoot);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.LocalSuppressMessageCodeAction.cs (1)
46
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)
149
return document.
WithSyntaxRoot
(finalRoot);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (2)
635
var formattedDocument = documentWithAddedImports.
WithSyntaxRoot
(root);
849
document = document.
WithSyntaxRoot
(root);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (3)
89
document = document.
WithSyntaxRoot
(annotatedRoot);
113
document = document.
WithSyntaxRoot
(newRoot.ReplaceNode(declaration, declaration.WithAdditionalAnnotations(_annotation)));
220
var dismemberedDocument = document.
WithSyntaxRoot
(root);
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
143
var documentWithImport = document.
WithSyntaxRoot
(rootWithImport);
ConsecutiveStatementPlacementCodeFixProvider.cs (1)
61
return document.
WithSyntaxRoot
(newRoot);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
142
var updatedDocument = document.
WithSyntaxRoot
(editor.GetChangedRoot());
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
118
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
123
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)
57
return document.
WithSyntaxRoot
(root);
ConvertLinq\AbstractConvertLinqQueryToForEachProvider.cs (1)
50
c => Task.FromResult(document.
WithSyntaxRoot
(documentUpdateInfo.UpdateRoot(root))),
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (1)
155
return Task.FromResult(document.
WithSyntaxRoot
(rootWithLinqUsing));
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (1)
119
return Task.FromResult(document.
WithSyntaxRoot
(updatedRoot));
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (1)
119
return Task.FromResult(document.
WithSyntaxRoot
(newRoot));
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
253
return document.
WithSyntaxRoot
(newRoot);
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (1)
111
return Task.FromResult(document.
WithSyntaxRoot
(
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
251
return document.
WithSyntaxRoot
(newRoot).Project.Solution;
EncapsulateField\AbstractEncapsulateFieldService.cs (3)
177
document = document.
WithSyntaxRoot
(fieldDeclaration.SyntaxTree.GetRoot(cancellationToken).ReplaceNode(fieldDeclaration.GetSyntax(cancellationToken),
217
document = await Formatter.FormatAsync(document.
WithSyntaxRoot
(rewrittenFieldDeclaration), Formatter.Annotation, formattingOptions, cancellationToken).ConfigureAwait(false);
225
var updatedLinkedDocument = await Formatter.FormatAsync(linkedDocument.
WithSyntaxRoot
(updatedLinkedRoot), Formatter.Annotation, linkedDocumentFormattingOptions, cancellationToken).ConfigureAwait(false);
ExtractClass\ExtractClassWithDialogCodeAction.cs (1)
266
unformattedSolution = document.
WithSyntaxRoot
(currentRoot).Project.Solution;
ExtractInterface\AbstractExtractInterfaceService.cs (1)
361
unformattedSolution = document.
WithSyntaxRoot
(editor.GetChangedRoot()).Project.Solution;
ExtractMethod\Extensions.cs (1)
60
=> SemanticDocument.CreateAsync(semanticDocument.Document.
WithSyntaxRoot
(root), cancellationToken);
ExtractMethod\ExtractMethodResult.cs (2)
94
var annotatedDocument = DocumentWithoutFinalFormatting.
WithSyntaxRoot
(root);
100
var formattedDocument = simplifiedDocument.
WithSyntaxRoot
(
ExtractMethod\MethodExtractor.CodeGenerator.cs (1)
137
var newDocument = callSiteDocument.Document.
WithSyntaxRoot
(newSyntaxRoot);
FullyQualify\AbstractFullyQualifyService.cs (1)
221
var newDocument = document.
WithSyntaxRoot
(newRoot);
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.cs (1)
290
return document.
WithSyntaxRoot
(newRoot);
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (1)
135
var newDocument = _document.
WithSyntaxRoot
(oldRoot.ReplaceNode(oldType, newType));
GenerateMember\GenerateVariable\AbstractGenerateVariableService.GenerateLocalCodeAction.cs (1)
51
var newDocument = _document.
WithSyntaxRoot
(newRoot);
ImplementAbstractClass\ImplementAbstractClassData.cs (1)
124
return _document.
WithSyntaxRoot
(newRoot);
ImplementInterface\AbstractImplementInterfaceService.DisposePatternCodeAction.cs (2)
169
var docWithAllMembers = docWithCoreMembers.
WithSyntaxRoot
(
199
return document.
WithSyntaxRoot
(finalRoot);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (2)
381
return document.
WithSyntaxRoot
(newRoot);
520
return document.
WithSyntaxRoot
(newRoot);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
399
var currentSolution = document.
WithSyntaxRoot
(trackedRoot).Project.Solution;
IntroduceUsingStatement\AbstractIntroduceUsingStatementCodeRefactoringProvider.cs (4)
143
return document.
WithSyntaxRoot
(root.ReplaceNode(
157
return document.
WithSyntaxRoot
(root.ReplaceNode(declarationStatement, usingDeclarationStatement));
172
return document.
WithSyntaxRoot
(root.ReplaceNode(
181
return document.
WithSyntaxRoot
(root.ReplaceNode(
IntroduceVariable\AbstractIntroduceLocalForExpressionCodeRefactoringProvider.cs (1)
107
return document.
WithSyntaxRoot
(newRoot);
IntroduceVariable\AbstractIntroduceVariableService.cs (2)
456
var newDocument = semanticDocument.Document.
WithSyntaxRoot
(newRoot);
486
newDocument = newSemanticDocument.Document.
WithSyntaxRoot
(newRoot);
InvertConditional\AbstractInvertConditionalCodeRefactoringProvider.cs (1)
58
return document.
WithSyntaxRoot
(editor.GetChangedRoot());
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (1)
301
return document.
WithSyntaxRoot
(
InvertLogical\AbstractInvertLogicalCodeRefactoringProvider.cs (2)
109
return document.
WithSyntaxRoot
(root.ReplaceNode(
135
return document.
WithSyntaxRoot
(root.ReplaceNode(
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (2)
73
var sourceDoc = _document.
WithSyntaxRoot
(root);
185
oldSolution = newTypeDoc.
WithSyntaxRoot
(newTypeRoot).Project.Solution;
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
89
return document.
WithSyntaxRoot
(newRoot);
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (2)
233
return document.
WithSyntaxRoot
(newRoot);
276
return document.
WithSyntaxRoot
(newRoot);
Shared\Extensions\DocumentExtensions.cs (2)
46
return document.
WithSyntaxRoot
(newRoot);
56
return document.
WithSyntaxRoot
(newRoot);
Shared\Utilities\AnnotatedSymbolMapping.cs (1)
109
annotatedSolution = document.
WithSyntaxRoot
(root.Value).Project.Solution;
Shared\Utilities\ExtractTypeHelpers.cs (2)
46
var newDocument = document.
WithSyntaxRoot
(editor.GetChangedRoot());
109
newTypeDocument = newTypeDocument.
WithSyntaxRoot
(annotatedRoot);
Snippets\SnippetFunctionService.cs (1)
153
var documentWithAnnotations = documentWithFullyQualifiedTypeName.
WithSyntaxRoot
(updatedRoot);
Snippets\SnippetProviders\AbstractSnippetProvider.cs (3)
116
var annotatedReformattedDocument = documentWithIndentation.
WithSyntaxRoot
(reformattedRoot);
205
return snippetDocument.
WithSyntaxRoot
(root);
221
document = document.
WithSyntaxRoot
(annotatedSnippetRoot);
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
231
return document.
WithSyntaxRoot
(newRoot);
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (1)
78
return document.
WithSyntaxRoot
(newRoot);
SplitOrMergeIfStatements\AbstractSplitIfStatementCodeRefactoringProvider.cs (1)
75
return document.
WithSyntaxRoot
(newRoot);
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
149
return Task.FromResult(document.
WithSyntaxRoot
(newRoot));
Wrapping\AbstractCodeActionComputer.cs (1)
167
var newDocument = OriginalDocument.
WithSyntaxRoot
(rewrittenRoot);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (6)
VisualBasicChangeToYieldCodeFixProvider.vb (1)
49
Function(c) Task.FromResult(document.
WithSyntaxRoot
(root)),
VisualBasicConvertToIteratorCodeFixProvider.vb (2)
95
Return CodeAction.Create(title, Function(c) Task.FromResult(document.
WithSyntaxRoot
(root)), title)
103
Return CodeAction.Create(title, Function(c) Task.FromResult(document.
WithSyntaxRoot
(root)), title)
VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (2)
81
Dim trackedDocument = document.
WithSyntaxRoot
(trackedRoot)
86
Dim expandedDocument = document.
WithSyntaxRoot
(expandedRoot)
VisualBasicRemoveUnnecessaryImportsService.vb (1)
50
Return document.
WithSyntaxRoot
(newRoot)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (2)
LineCommit\CommitFormatter.vb (1)
119
finalDocument = document.
WithSyntaxRoot
(newRoot)
Utilities\CommandHandlers\AbstractImplementAbstractClassOrInterfaceCommandHandler.vb (1)
153
document = document.
WithSyntaxRoot
(syntaxRoot.ReplaceToken(token, token.WithAdditionalAnnotations(tokenAnnotation)))
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (3)
Formatting\CodeCleanUpTests.vb (3)
657
document = document.
WithSyntaxRoot
(root.RemoveNode(node.Parent, SyntaxRemoveOptions.KeepNoTrivia))
702
document = document.
WithSyntaxRoot
(root.RemoveNode(node.Parent, SyntaxRemoveOptions.KeepNoTrivia))
731
Return context.Document.
WithSyntaxRoot
(root.RemoveNode(node.Parent, SyntaxRemoveOptions.KeepNoTrivia))
Microsoft.CodeAnalysis.VisualBasic.Features (25)
AddImport\VisualBasicAddImportFeatureService.vb (1)
304
Dim newDocument = document.
WithSyntaxRoot
(newRoot)
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)
82
Dim newDocument = document.
WithSyntaxRoot
(newRoot)
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.AddKeywordAction.vb (1)
52
Return _document.
WithSyntaxRoot
(newRoot)
CodeRefactorings\RemoveStatementCodeAction.vb (1)
32
Return _document.
WithSyntaxRoot
(updatedRoot)
ExtractMethod\VisualBasicSelectionResult.vb (1)
37
Dim newDocument = Await SemanticDocument.CreateAsync(document.Document.
WithSyntaxRoot
(root.AddAnnotations(
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (2)
51
Return document.Document.
WithSyntaxRoot
(newRoot)
100
updatedDocument = updatedDocument.Project.Solution.GetDocument(currentDocument.Id).
WithSyntaxRoot
(newRoot)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceLocal.vb (4)
96
Return document.Document.
WithSyntaxRoot
(newRoot)
159
Return document.Document.
WithSyntaxRoot
(newRoot)
184
Return semanticDocument.Document.
WithSyntaxRoot
(newRoot)
194
Return semanticDocument.Document.
WithSyntaxRoot
(newRoot)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceQueryLocal.vb (2)
64
Return Task.FromResult(document.Document.
WithSyntaxRoot
(newRoot))
82
Return document.Document.
WithSyntaxRoot
(newRoot)
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))
VisualBasicChangeToYieldCodeFixProvider.vb (1)
49
Function(c) Task.FromResult(document.
WithSyntaxRoot
(root)),
VisualBasicConvertToIteratorCodeFixProvider.vb (2)
95
Return CodeAction.Create(title, Function(c) Task.FromResult(document.
WithSyntaxRoot
(root)), title)
103
Return CodeAction.Create(title, Function(c) Task.FromResult(document.
WithSyntaxRoot
(root)), title)
VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (2)
81
Dim trackedDocument = document.
WithSyntaxRoot
(trackedRoot)
86
Dim expandedDocument = document.
WithSyntaxRoot
(expandedRoot)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
CodeCleanup\Providers\AbstractTokensCodeCleanupProvider.vb (1)
27
Return If(root Is newRoot, document, document.
WithSyntaxRoot
(newRoot))
CodeCleanup\Providers\NormalizeModifiersOrOperatorsCodeCleanupProvider.vb (1)
39
Return If(root Is newRoot, document, document.
WithSyntaxRoot
(newRoot))
CodeCleanup\Providers\RemoveUnnecessaryLineContinuationCodeCleanupProvider.vb (1)
42
Return If(newRoot Is root, document, document.
WithSyntaxRoot
(newRoot))
OrganizeImports\VisualBasicOrganizeImportsService.vb (1)
24
Return document.
WithSyntaxRoot
(newRoot)
VisualBasicRemoveUnnecessaryImportsService.vb (1)
50
Return document.
WithSyntaxRoot
(newRoot)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (2)
CodeGeneration\AddImportsTests.vb (1)
61
doc = doc.
WithSyntaxRoot
(root)
Formatting\FormattingTests.vb (1)
4206
Dim newDocument = document.
WithSyntaxRoot
(
Microsoft.CodeAnalysis.Workspaces (20)
AbstractCodeGenerationService.cs (1)
257
var newDocument = oldDocument.
WithSyntaxRoot
(currentRoot);
AbstractMoveDeclarationNearReferenceService.cs (1)
113
return document.
WithSyntaxRoot
(newRoot);
CaseCorrection\AbstractCaseCorrectionService.cs (1)
40
return (root == newRoot) ? document : document.
WithSyntaxRoot
(newRoot);
CodeCleanup\AbstractCodeCleanerService.cs (1)
64
var annotatedDocument = document.
WithSyntaxRoot
(annotatedRoot);
CodeCleanup\Providers\FormatCodeCleanupProvider.cs (1)
37
: document.
WithSyntaxRoot
(result.GetFormattedRoot(cancellationToken));
CodeRefactorings\SyntaxEditorBasedCodeRefactoringProvider.cs (1)
80
return document.
WithSyntaxRoot
(newRoot);
Editing\DocumentEditor.cs (1)
57
=> _document.
WithSyntaxRoot
(this.GetChangedRoot());
Editing\ImportAdderService.cs (2)
164
return document.
WithSyntaxRoot
(root);
239
return document.
WithSyntaxRoot
(root);
Editing\SolutionEditor.cs (1)
55
var newDoc = currentDoc.
WithSyntaxRoot
(docEd.GetChangedRoot());
Formatting\Formatter.cs (3)
97
return document.
WithSyntaxRoot
(Format(root, spans, services, options, rules, cancellationToken));
118
return document.
WithSyntaxRoot
(Format(root, annotation, services, options, rules, cancellationToken));
140
return document.
WithSyntaxRoot
(Format(root, annotation, services, formattingOptions, rules, cancellationToken));
Simplification\AbstractSimplificationService.cs (4)
119
document = document.
WithSyntaxRoot
(root);
158
document = document.
WithSyntaxRoot
(root);
244
var newDocument = document.
WithSyntaxRoot
(newRoot);
321
return document.
WithSyntaxRoot
(newRoot);
SyntaxEditorBasedCodeFixProvider.cs (1)
87
return document.
WithSyntaxRoot
(newRoot);
SyntaxEditorExtensions.cs (2)
171
document = document.
WithSyntaxRoot
(originalRoot.TrackNodes(originalNodePairs.SelectMany(pair => pair.nodes.additionalNodes.Concat(pair.nodes.semanticNode))));
185
document = document.
WithSyntaxRoot
(replacementRoot);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (3)
328
var newDoc = d1.
WithSyntaxRoot
(newRoot);
2849
var doc2 = document.
WithSyntaxRoot
(gen.CompilationUnit()); // empty CU
2862
var doc3 = document.
WithSyntaxRoot
(gen.CompilationUnit()); // empty CU
Microsoft.CodeAnalysis.Workspaces.UnitTests (13)
BatchFixAllProviderTests.cs (1)
128
return document.
WithSyntaxRoot
(root.ReplaceToken(token, newToken));
CodeCleanup\CodeCleanupTests.cs (8)
138
document = document.
WithSyntaxRoot
((await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(annotation));
151
document = document.
WithSyntaxRoot
((await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(annotation));
185
return document.
WithSyntaxRoot
(root);
207
return document.
WithSyntaxRoot
(root);
229
return document.
WithSyntaxRoot
(root);
251
return document.
WithSyntaxRoot
(root);
318
document = document.
WithSyntaxRoot
(root);
366
return document.
WithSyntaxRoot
(root);
SolutionTests\SolutionTests.cs (2)
2596
var documentWithAttribute = document.
WithSyntaxRoot
(newSyntaxRoot);
3359
var newDoc = doc.
WithSyntaxRoot
(newRoot);
SyntaxNodeTests.cs (1)
116
doc = doc.
WithSyntaxRoot
(trackedRoot);
WorkspaceTests\AdhocWorkspaceTests.cs (1)
371
var newDoc = doc.
WithSyntaxRoot
(newRoot);
Microsoft.VisualStudio.LanguageServices (1)
Venus\ContainedLanguageCodeSupport.cs (1)
229
targetDocument.
WithSyntaxRoot
(newRoot), Simplifier.Annotation, options.CleanupOptions.SimplifierOptions, cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetSyntaxRootSynchronously(cancellationToken);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\SnippetExpansionClient.cs (1)
126
var newDocument = document.
WithSyntaxRoot
(newRoot);
Microsoft.VisualStudio.LanguageServices.Implementation (2)
CodeModel\AbstractCodeModelService.cs (2)
1086
document = document.
WithSyntaxRoot
(newRoot);
1131
document = document.
WithSyntaxRoot
(newRoot);
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
Snippets\SnippetExpansionClient.vb (1)
137
Dim newDocument = document.
WithSyntaxRoot
(newRoot)