53 references to WithDocumentSyntaxRoot
AnalyzerRunner (1)
CodeRefactoringRunner.cs (1)
66updatedSolution = updatedSolution.WithDocumentSyntaxRoot(document.Id, await newDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false));
IdeCoreBenchmarks (1)
FormatterBenchmarks.cs (1)
55solution = solution.WithDocumentSyntaxRoot(documentId, root);
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
185return currentSolution.WithDocumentSyntaxRoot(document.Id, newRoot);
AbstractUnsealClassCodeFixProvider.cs (1)
82solution = solution.WithDocumentSyntaxRoot(documentId, editor.GetChangedRoot());
AddParameterService.cs (1)
141solution = solution.WithDocumentSyntaxRoot(document.Id, newRoot);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
CodeActions\Preview\PreviewTests.cs (1)
88solution = solution.WithDocumentSyntaxRoot(_oldDocument.Id, CSharpSyntaxTree.ParseText(ChangedDocumentText, cancellationToken: cancellationToken).GetRoot(cancellationToken));
Microsoft.CodeAnalysis.CSharp.Features (2)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
76solution = solution.WithDocumentSyntaxRoot(document.Id, updatedDocumentRoot);
GenerateType\CSharpGenerateTypeService.cs (1)
805updatedSolution = updatedSolution.WithDocumentSyntaxRoot(document.Id, addedCompilationRoot, PreservationMode.PreserveIdentity);
Microsoft.CodeAnalysis.EditorFeatures (2)
InlineRename\InlineRenameSession.cs (1)
935finalSolution = finalSolution.WithDocumentSyntaxRoot(id, root);
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
158finalSolution = finalSolution.WithDocumentSyntaxRoot(docId, root);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
EditAndContinue\EditAndContinueTestHelpers.cs (1)
409newSolution = newSolution.WithDocumentSyntaxRoot(oldDocument.Id, editScripts[documentIndex].Match.NewRoot, PreservationMode.PreserveIdentity);
Microsoft.CodeAnalysis.Features (24)
AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
185return currentSolution.WithDocumentSyntaxRoot(document.Id, newRoot);
AbstractUnsealClassCodeFixProvider.cs (1)
82solution = solution.WithDocumentSyntaxRoot(documentId, editor.GetChangedRoot());
AddParameterService.cs (1)
141solution = solution.WithDocumentSyntaxRoot(document.Id, newRoot);
ChangeSignature\AbstractChangeSignatureService.cs (1)
427currentSolution = currentSolution.WithDocumentSyntaxRoot(docId, (await formattedDoc.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false))!);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
145currentSolution = currentSolution.WithDocumentSyntaxRoot(document.Id, newRoot);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (3)
91solution = solution.WithDocumentSyntaxRoot( 109return solution.WithDocumentSyntaxRoot( 151solutionWithNewDocument = solutionWithNewDocument.WithDocumentSyntaxRoot(newDocumentId, modifiedRoot, PreservationMode.PreserveIdentity);
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
493originalSolution = originalSolution.WithDocumentSyntaxRoot(
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
584var updatedDocument = currentSolution.WithDocumentSyntaxRoot(docId, newRoot, PreservationMode.PreserveIdentity)
EncapsulateField\AbstractEncapsulateFieldService.cs (1)
193solution = solution.WithDocumentSyntaxRoot(linkedDocumentId, updatedRoot);
GenerateType\AbstractGenerateTypeService.Editor.cs (2)
363updatedSolution = updatedSolution.WithDocumentSyntaxRoot(documentId, root, PreservationMode.PreserveIdentity); 454var updatedSolution = solution.WithDocumentSyntaxRoot(generateTypeOptionsResult.ExistingDocument.Id, newRoot, PreservationMode.PreserveIdentity);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (2)
523currentSolution = currentSolution.WithDocumentSyntaxRoot( 529return currentSolution.WithDocumentSyntaxRoot(document.Id, editor.GetChangedRoot());
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
245modifiedSolution = modifiedSolution.WithDocumentSyntaxRoot(document.Id, newRoot);
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (1)
236updatedSolution = updatedSolution.WithDocumentSyntaxRoot(docId, updatedRoot);
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
230updatedSolution = updatedSolution.WithDocumentSyntaxRoot(originalDocument.Id, editor.GetChangedRoot()); 399return updatedSolution.WithDocumentSyntaxRoot(documentId, editor.GetChangedRoot());
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
235updatedSolution = updatedSolution.WithDocumentSyntaxRoot(originalDocument.Id, editor.GetChangedRoot()); 393return updatedSolution.WithDocumentSyntaxRoot(documentId, editor.GetChangedRoot());
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (3)
216return solution.WithDocumentSyntaxRoot(fieldDocument.Id, newRoot); 231var updatedSolution = solution.WithDocumentSyntaxRoot(fieldDocument.Id, newFieldTreeRoot); 232updatedSolution = updatedSolution.WithDocumentSyntaxRoot(propertyDocument.Id, newPropertyTreeRoot);
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\ConvertTupleToStructCodeRefactoringProvider\RemoteConvertTupleToStructCodeRefactoringService.cs (1)
102final = final.WithDocumentSyntaxRoot(docId, cleanedRoot);
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (1)
CodeActions\Preview\PreviewTests.vb (1)
62solution = solution.WithDocumentSyntaxRoot(_oldDocument.Id, VisualBasicSyntaxTree.ParseText(s_changedDocumentText).GetRoot())
Microsoft.CodeAnalysis.VisualBasic.Features (2)
ExtractInterface\VisualBasicExtractInterfaceService.vb (1)
87finalSolution = finalSolution.WithDocumentSyntaxRoot(docId, docToRootMap(docId), PreservationMode.PreserveIdentity)
GenerateType\VisualBasicGenerateTypeService.vb (1)
677updatedSolution = updatedSolution.WithDocumentSyntaxRoot(document.Id, addedCompilationRoot, PreservationMode.PreserveIdentity)
Microsoft.CodeAnalysis.Workspaces (5)
CodeFixesAndRefactorings\DocumentBasedFixAllProviderHelpers.cs (1)
95? currentSolution.WithDocumentSyntaxRoot(docId, newRoot)
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
840partiallyRenamedSolution = partiallyRenamedSolution.WithDocumentSyntaxRoot(documentId, newRoot, PreservationMode.PreserveIdentity);
Rename\ConflictEngine\MutableConflictResolution.cs (1)
98intermediateSolution = intermediateSolution.WithDocumentSyntaxRoot(documentId, newRoot, PreservationMode.PreserveIdentity);
Workspace\Solution\Document.cs (1)
337=> this.Project.Solution.WithDocumentSyntaxRoot(this.Id, root, PreservationMode.PreserveIdentity).GetDocument(this.Id)!;
Workspace\Solution\Solution.cs (1)
1048WithDocumentSyntaxRoot(documentId, syntaxRoot, preservationMode);
Microsoft.CodeAnalysis.Workspaces.UnitTests (9)
SolutionTests\SolutionTests.cs (9)
285var newSolution1 = solution.WithDocumentSyntaxRoot(documentId, root, PreservationMode.PreserveIdentity); 292var newSolution2 = newSolution1.WithDocumentSyntaxRoot(documentId, actualRoot); 295Assert.Throws<ArgumentOutOfRangeException>(() => solution.WithDocumentSyntaxRoot(documentId, root, (PreservationMode)(-1))); 297Assert.Throws<ArgumentNullException>(() => solution.WithDocumentSyntaxRoot(null!, root)); 298Assert.Throws<InvalidOperationException>(() => solution.WithDocumentSyntaxRoot(s_unrelatedDocumentId, root)); 2517var solution2 = solution1.WithDocumentSyntaxRoot(documentId, newRoot); 2545var sol2 = sol.WithDocumentSyntaxRoot(did, annotatedRoot); 3056var doc2 = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot, PreservationMode.PreserveValue).GetDocument(doc.Id); 4310var newDoc = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot).GetDocument(doc.Id);