26 references to WithDocumentSyntaxRoot
AnalyzerRunner (1)
CodeRefactoringRunner.cs (1)
65updatedSolution = updatedSolution.WithDocumentSyntaxRoot(document.Id, await newDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false));
IdeCoreBenchmarks (1)
FormatterBenchmarks.cs (1)
55solution = solution.WithDocumentSyntaxRoot(documentId, root);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
183return currentSolution.WithDocumentSyntaxRoot(document.Id, newRoot);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
CodeActions\PreviewTests.cs (1)
84solution = solution.WithDocumentSyntaxRoot(_oldDocument.Id, CSharpSyntaxTree.ParseText(ChangedDocumentText, cancellationToken: cancellationToken).GetRoot(cancellationToken));
Microsoft.CodeAnalysis.Features (8)
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
163solutionWithNewDocument = solutionWithNewDocument.WithDocumentSyntaxRoot(newDocumentId, modifiedRoot, PreservationMode.PreserveIdentity);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
591var updatedDocument = currentSolution.WithDocumentSyntaxRoot(docId, newRoot, PreservationMode.PreserveIdentity)
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
356updatedSolution = updatedSolution.WithDocumentSyntaxRoot(documentId, root, PreservationMode.PreserveIdentity);
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
226updatedSolution = updatedSolution.WithDocumentSyntaxRoot(originalDocument.Id, editor.GetChangedRoot()); 394return updatedSolution.WithDocumentSyntaxRoot(documentId, editor.GetChangedRoot());
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
227updatedSolution = updatedSolution.WithDocumentSyntaxRoot(originalDocument.Id, editor.GetChangedRoot()); 386return updatedSolution.WithDocumentSyntaxRoot(documentId, editor.GetChangedRoot());
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
183return currentSolution.WithDocumentSyntaxRoot(document.Id, newRoot);
Microsoft.CodeAnalysis.VisualBasic.Features (1)
ExtractInterface\VisualBasicExtractInterfaceService.vb (1)
88finalSolution = finalSolution.WithDocumentSyntaxRoot(docId, root, PreservationMode.PreserveIdentity)
Microsoft.CodeAnalysis.Workspaces (5)
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
844partiallyRenamedSolution = partiallyRenamedSolution.WithDocumentSyntaxRoot(documentId, newRoot, PreservationMode.PreserveIdentity);
Rename\ConflictEngine\MutableConflictResolution.cs (1)
86intermediateSolution = intermediateSolution.WithDocumentSyntaxRoot(documentId, newRoot, PreservationMode.PreserveIdentity);
Workspace\Solution\Document.cs (1)
408var solution = this.Project.Solution.WithDocumentSyntaxRoot(this.Id, root, PreservationMode.PreserveIdentity);
Workspace\Solution\Solution.cs (2)
989WithDocumentSyntaxRoot(documentId, syntaxRoot, preservationMode); 1377/// <inheritdoc cref="WithDocumentSyntaxRoot"/>.
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
SolutionTests\SolutionTests.cs (8)
307var newSolution1 = solution.WithDocumentSyntaxRoot(documentId, root, PreservationMode.PreserveIdentity); 314var newSolution2 = newSolution1.WithDocumentSyntaxRoot(documentId, actualRoot); 317Assert.Throws<ArgumentOutOfRangeException>(() => solution.WithDocumentSyntaxRoot(documentId, root, (PreservationMode)(-1))); 319Assert.Throws<ArgumentNullException>(() => solution.WithDocumentSyntaxRoot(null!, root)); 320Assert.Throws<InvalidOperationException>(() => solution.WithDocumentSyntaxRoot(s_unrelatedDocumentId, root)); 3194var sol2 = sol.WithDocumentSyntaxRoot(did, annotatedRoot); 3695var doc2 = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot, PreservationMode.PreserveValue).GetDocument(doc.Id); 5472var newDoc = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot).GetDocument(doc.Id);