27 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 (9)
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
144solutionWithNewDocument = solutionWithNewDocument.WithDocumentSyntaxRoot(newDocumentId, modifiedRoot, PreservationMode.PreserveIdentity);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
592var updatedDocument = currentSolution.WithDocumentSyntaxRoot(docId, newRoot, PreservationMode.PreserveIdentity)
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
357updatedSolution = updatedSolution.WithDocumentSyntaxRoot(documentId, root, PreservationMode.PreserveIdentity);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
509return currentSolution.WithDocumentSyntaxRoot(document.Id, editor.GetChangedRoot());
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
226updatedSolution = updatedSolution.WithDocumentSyntaxRoot(originalDocument.Id, editor.GetChangedRoot()); 394return updatedSolution.WithDocumentSyntaxRoot(documentId, editor.GetChangedRoot());
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
234updatedSolution = updatedSolution.WithDocumentSyntaxRoot(originalDocument.Id, editor.GetChangedRoot()); 394return 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)
847partiallyRenamedSolution = partiallyRenamedSolution.WithDocumentSyntaxRoot(documentId, newRoot, PreservationMode.PreserveIdentity);
Rename\ConflictEngine\MutableConflictResolution.cs (1)
86intermediateSolution = intermediateSolution.WithDocumentSyntaxRoot(documentId, newRoot, PreservationMode.PreserveIdentity);
Workspace\Solution\Document.cs (1)
398=> this.Project.Solution.WithDocumentSyntaxRoot(this.Id, root, PreservationMode.PreserveIdentity).GetRequiredDocument(Id);
Workspace\Solution\Solution.cs (2)
981WithDocumentSyntaxRoot(documentId, syntaxRoot, preservationMode); 1369/// <inheritdoc cref="WithDocumentSyntaxRoot"/>.
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
SolutionTests\SolutionTests.cs (8)
309var newSolution1 = solution.WithDocumentSyntaxRoot(documentId, root, PreservationMode.PreserveIdentity); 316var newSolution2 = newSolution1.WithDocumentSyntaxRoot(documentId, actualRoot); 319Assert.Throws<ArgumentOutOfRangeException>(() => solution.WithDocumentSyntaxRoot(documentId, root, (PreservationMode)(-1))); 321Assert.Throws<ArgumentNullException>(() => solution.WithDocumentSyntaxRoot(null!, root)); 322Assert.Throws<InvalidOperationException>(() => solution.WithDocumentSyntaxRoot(s_unrelatedDocumentId, root)); 3193var sol2 = sol.WithDocumentSyntaxRoot(did, annotatedRoot); 3694var doc2 = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot, PreservationMode.PreserveValue).GetDocument(doc.Id); 5439var newDoc = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot).GetDocument(doc.Id);