206 references to WithSyntaxRoot
Microsoft.AspNetCore.App.CodeFixes (7)
Authorization\AddAuthorizationBuilderFixer.cs (1)
138return Task.FromResult(document.WithSyntaxRoot(
DetectMismatchedParameterOptionalityFixer.cs (1)
49return document.WithSyntaxRoot(root.ReplaceNode(parameterSyntax, newParam));
Http\HeaderDictionaryAddFixer.cs (2)
74return Task.FromResult(document.WithSyntaxRoot( 103return Task.FromResult(document.WithSyntaxRoot(root.ReplaceNode(diagnosticTarget, assignment)));
Http\HeaderDictionaryIndexerFixer.cs (1)
60return document.WithSyntaxRoot(root.ReplaceNode(elementAccessExpressionSyntax, newExpression));
RouteParameterUnusedParameterFixer.cs (1)
99return document.WithSyntaxRoot(updatedSyntaxTree);
WebApplicationBuilderFixer.cs (1)
81return Task.FromResult(document.WithSyntaxRoot(root.ReplaceNode(diagnosticTarget, invocation)));
Microsoft.AspNetCore.Components.Analyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
57return Task.FromResult(document.WithSyntaxRoot(newSyntaxRoot));
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Verifiers\CodeFixVerifier.cs (1)
109document = document.WithSyntaxRoot(Formatter.Format(document.GetSyntaxRootAsync().Result, Formatter.Annotation, document.Project.Solution.Workspace));
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
57return Task.FromResult(document.WithSyntaxRoot(newSyntaxRoot));
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Verifiers\CodeFixVerifier.cs (1)
109document = document.WithSyntaxRoot(Formatter.Format(document.GetSyntaxRootAsync().Result, Formatter.Annotation, document.Project.Solution.Workspace));
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
AddResponseTypeAttributeCodeFixAction.cs (1)
124return document.WithSyntaxRoot(root);
Microsoft.CodeAnalysis.CodeStyle.Fixes (27)
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
102return Task.FromResult(document.WithSyntaxRoot(root.ReplaceNode(finalTarget, replacement)));
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (1)
65return Task.FromResult(document.WithSyntaxRoot(newRoot));
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (1)
76token => Task.FromResult(otherDocument.WithSyntaxRoot(newRoot)),
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (1)
122return document.WithSyntaxRoot(newRoot);
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
83return document.WithSyntaxRoot(newRoot);
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
47=> document.WithSyntaxRoot(await GetTransformedSyntaxRootAsync(document, cancellationToken).ConfigureAwait(false));
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (1)
114return document.WithSyntaxRoot(finalRoot);
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (1)
197var newDocument = document.WithSyntaxRoot(newRoot);
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
109var newDocument = document.WithSyntaxRoot(newRoot);
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
57return document.WithSyntaxRoot(newRoot);
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
60return document.WithSyntaxRoot(newRoot);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (4)
282return document.WithSyntaxRoot(root); 785var newDocument = document.WithSyntaxRoot(currentRoot); 853document = document.WithSyntaxRoot(rootWithTrackedNodes); 902document = document.WithSyntaxRoot(rootWithRemovedDeclaration);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
78document.WithSyntaxRoot(originalRoot.TrackNodes(originalNodes.Select(static t => t.diagnosticNode))),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
80return document.WithSyntaxRoot(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
253var newDocument = oldDocument.WithSyntaxRoot(currentRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
163return document.WithSyntaxRoot(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (2)
171document = document.WithSyntaxRoot(originalRoot.TrackNodes(originalNodePairs.SelectMany(pair => pair.nodes.additionalNodes.Concat(pair.nodes.semanticNode)))); 185document = document.WithSyntaxRoot(replacementRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
113return document.WithSyntaxRoot(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (4)
118document = document.WithSyntaxRoot(root); 156document = document.WithSyntaxRoot(root); 257var newDocument = document.WithSyntaxRoot(newRoot); 326return document.WithSyntaxRoot(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
37var newDocument = this.Document.WithSyntaxRoot(root);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (12)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (2)
44var updatedDocument = document.WithSyntaxRoot(updatedRoot); 246var updatedDocument = document.WithSyntaxRoot(updatedRoot);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
83_ => Task.FromResult(document.WithSyntaxRoot(root)),
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (4)
78newDocument = document.WithSyntaxRoot(root.ReplaceNode(node, newMethodDeclarationSyntax)); 84newDocument = document.WithSyntaxRoot(root.ReplaceNode(node, newOperator)); 90newDocument = document.WithSyntaxRoot(root.ReplaceNode(oldAccessor, oldAccessor.WithType(newReturnType))); 96newDocument = document.WithSyntaxRoot(root.ReplaceNode(oldIndexer, oldIndexer.WithType(newReturnType)));
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
37return document.WithSyntaxRoot(syntaxEditor.GetChangedRoot());
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
58return document.WithSyntaxRoot(newRoot);
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
85return document.WithSyntaxRoot(newRoot);
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
58return document.WithSyntaxRoot(editor.GetChangedRoot());
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
94return document.WithSyntaxRoot(editor.GetChangedRoot());
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
236documentWithNameAndAnnotationsAdded.WithSyntaxRoot(updatedRoot), Simplifier.Annotation, cleanupOptions.SimplifierOptions, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
CodeGeneration\SyntaxGeneratorTests.cs (1)
46var newDocument = document.WithSyntaxRoot(newRoot);
Diagnostics\FixAllProvider\BatchFixerTests.cs (1)
84var newDocument = context.Document.WithSyntaxRoot(newRoot);
Formatting\CodeCleanupTests.TestFixers.cs (1)
40return context.Document.WithSyntaxRoot(newRoot);
Microsoft.CodeAnalysis.CSharp.Features (31)
AddImport\CSharpAddImportFeatureService.cs (1)
344return document.WithSyntaxRoot(newRoot);
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (2)
226document = document.WithSyntaxRoot(editor.GetChangedRoot()); 252return document.WithSyntaxRoot(editor.GetChangedRoot());
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (1)
126return document.WithSyntaxRoot(newRoot);
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (2)
598document = document.WithSyntaxRoot(editor.OriginalRoot.TrackNodes(nodes)); 617document = document.WithSyntaxRoot(replacementFunc(root));
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (1)
56return document.WithSyntaxRoot(newRoot);
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
44return document.WithSyntaxRoot(rootWithGlobalStatements);
DecompiledSource\CSharpDecompiledSourceService.cs (1)
104return document.WithSyntaxRoot(newSyntaxRoot);
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
67document = document.WithSyntaxRoot(root); 88document = document.WithSyntaxRoot(root);
ExtractMethod\CSharpMethodExtractor.cs (1)
192document = document.WithSyntaxRoot(root.ReplaceNode(originalMethodDefinition, methodDefinition));
Formatting\CSharpAccessibilityModifiersNewDocumentFormattingProvider.cs (1)
75return document.WithSyntaxRoot(editor.GetChangedRoot());
MetadataAsSource\CSharpMetadataAsSourceService.cs (2)
67return document.WithSyntaxRoot(newSyntaxRoot); 121return document.WithSyntaxRoot(newRoot);
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
304return document.WithSyntaxRoot(editor.GetChangedRoot());
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (2)
44var updatedDocument = document.WithSyntaxRoot(updatedRoot); 246var updatedDocument = document.WithSyntaxRoot(updatedRoot);
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
83_ => Task.FromResult(document.WithSyntaxRoot(root)),
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (4)
78newDocument = document.WithSyntaxRoot(root.ReplaceNode(node, newMethodDeclarationSyntax)); 84newDocument = document.WithSyntaxRoot(root.ReplaceNode(node, newOperator)); 90newDocument = document.WithSyntaxRoot(root.ReplaceNode(oldAccessor, oldAccessor.WithType(newReturnType))); 96newDocument = document.WithSyntaxRoot(root.ReplaceNode(oldIndexer, oldIndexer.WithType(newReturnType)));
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (1)
37return document.WithSyntaxRoot(syntaxEditor.GetChangedRoot());
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
58return document.WithSyntaxRoot(newRoot);
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (1)
85return document.WithSyntaxRoot(newRoot);
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
58return document.WithSyntaxRoot(editor.GetChangedRoot());
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
94return document.WithSyntaxRoot(editor.GetChangedRoot());
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (2)
172return document.WithSyntaxRoot(newRoot); 254document = document.WithSyntaxRoot(currentRoot);
UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeRefactoringProvider.cs (1)
208return document.WithSyntaxRoot(newRoot);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
OrganizeImports\CSharpOrganizeImportsService.cs (1)
32return document.WithSyntaxRoot(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.cs (1)
68return document.WithSyntaxRoot(formattedRoot);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.cs (1)
55doc = doc.WithSyntaxRoot(root);
Microsoft.CodeAnalysis.EditorFeatures (1)
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
192var documentWithOriginalName = document.WithSyntaxRoot(syntaxTreeWithOriginalName.GetRoot(cancellationToken));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
CodeGeneration\CodeGenerationTests.cs (6)
95testContext.Result = testContext.Document.WithSyntaxRoot(newRoot); 316testContext.Result = testContext.Document.WithSyntaxRoot((await testContext.Document.GetSyntaxRootAsync()).ReplaceNode(oldSyntax, newSyntax)); 332testContext.Result = testContext.Document.WithSyntaxRoot((await testContext.Document.GetSyntaxRootAsync()).ReplaceNode(oldMemberSyntax, newMemberSyntax)); 543testContext.Result = testContext.Document.WithSyntaxRoot(testContext.SemanticModel.SyntaxTree.GetRoot().ReplaceNode(oldNode, newNode)); 562testContext.Result = testContext.Document.WithSyntaxRoot(testContext.SemanticModel.SyntaxTree.GetRoot().ReplaceNode(declarationNode, newNode)); 614testContext.Result = testContext.Document.WithSyntaxRoot(testContext.SemanticModel.SyntaxTree.GetRoot().ReplaceNode(declarationNode, updatedDeclarationNode));
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
CodeFixes\CodeFixServiceTests.vb (2)
230context.RegisterCodeFix(CodeAction.Create("FIX_TEST0000", Function(ct) Task.FromResult(context.Document.WithSyntaxRoot(root))), context.Diagnostics) 255context.RegisterCodeFix(CodeAction.Create("FIX_TEST1111", Function(ct) Task.FromResult(context.Document.WithSyntaxRoot(root))), context.Diagnostics)
Simplification\ParameterSimplificationTests.vb (1)
26Dim annotatedDocument = document.WithSyntaxRoot(
Microsoft.CodeAnalysis.Features (41)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
176return document.WithSyntaxRoot(editor.GetChangedRoot());
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (1)
73var updatedDocument = newDocument.WithSyntaxRoot(updatedRoot);
AddImport\References\Reference.cs (1)
96var newDocument = document.WithSyntaxRoot(root);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.LocalSuppressMessageCodeAction.cs (1)
34return _document.WithSyntaxRoot(newRoot);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (2)
62return document.WithSyntaxRoot(newRoot); 267document = document.WithSyntaxRoot(root);
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (1)
140return document.WithSyntaxRoot(finalRoot);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
140var updatedDocument = document.WithSyntaxRoot(editor.GetChangedRoot());
ConvertAnonymousType\AbstractConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (1)
116return document.WithSyntaxRoot(editor.GetChangedRoot());
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
121return document.WithSyntaxRoot(newRoot);
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
425return document.WithSyntaxRoot(newRoot);
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
382return document.WithSyntaxRoot(editor.GetChangedRoot());
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
198document = document.WithSyntaxRoot(editor.OriginalRoot.TrackNodes(ifStatements));
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (1)
155return Task.FromResult(document.WithSyntaxRoot(rootWithLinqUsing));
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (1)
127return Task.FromResult(document.WithSyntaxRoot(updatedRoot));
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (1)
110return Task.FromResult(document.WithSyntaxRoot(
EncapsulateField\AbstractEncapsulateFieldService.cs (2)
180document = document.WithSyntaxRoot(fieldDeclaration.SyntaxTree.GetRoot(cancellationToken).ReplaceNode(fieldDeclaration.GetSyntax(cancellationToken), 203document = await Formatter.FormatAsync(document.WithSyntaxRoot(rewrittenFieldDeclaration), Formatter.Annotation, formattingOptions, cancellationToken).ConfigureAwait(false);
ExtractInterface\AbstractExtractInterfaceService.cs (1)
351unformattedSolution = document.WithSyntaxRoot(editor.GetChangedRoot()).Project.Solution;
FullyQualify\AbstractFullyQualifyService.cs (1)
223var newDocument = document.WithSyntaxRoot(newRoot);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
380return document.WithSyntaxRoot(newRoot);
InvertConditional\AbstractInvertConditionalCodeRefactoringProvider.cs (1)
58return document.WithSyntaxRoot(editor.GetChangedRoot());
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (1)
300return document.WithSyntaxRoot(
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
88return document.WithSyntaxRoot(newRoot);
Shared\Extensions\DocumentExtensions.cs (2)
41return document.WithSyntaxRoot(newRoot); 51return document.WithSyntaxRoot(newRoot);
Shared\Utilities\ExtractTypeHelpers.cs (1)
46var newDocument = document.WithSyntaxRoot(editor.GetChangedRoot());
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
201document = document.WithSyntaxRoot(annotatedSnippetRoot);
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
225return document.WithSyntaxRoot(newRoot);
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (1)
78return document.WithSyntaxRoot(newRoot);
SplitOrMergeIfStatements\AbstractSplitIfStatementCodeRefactoringProvider.cs (1)
75return document.WithSyntaxRoot(newRoot);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (1)
76token => Task.FromResult(otherDocument.WithSyntaxRoot(newRoot)),
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractRemoveDocCommentNodeCodeFixProvider.cs (1)
83return document.WithSyntaxRoot(newRoot);
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
47=> document.WithSyntaxRoot(await GetTransformedSyntaxRootAsync(document, cancellationToken).ConfigureAwait(false));
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (1)
77return context.Document.WithSyntaxRoot(formattedRoot);
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (1)
57return document.WithSyntaxRoot(newRoot);
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (1)
60return document.WithSyntaxRoot(newRoot);
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
785var newDocument = document.WithSyntaxRoot(currentRoot); 902document = document.WithSyntaxRoot(rootWithRemovedDeclaration);
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
147return Task.FromResult(document.WithSyntaxRoot(newRoot));
Wrapping\AbstractCodeActionComputer.cs (1)
166var newDocument = OriginalDocument.WithSyntaxRoot(rewrittenRoot);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (4)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
49Function(c) Task.FromResult(document.WithSyntaxRoot(root)),
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (2)
95Return CodeAction.Create(title, Function(c) Task.FromResult(document.WithSyntaxRoot(root)), title) 103Return CodeAction.Create(title, Function(c) Task.FromResult(document.WithSyntaxRoot(root)), title)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
80Dim trackedDocument = document.WithSyntaxRoot(trackedRoot)
Microsoft.CodeAnalysis.VisualBasic.Features (14)
CodeFixes\CorrectNextControlVariable\CorrectNextControlVariableCodeFixProvider.CodeAction.vb (1)
32Return _document.WithSyntaxRoot(updatedRoot)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.AddKeywordCodeAction.vb (1)
43Return _document.WithSyntaxRoot(updatedRoot)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.ReplaceKeywordCodeAction.vb (1)
42Return _document.WithSyntaxRoot(updatedRoot)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.ReplaceTokenKeywordCodeAction.vb (1)
35Return _document.WithSyntaxRoot(rootWithoutToken)
CodeFixes\IncorrectFunctionReturnType\IncorrectFunctionReturnTypeCodeFixProvider.vb (1)
82Dim newDocument = document.WithSyntaxRoot(newRoot)
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.AddKeywordAction.vb (1)
50Return _document.WithSyntaxRoot(newRoot)
CodeRefactorings\RemoveStatementCodeAction.vb (1)
32Return _document.WithSyntaxRoot(updatedRoot)
MetadataAsSource\VisualBasicMetadataAsSourceService.vb (2)
51Return document.WithSyntaxRoot(newRoot) 64Return document.WithSyntaxRoot(newSyntaxRoot)
Organizing\VisualBasicOrganizerService.vb (1)
25Return document.WithSyntaxRoot(rewriter.Visit(root))
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
49Function(c) Task.FromResult(document.WithSyntaxRoot(root)),
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (2)
95Return CodeAction.Create(title, Function(c) Task.FromResult(document.WithSyntaxRoot(root)), title) 103Return CodeAction.Create(title, Function(c) Task.FromResult(document.WithSyntaxRoot(root)), title)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
80Dim trackedDocument = document.WithSyntaxRoot(trackedRoot)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
CodeCleanup\Providers\AbstractTokensCodeCleanupProvider.vb (1)
27Return If(root Is newRoot, document, document.WithSyntaxRoot(newRoot))
OrganizeImports\VisualBasicOrganizeImportsService.vb (1)
24Return document.WithSyntaxRoot(newRoot)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicRemoveUnnecessaryImportsService.vb (1)
47Return document.WithSyntaxRoot(newRoot)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.vb (1)
61doc = doc.WithSyntaxRoot(root)
Microsoft.CodeAnalysis.Workspaces (20)
CaseCorrection\AbstractCaseCorrectionService.cs (1)
38return (root == newRoot) ? document : document.WithSyntaxRoot(newRoot);
CodeCleanup\AbstractCodeCleanerService.cs (1)
63var annotatedDocument = document.WithSyntaxRoot(annotatedRoot);
CodeCleanup\Providers\FormatCodeCleanupProvider.cs (1)
29: document.WithSyntaxRoot(result.GetFormattedRoot(cancellationToken));
CodeRefactorings\SyntaxEditorBasedCodeRefactoringProvider.cs (1)
76return document.WithSyntaxRoot(newRoot);
Editing\DocumentEditor.cs (1)
54=> OriginalDocument.WithSyntaxRoot(this.GetChangedRoot());
Formatting\Formatter.cs (3)
96return document.WithSyntaxRoot(Format(root, spans, services, options, rules, cancellationToken)); 117return document.WithSyntaxRoot(Format(root, annotation, services, options, rules, cancellationToken)); 139return document.WithSyntaxRoot(Format(root, annotation, services, formattingOptions, rules, cancellationToken));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
78document.WithSyntaxRoot(originalRoot.TrackNodes(originalNodes.Select(static t => t.diagnosticNode))),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
80return document.WithSyntaxRoot(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
253var newDocument = oldDocument.WithSyntaxRoot(currentRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
163return document.WithSyntaxRoot(root);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxEditorExtensions.cs (2)
171document = document.WithSyntaxRoot(originalRoot.TrackNodes(originalNodePairs.SelectMany(pair => pair.nodes.additionalNodes.Concat(pair.nodes.semanticNode)))); 185document = document.WithSyntaxRoot(replacementRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
113return document.WithSyntaxRoot(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (4)
118document = document.WithSyntaxRoot(root); 156document = document.WithSyntaxRoot(root); 257var newDocument = document.WithSyntaxRoot(newRoot); 326return document.WithSyntaxRoot(newRoot);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\SyntacticDocument.cs (1)
37var newDocument = this.Document.WithSyntaxRoot(root);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (3)
VisualStudioMSBuildWorkspaceTests.cs (3)
343var newDoc = d1.WithSyntaxRoot(newRoot); 2884var doc2 = document.WithSyntaxRoot(gen.CompilationUnit()); // empty CU 2897var doc3 = document.WithSyntaxRoot(gen.CompilationUnit()); // empty CU
Microsoft.CodeAnalysis.Workspaces.UnitTests (13)
BatchFixAllProviderTests.cs (1)
128return document.WithSyntaxRoot(root.ReplaceToken(token, newToken));
CodeCleanup\CodeCleanupTests.cs (8)
135document = document.WithSyntaxRoot((await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(annotation)); 148document = document.WithSyntaxRoot((await document.GetSyntaxRootAsync()).WithAdditionalAnnotations(annotation)); 181return document.WithSyntaxRoot(root); 202return document.WithSyntaxRoot(root); 223return document.WithSyntaxRoot(root); 244return document.WithSyntaxRoot(root); 311document = document.WithSyntaxRoot(root); 358return document.WithSyntaxRoot(root);
SolutionTests\SolutionTests.cs (2)
3101var documentWithAttribute = document.WithSyntaxRoot(newSyntaxRoot); 3855var newDoc = doc.WithSyntaxRoot(newRoot);
SyntaxNodeTests.cs (1)
116doc = doc.WithSyntaxRoot(trackedRoot);
WorkspaceTests\AdhocWorkspaceTests.cs (1)
347var newDoc = doc.WithSyntaxRoot(newRoot);
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckNameofFixProvider.cs (2)
173return document.WithSyntaxRoot(newRoot); 184return document.WithSyntaxRoot(newRoot);
Microsoft.VisualStudio.LanguageServices (1)
Venus\ContainedLanguageCodeSupport.cs (1)
227targetDocument.WithSyntaxRoot(newRoot), Simplifier.Annotation, options.CleanupOptions.SimplifierOptions, cancellationToken).WaitAndGetResult_Venus(cancellationToken).GetSyntaxRootSynchronously(cancellationToken);
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
240return document.WithSyntaxRoot(root.ReplaceNode(typeDeclarationOrCompilationUnit, newTypeDeclarationOrCompilationUnit));
System.Windows.Forms.Analyzers.CodeFixes.CSharp (2)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (2)
105document = document.WithSyntaxRoot(root); 147document = document.WithSyntaxRoot(
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (2)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (2)
119document = document.WithSyntaxRoot(root) 163document = document.WithSyntaxRoot(