45 references to WithDocumentSyntaxRoot
AnalyzerRunner (1)
CodeRefactoringRunner.cs (1)
66
updatedSolution = updatedSolution.
WithDocumentSyntaxRoot
(document.Id, await newDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false));
IdeCoreBenchmarks (1)
FormatterBenchmarks.cs (1)
54
solution = solution.
WithDocumentSyntaxRoot
(documentId, root);
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
149
solution = solution.
WithDocumentSyntaxRoot
(document.Id, newRoot);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
183
return currentSolution.
WithDocumentSyntaxRoot
(document.Id, newRoot);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
82
solution = solution.
WithDocumentSyntaxRoot
(documentId, editor.GetChangedRoot());
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (3)
255
return currentSolution.
WithDocumentSyntaxRoot
(fieldDocument.Id, finalFieldRoot);
273
var updatedSolution = currentSolution.
WithDocumentSyntaxRoot
(fieldDocument.Id, newFieldTreeRoot);
274
updatedSolution = updatedSolution.
WithDocumentSyntaxRoot
(propertyDocument.Id, newPropertyTreeRoot);
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.CSharp.Features (1)
GenerateType\CSharpGenerateTypeService.cs (1)
752
updatedSolution = updatedSolution.
WithDocumentSyntaxRoot
(document.Id, addedCompilationRoot, PreservationMode.PreserveIdentity);
Microsoft.CodeAnalysis.EditorFeatures (2)
InlineRename\InlineRenameSession.cs (1)
947
? finalSolution.
WithDocumentSyntaxRoot
(documentId, newRoot)
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
160
finalSolution = finalSolution.
WithDocumentSyntaxRoot
(docId, root);
Microsoft.CodeAnalysis.Features (19)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
144
currentSolution = currentSolution.
WithDocumentSyntaxRoot
(document.Id, newRoot);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (2)
89
solution = solution.
WithDocumentSyntaxRoot
(
104
return solution.
WithDocumentSyntaxRoot
(
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
592
var updatedDocument = currentSolution.
WithDocumentSyntaxRoot
(docId, newRoot, PreservationMode.PreserveIdentity)
GenerateType\AbstractGenerateTypeService.Editor.cs (2)
356
updatedSolution = updatedSolution.
WithDocumentSyntaxRoot
(documentId, root, PreservationMode.PreserveIdentity);
445
var updatedSolution = solution.
WithDocumentSyntaxRoot
(generateTypeOptionsResult.ExistingDocument.Id, newRoot, PreservationMode.PreserveIdentity);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
460
finalSolution = finalSolution.
WithDocumentSyntaxRoot
(
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (2)
181
oldSolution = oldSolution.
WithDocumentSyntaxRoot
(sourceDocId, oldSourceRoot);
241
updatedSolution = updatedSolution.
WithDocumentSyntaxRoot
(docId, updatedRoot);
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
226
updatedSolution = updatedSolution.
WithDocumentSyntaxRoot
(originalDocument.Id, editor.GetChangedRoot());
394
return updatedSolution.
WithDocumentSyntaxRoot
(documentId, editor.GetChangedRoot());
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
227
updatedSolution = updatedSolution.
WithDocumentSyntaxRoot
(originalDocument.Id, editor.GetChangedRoot());
390
return updatedSolution.
WithDocumentSyntaxRoot
(documentId, editor.GetChangedRoot());
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
149
solution = solution.
WithDocumentSyntaxRoot
(document.Id, newRoot);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
183
return currentSolution.
WithDocumentSyntaxRoot
(document.Id, newRoot);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
82
solution = solution.
WithDocumentSyntaxRoot
(documentId, editor.GetChangedRoot());
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (3)
255
return currentSolution.
WithDocumentSyntaxRoot
(fieldDocument.Id, finalFieldRoot);
273
var updatedSolution = currentSolution.
WithDocumentSyntaxRoot
(fieldDocument.Id, newFieldTreeRoot);
274
updatedSolution = updatedSolution.
WithDocumentSyntaxRoot
(propertyDocument.Id, newPropertyTreeRoot);
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
484
newSolution = newSolution.
WithDocumentSyntaxRoot
(oldDocument.Id, editScripts[documentIndex].Match.NewRoot, PreservationMode.PreserveIdentity);
Microsoft.CodeAnalysis.Workspaces (4)
Rename\ConflictEngine\MutableConflictResolution.cs (1)
186
return solution.
WithDocumentSyntaxRoot
(documentId, newRoot, PreservationMode.PreserveIdentity);
Workspace\Solution\Document.cs (1)
408
var solution = this.Project.Solution.
WithDocumentSyntaxRoot
(this.Id, root, PreservationMode.PreserveIdentity);
Workspace\Solution\Solution.cs (2)
993
WithDocumentSyntaxRoot
(documentId, syntaxRoot, preservationMode);
1381
/// <inheritdoc cref="
WithDocumentSyntaxRoot
"/>.
Microsoft.CodeAnalysis.Workspaces.UnitTests (9)
SolutionTests\SolutionTests.cs (9)
307
var newSolution1 = solution.
WithDocumentSyntaxRoot
(documentId, root, PreservationMode.PreserveIdentity);
314
var newSolution2 = newSolution1.
WithDocumentSyntaxRoot
(documentId, actualRoot);
317
Assert.Throws<ArgumentOutOfRangeException>(() => solution.
WithDocumentSyntaxRoot
(documentId, root, (PreservationMode)(-1)));
319
Assert.Throws<ArgumentNullException>(() => solution.
WithDocumentSyntaxRoot
(null!, root));
320
Assert.Throws<InvalidOperationException>(() => solution.
WithDocumentSyntaxRoot
(s_unrelatedDocumentId, root));
3194
var solution2 = solution1.
WithDocumentSyntaxRoot
(documentId, newRoot);
3222
var sol2 = sol.
WithDocumentSyntaxRoot
(did, annotatedRoot);
3727
var doc2 = doc.Project.Solution.
WithDocumentSyntaxRoot
(doc.Id, newRoot, PreservationMode.PreserveValue).GetDocument(doc.Id);
5485
var newDoc = doc.Project.Solution.
WithDocumentSyntaxRoot
(doc.Id, newRoot).GetDocument(doc.Id);