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)
95 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.CodeAnalysis (4)
Text\ChangedText.cs (1)
157var changed = _newText.WithChanges(changes) as ChangedText;
Text\SourceText.cs (3)
783return WithChanges(changes); 846/// Changes do not have to be in sorted order. However, <see cref="WithChanges(IEnumerable{TextChange})"/> will 853return 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)
60var changedText = text.WithChanges(edits);
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
61var 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 (7)
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);
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)
60var changedText = text.WithChanges(edits);
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
61var 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)
116var newText = text.WithChanges(insertionOnlyChanges); 176var newText = text.WithChanges(textChanges);
Completion\Providers\AbstractAwaitCompletionProvider.cs (1)
231var newText = text.WithChanges(builder);
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
164var newText = text.WithChanges(builder);
Completion\Providers\Snippets\AbstractSnippetCompletionProvider.cs (1)
39var allChangesText = strippedText.WithChanges(snippetChange.TextChanges);
Copilot\CopilotChangeAnalysisUtilities.cs (1)
35/// passed to <see cref="SourceText.WithChanges(IEnumerable{TextChange})"/> for the text snapshot corresponding to
Copilot\ICopilotChangeAnalysisService.cs (1)
94var newText = oldText.WithChanges(changes);
FullyQualify\AbstractFullyQualifyCodeFixProvider.cs (1)
41var newText = sourceText.WithChanges(d.TextChanges);
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
192originalText = 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)
73var documentTextAfterSnippet = documentSourceText.WithChanges(snippetChange.TextChanges);
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)
169var newSourceText = sourceText.WithChanges(textChanges); 227documentText = documentText.WithChanges(textChanges);
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
Utilities\AbstractLanguageServerClientTests.TestLspClient.cs (1)
239var 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.Remote.ServiceHub (1)
Services\AssetSynchronization\RemoteAssetSynchronizationService.cs (1)
97var 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.VisualBasic.Workspaces.UnitTests (1)
Formatting\FormattingTests.vb (1)
3023Dim document2 = document.WithText((Await document.GetTextAsync()).WithChanges(result))
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)
2045this.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.Xaml (1)
Features\InlineRename\XamlEditorInlineRenameService.cs (1)
171var newSource = oldSource.WithChanges(group.Select(l => new TextChange(l.TextSpan, replacementText)));
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);