2 overrides of WithChanges
Microsoft.CodeAnalysis (1)
Text\ChangedText.cs (1)
152public override SourceText WithChanges(IEnumerable<TextChange> changes)
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.SnapshotSourceText.cs (1)
184public override SourceText WithChanges(IEnumerable<TextChange> changes)
149 references to WithChanges
GenerateDocumentationAndConfigFiles (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
63=> WithChangedText(Text.WithChanges(changes), cancellationToken);
Metrics (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
Metrics.Legacy (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
Microsoft.AspNetCore.Razor.Test.Common.Tooling (1)
AssertExtensions.cs (1)
46text = text.WithChanges(textDocumentEdit.Edits.Select(e => text.GetTextChange((TextEdit)e)));
Microsoft.CodeAnalysis (4)
Text\ChangedText.cs (1)
157var changed = _newText.WithChanges(changes) as ChangedText;
Text\SourceText.cs (3)
806return WithChanges(changes); 869/// Changes do not have to be in sorted order. However, <see cref="WithChanges(IEnumerable{TextChange})"/> will 876return this.WithChanges((IEnumerable<TextChange>)changes);
Microsoft.CodeAnalysis.Analyzers (3)
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (1)
143var newText = text.WithChanges(textChanges);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
63=> WithChangedText(Text.WithChanges(changes), cancellationToken);
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
Microsoft.CodeAnalysis.BannedApiAnalyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
63=> WithChangedText(Text.WithChanges(changes), cancellationToken);
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (2)
324var finalText = text.WithChanges(edits); 444var finalText = text.WithChanges(edits);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
63=> WithChangedText(Text.WithChanges(changes), cancellationToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (2)
125var dedentedText = text.WithChanges(changes); 209var dedentedText = text.WithChanges(changes);
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
59var changedText = text.WithChanges(edits);
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
60var changedText = text.WithChanges(edits);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
StringCopyPaste\StringCopyPasteCommandHandler.cs (1)
139var newTextAfterChanges = snapshotBeforePaste.AsText().WithChanges(textChanges);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
StringIndentation\StringIndentationTests.cs (1)
61var changedText = text.WithChanges(changes);
Microsoft.CodeAnalysis.CSharp.Features (8)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (2)
62var formattedText = context.Document.Text.WithChanges(formattingChanges); 158var newText = oldDocument.Text.WithChanges(changes);
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (1)
122var newText = text.WithChanges(builder);
Copilot\CSharpCopilotProposalAdjusterService.cs (1)
53var fixedDocument = forkedDocument.WithText(newText.WithChanges(insertCloseBraceTextChanges));
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (2)
125var dedentedText = text.WithChanges(changes); 209var dedentedText = text.WithChanges(changes);
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
59var changedText = text.WithChanges(edits);
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
60var changedText = text.WithChanges(edits);
Microsoft.CodeAnalysis.EditorFeatures (2)
ExternalAccess\IntelliCode\IntentProcessor.cs (1)
59var originalDocument = currentDocument.WithText(currentText.WithChanges(intentRequestContext.PriorTextEdits));
Shared\Extensions\WorkspaceExtensions.cs (1)
50var newText = oldText.WithChanges(textChanges);
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.SnapshotSourceText.cs (1)
201return base.WithChanges(changes);
Microsoft.CodeAnalysis.Features (13)
AddImport\CodeActions\AddImportCodeAction.cs (1)
62var newText = oldText.WithChanges(_textChanges);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (1)
107var newText = currentText.WithChanges(orderedChanges);
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (2)
117var newText = text.WithChanges(insertionOnlyChanges); 177var newText = text.WithChanges(textChanges);
Completion\Providers\AbstractAwaitCompletionProvider.cs (1)
243var newText = text.WithChanges(builder);
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
173var newText = text.WithChanges(builder);
Completion\Providers\Snippets\AbstractSnippetCompletionProvider.cs (1)
39var allChangesText = strippedText.WithChanges(snippetChange.TextChanges);
Copilot\CopilotChangeAnalysisUtilities.cs (1)
37/// passed to <see cref="SourceText.WithChanges(IEnumerable{TextChange})"/> for the text snapshot corresponding to
Copilot\CopilotUtilities.cs (1)
29var newText = oldText.WithChanges(changes);
FullyQualify\AbstractFullyQualifyCodeFixProvider.cs (1)
48var newText = sourceText.WithChanges(d.TextChanges);
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
195originalText = originalText.WithChanges(snippets);
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (2)
324var finalText = text.WithChanges(edits); 444var finalText = text.WithChanges(edits);
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
Snippets\AbstractSnippetProviderTests.cs (1)
75var originalText = documentSourceText.WithChanges(snippetChange.TextChanges).ToString();
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Handler\DocumentChanges\DidChangeHandler.cs (1)
71text = text.WithChanges(newChanges);
Handler\Formatting\AbstractFormatDocumentHandlerBase.cs (1)
52var formattedDocument = document.WithText(text.WithChanges(formattingChanges));
Handler\InlineCompletions\InlineCompletionsHandler.cs (2)
196var formattedText = documentWithSnippetText.WithChanges(formattingChanges); 230var formattedLspSnippetText = formattedText.GetSubText(spanContainingFormattedSnippet).WithChanges(lspTextChanges);
Handler\OnAutoInsert\OnAutoInsertHandler.cs (2)
186var newSourceText = sourceText.WithChanges(textChanges); 245documentText = documentText.WithChanges(textChanges);
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
Utilities\AbstractLanguageServerClientTests.TestLspClient.cs (1)
248var updatedDocument = document.WithChanges(changes);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
63=> WithChangedText(Text.WithChanges(changes), cancellationToken);
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
Microsoft.CodeAnalysis.Razor.Workspaces (21)
DocumentMapping\RazorEditService.cs (1)
59var newCSharpSourceText = originalCSharpSourceText.WithChanges(skippedEdits.Select(static c => c.ToTextChange()));
Extensions\SourceTextExtensions.cs (2)
74var changedText = text.WithChanges(changes); 311originalTextWithChanges = text.WithChanges(changes);
Formatting\CSharpFormatter.cs (1)
302var changedText = context.CSharpSourceText.WithChanges(changes.ToImmutable());
Formatting\Passes\CSharpFormattingPass.cs (2)
34var changedText = context.SourceText.WithChanges(changes); 148return generatedCSharpText.WithChanges(csharpChanges);
Formatting\Passes\CSharpOnTypeFormattingPass.cs (3)
144cleanedText = formattedText.WithChanges(cleanupChanges); 200cleanedText = cleanedText.WithChanges(indentationChanges); 212var newText = oldText.WithChanges(changes);
Formatting\Passes\FormattingDiagnosticValidationPass.cs (1)
30var changedText = text.WithChanges(changes);
Formatting\Passes\HtmlFormattingPass.cs (4)
63var htmlWithChanges = htmlSourceText.WithChanges(changes); 79changedText = changedText.WithChanges(filteredChanges); 97var formattedText = originalText.WithChanges(changes); 113formattedText = originalText.WithChanges(changes);
Formatting\Passes\HtmlOnTypeFormattingPass.cs (2)
40changedText = originalText.WithChanges(filteredChanges); 51changedText = changedText.WithChanges(indentationChanges);
Formatting\Passes\RazorFormattingPass.cs (2)
35changedText = changedText.WithChanges(changes); 48changedText = changedText.WithChanges(razorChanges);
Formatting\RazorFormattingService.cs (1)
347var changedText = sourceText.WithChanges(changes);
Formatting\SnippetFormatter.cs (1)
54var newSnippetSourceText = snippetSourceText.WithChanges(indentationChanges.ToImmutable());
TextDifferencing\SourceTextDiffer.cs (1)
123Debug.Assert(oldText.WithChanges(changes).ContentEquals(newText), "Incorrect minimal changes");
Microsoft.CodeAnalysis.Razor.Workspaces.UnitTests (2)
TextDifferencing\SourceTextDifferTest.cs (2)
39var changedText = oldText.WithChanges(characterChanges); 69var changedText = oldText.WithChanges(wordChanges);
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\AssetSynchronization\RemoteAssetSynchronizationService.cs (1)
96var newText = text.WithChanges(textChanges);
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
Microsoft.CodeAnalysis.UnitTests (15)
Text\TextChangeTests.cs (15)
1012var change1 = originalText.WithChanges(oldChangesBuilder); 1031var change2 = change1.WithChanges(newChangesBuilder); 1035Assert.Equal(originalText.WithChanges(textChanges).ToString(), change2.ToString()); 1076Assert.Equal("bb34", originalText.WithChanges(changes).ToString()); 1090Assert.Equal(change2.ToString(), original.WithChanges(changes).ToString()); 1104Assert.Equal("bb1234", originalText.WithChanges(changes).ToString()); 1117Assert.Equal("bbbaa12aa4", originalText.WithChanges(changes).ToString()); 1131Assert.Equal("4bbaa5", originalText.WithChanges(changes).ToString()); 1145Assert.Equal("baababbbbbaabbbbba7", originalText.WithChanges(changes).ToString()); 1159Assert.Equal("b1b4", originalText.WithChanges(changes).ToString()); 1173Assert.Equal("bab234", originalText.WithChanges(changes).ToString()); 1187Assert.Equal("bbb5", originalText.WithChanges(changes).ToString()); 1201Assert.Equal("6", originalText.WithChanges(changes).ToString()); 1215Assert.Equal("5", originalText.WithChanges(changes).ToString()); 1229Assert.Equal("14", originalText.WithChanges(changes).ToString());
Microsoft.CodeAnalysis.Workspaces (10)
CodeCleanup\Providers\FormatCodeCleanupProvider.cs (2)
28? document.WithText(oldText.WithChanges(result.GetTextChanges(cancellationToken))) 39? root.SyntaxTree.WithChangedText(oldText.WithChanges(result.GetTextChanges(cancellationToken))).GetRootAsync(cancellationToken)
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (1)
76var newText = oldText.WithChanges(changesToApply);
LinkedFileDiffMerging\AbstractLinkedFileMergeConflictCommentAdditionService.cs (1)
76var newText = oldText.WithChanges(adjustedChanges);
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (2)
126return new LinkedFileMergeResult(linkedDocuments, firstOldSourceText.WithChanges(allTextChangesAcrossLinkedFiles), []); 132return new LinkedFileMergeResult(linkedDocuments, firstOldSourceText.WithChanges(allChanges), mergeConflictResolutionSpans);
Remote\RemoteUtilities.cs (1)
72var newText = oldText.WithChanges(tuple.textChanges);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
63=> WithChangedText(Text.WithChanges(changes), cancellationToken);
Workspace\Workspace.cs (1)
2011this.ApplyDocumentTextChanged(documentId, oldText.WithChanges(textChanges));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
Formatting\FormattingTestBase.cs (2)
90var resultText = sourceText.WithChanges(result); 129var actual = sourceText.WithChanges(result).ToString();
GenerateFileForEachAdditionalFileWithContentsCommented.cs (1)
33var generatedText = sourceText.WithChanges(changes);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
SemanticSearch\SemanticSearchQueryExecutor.cs (1)
80newSolution = newSolution.WithDocumentText(documentId, oldText.WithChanges(changes));
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (20)
Cohost\CohostOnTypeFormattingEndpointTest.cs (1)
170var finalText = inputText.WithChanges(changes);
Cohost\CohostRangeFormattingEndpointTest.cs (1)
212var finalText = inputText.WithChanges(changes);
Cohost\CohostRoslynCodeActionTest.cs (1)
744.WithChanges(
Cohost\CohostRoslynRenameTest.cs (1)
399inputText = inputText.WithChanges(changes);
Cohost\CohostWrapWithTagEndpointTest.cs (1)
228var changedDoc = sourceText.WithChanges(result.TextEdits.Select(sourceText.GetTextChange));
Cohost\Formatting\FormattingLogTest.cs (1)
105var formattedText = sourceText.WithChanges(edits.Select(sourceText.GetTextChange));
Cohost\Formatting\FormattingTestBase.cs (1)
91var finalText = inputText.WithChanges(changes);
Cohost\OrganizeUsingsCommandTest.cs (2)
631var result = sourceText.WithChanges(edits).ToString(); 648var result = sourceText.WithChanges(edits).ToString();
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\Html\HtmlCodeActionProviderTest.cs (1)
123var changed = text.WithChanges(documentEdits[0].Edits.Select(e => text.GetTextChange((TextEdit)e)));
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\Html\HtmlCodeActionResolverTest.cs (1)
85var changed = text.WithChanges(documentEdits[0].Edits.Select(e => text.GetTextChange((TextEdit)e)));
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostDocumentCompletionEndpointTest.cs (1)
1687changedText = changedText.WithChanges(result.AdditionalTextEdits.Select(changedText.GetTextChange));
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostInlayHintEndpointTest.cs (1)
267inputText = inputText.WithChanges(changes);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\DocumentFormattingTestBase.cs (3)
84var htmlEdited = source.WithChanges(htmlChanges); 85var htmlEditedLegacy = source.WithChanges(htmlChangesResult ?? []); 106var finalText = inputText.WithChanges(changes);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\HtmlFormattingPassTest.cs (1)
129var newDoc = sourceText.WithChanges(edits);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\HtmlFormattingTest.cs (1)
697var finalText = inputText.WithChanges(changes);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\RazorFormattingServiceTest.cs (1)
38var multiEditChange = sourceText.WithChanges(changes);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Mapping\RazorEditServiceTest.cs (1)
2039var newRazorSourceText = razorSourceText.WithChanges(responseTextChanges);
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Features\InlineRename\XamlEditorInlineRenameService.cs (1)
171var newSource = oldSource.WithChanges(group.Select(l => new TextChange(l.TextSpan, replacementText)));
Microsoft.VisualStudioCode.RazorExtension.UnitTests (9)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\Html\HtmlCodeActionProviderTest.cs (1)
123var changed = text.WithChanges(documentEdits[0].Edits.Select(e => text.GetTextChange((TextEdit)e)));
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\Html\HtmlCodeActionResolverTest.cs (1)
85var changed = text.WithChanges(documentEdits[0].Edits.Select(e => text.GetTextChange((TextEdit)e)));
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostDocumentCompletionEndpointTest.cs (1)
1687changedText = changedText.WithChanges(result.AdditionalTextEdits.Select(changedText.GetTextChange));
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostInlayHintEndpointTest.cs (1)
267inputText = inputText.WithChanges(changes);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\DocumentFormattingTestBase.cs (1)
106var finalText = inputText.WithChanges(changes);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\HtmlFormattingPassTest.cs (1)
129var newDoc = sourceText.WithChanges(edits);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\HtmlFormattingTest.cs (1)
697var finalText = inputText.WithChanges(changes);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\RazorFormattingServiceTest.cs (1)
38var multiEditChange = sourceText.WithChanges(changes);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Mapping\RazorEditServiceTest.cs (1)
2039var newRazorSourceText = razorSourceText.WithChanges(responseTextChanges);
Roslyn.Diagnostics.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
63=> WithChangedText(Text.WithChanges(changes), cancellationToken);
Test.Utilities (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
Text.Analyzers (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
172var updatedSourceText = Text.WithChanges(changes);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
63=> WithChangedText(Text.WithChanges(changes), cancellationToken);