27 references to WithDocumentSyntaxRoot
AnalyzerRunner (1)
CodeRefactoringRunner.cs (1)
65
updatedSolution = updatedSolution.
WithDocumentSyntaxRoot
(document.Id, await newDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false));
IdeCoreBenchmarks (1)
FormatterBenchmarks.cs (1)
55
solution = solution.
WithDocumentSyntaxRoot
(documentId, root);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
183
return currentSolution.
WithDocumentSyntaxRoot
(document.Id, newRoot);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
CodeActions\PreviewTests.cs (1)
84
solution = solution.
WithDocumentSyntaxRoot
(_oldDocument.Id, CSharpSyntaxTree.ParseText(ChangedDocumentText, cancellationToken: cancellationToken).GetRoot(cancellationToken));
Microsoft.CodeAnalysis.Features (9)
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
144
solutionWithNewDocument = solutionWithNewDocument.
WithDocumentSyntaxRoot
(newDocumentId, modifiedRoot, PreservationMode.PreserveIdentity);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
592
var updatedDocument = currentSolution.
WithDocumentSyntaxRoot
(docId, newRoot, PreservationMode.PreserveIdentity)
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
357
updatedSolution = updatedSolution.
WithDocumentSyntaxRoot
(documentId, root, PreservationMode.PreserveIdentity);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
509
return currentSolution.
WithDocumentSyntaxRoot
(document.Id, editor.GetChangedRoot());
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
226
updatedSolution = updatedSolution.
WithDocumentSyntaxRoot
(originalDocument.Id, editor.GetChangedRoot());
394
return updatedSolution.
WithDocumentSyntaxRoot
(documentId, editor.GetChangedRoot());
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
234
updatedSolution = updatedSolution.
WithDocumentSyntaxRoot
(originalDocument.Id, editor.GetChangedRoot());
394
return updatedSolution.
WithDocumentSyntaxRoot
(documentId, editor.GetChangedRoot());
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
183
return currentSolution.
WithDocumentSyntaxRoot
(document.Id, newRoot);
Microsoft.CodeAnalysis.VisualBasic.Features (1)
ExtractInterface\VisualBasicExtractInterfaceService.vb (1)
88
finalSolution = finalSolution.
WithDocumentSyntaxRoot
(docId, root, PreservationMode.PreserveIdentity)
Microsoft.CodeAnalysis.Workspaces (5)
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
847
partiallyRenamedSolution = partiallyRenamedSolution.
WithDocumentSyntaxRoot
(documentId, newRoot, PreservationMode.PreserveIdentity);
Rename\ConflictEngine\MutableConflictResolution.cs (1)
86
intermediateSolution = 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)
981
WithDocumentSyntaxRoot
(documentId, syntaxRoot, preservationMode);
1369
/// <inheritdoc cref="
WithDocumentSyntaxRoot
"/>.
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
SolutionTests\SolutionTests.cs (8)
309
var newSolution1 = solution.
WithDocumentSyntaxRoot
(documentId, root, PreservationMode.PreserveIdentity);
316
var newSolution2 = newSolution1.
WithDocumentSyntaxRoot
(documentId, actualRoot);
319
Assert.Throws<ArgumentOutOfRangeException>(() => solution.
WithDocumentSyntaxRoot
(documentId, root, (PreservationMode)(-1)));
321
Assert.Throws<ArgumentNullException>(() => solution.
WithDocumentSyntaxRoot
(null!, root));
322
Assert.Throws<InvalidOperationException>(() => solution.
WithDocumentSyntaxRoot
(s_unrelatedDocumentId, root));
3193
var sol2 = sol.
WithDocumentSyntaxRoot
(did, annotatedRoot);
3694
var doc2 = doc.Project.Solution.
WithDocumentSyntaxRoot
(doc.Id, newRoot, PreservationMode.PreserveValue).GetDocument(doc.Id);
5439
var newDoc = doc.Project.Solution.
WithDocumentSyntaxRoot
(doc.Id, newRoot).GetDocument(doc.Id);