200 references to WithChanges
IdeCoreBenchmarks (5)
IncrementalSourceGeneratorBenchmarks.cs (1)
167var changedText = sourceText.WithChanges(new TextChange(sourceText.Lines[0].Span, $"// added text{i}"));
SyntacticChangeRangeBenchmark.cs (4)
54var newText = _text.WithChanges(new TextChange(new TextSpan(_index + 8, 1), "m")); 63var newText = _text.WithChanges(new TextChange(new TextSpan(_index, 0), "var v = x ")); 72var newText = _text.WithChanges(new TextChange(new TextSpan(0, addedText.Length), addedText)); 81var newText = _text.WithChanges(new TextChange(new TextSpan(_text.Length - addedText.Length, addedText.Length), addedText));
Microsoft.CodeAnalysis (1)
Text\SourceText.cs (1)
861return this.WithChanges(new TextChange(span, newText));
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
64=> WithChangedText(Text.WithChanges(change), cancellationToken);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
264newText = newText.WithChanges(textChange);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenTupleTest.cs (1)
22617var newText = text.WithChanges(new TextChange(new TextSpan(pos, 0), " ")); // add space before closing-paren
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\BindingAwaitTests.cs (1)
30SourceText newText = text.WithChanges(change);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\Metadata\MetadataTypeTests.cs (2)
367var newIText = oldIText.WithChanges(change); 382newIText = oldIText.WithChanges(change);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (44)
IncrementalParsing\IncrementalParsingTests.cs (42)
498text = text.WithChanges(change); 530text = text.WithChanges(change); 575text = text.WithChanges(new TextChange(prefixSpan, ""), new TextChange(suffixSpan, "")); 627var withOpenBraceDeletedText = initialText.WithChanges(new TextChange(openBraceLine.SpanIncludingLineBreak, "")); 838var withCloseBraceDeletedText = withOpenBraceDeletedText.WithChanges(new TextChange(closeBraceLine.SpanIncludingLineBreak, "")); 965var newText = text.WithChanges(new TextChange(new TextSpan(0, 8), "")); 979var newText = text.WithChanges(new TextChange(new TextSpan(0, 8), "")); 2747var text2 = text.WithChanges( 2770var newText = oldText.WithChanges(new TextChange(new TextSpan(0, 0), "{")); 2786var newText = oldText.WithChanges(new TextChange(new TextSpan(0, 0), @"System.Console.WriteLine(false) 2845var newText = oldText.WithChanges(new TextChange(new TextSpan(0, 0), @"if (false) 2903var newIText = oldIText.WithChanges(change); 2917newIText = oldIText.WithChanges(change); 2987currIText = currIText.WithChanges(change); 3023currIText = currIText.WithChanges(change); 3101var newText = oldText.WithChanges(change); // f is a method decl parameter 3200text = text.WithChanges(change); 3221text = text.WithChanges(change); 3242text = text.WithChanges(change); 3263text = text.WithChanges(change); 3284text = text.WithChanges(change); 3306text = text.WithChanges(change); 3330text = text.WithChanges(change); 3354text = text.WithChanges(change); 3378text = text.WithChanges(change); 3402text = text.WithChanges(change); 3426text = text.WithChanges(change); 3452text = text.WithChanges(change); 3477text = text.WithChanges(change); 3503text = text.WithChanges(change); 3529text = text.WithChanges(change); 3547text = text.WithChanges(change); 3565text = text.WithChanges(change); 3583text = text.WithChanges(change); 3597text = text.WithChanges(change); 3611text = text.WithChanges(change); 3626text = text.WithChanges(change); 3663text = text.WithChanges(change); 3687text = text.WithChanges( 3726var newText = oldText.WithChanges( 3738var newText = oldText.WithChanges(new TextChange(new TextSpan(locationOfChange, widthOfChange), "")); 3764var newText = oldText.WithChanges(new TextChange(new TextSpan(oldText.Length, 0), newChar.ToString()));
Syntax\SyntaxNodeTests.cs (2)
909var tree2 = tree1.WithChangedText(tree1.GetText().WithChanges(new TextChange(default, " "))); 920var tree2 = tree1.WithChangedText(tree1.GetText().WithChanges(new TextChange(new TextSpan(22, 0), " return; ")));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
SyntaxTreeExtensions.cs (1)
20var newFullText = oldFullText.WithChanges(new TextChange(new TextSpan(offset, length), newText));
Microsoft.CodeAnalysis.EditorFeatures (7)
EditorConfigSettings\Updater\NamingStyles\NamingStyleSettingsUpdater.cs (1)
101return sourceText.WithChanges(textChange);
EditorConfigSettings\Updater\NamingStyles\SourceTextExtensions.cs (1)
60return sourceText.WithChanges(textChange);
EditorConfigSettings\Updater\SettingsUpdateHelper.cs (4)
220return (editorConfigText.WithChanges(textChange), lastValidHeaderSpanEnd, lastValidSpecificHeaderSpanEnd); 306return (editorConfigText.WithChanges(new TextChange(new TextSpan(lastValidSpecificHeaderSpanEnd.Value.Span.End, 0), newEntry)), lastValidHeaderSpanEnd, lastValidSpecificHeaderSpanEnd); 315return (editorConfigText.WithChanges(new TextChange(new TextSpan(lastValidHeaderSpanEnd.Value.Span.End, 0), newEntry)), lastValidHeaderSpanEnd, lastValidSpecificHeaderSpanEnd); 349var result = editorConfigText.WithChanges(new TextChange(new TextSpan(editorConfigText.Length, 0), prefix + newEntry));
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
189var newFullText = fullText.WithChanges(textChange);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
Completion\AbstractCompletionProviderTests.cs (3)
657var newText = text.WithChanges(commit.TextChange); 758text = text.WithChanges(textChange); 764text = text.WithChanges(textChange);
Microsoft.CodeAnalysis.Features (5)
CodeFixes\Configuration\ConfigurationUpdater.cs (4)
667return (result.WithChanges(textChange), lastValidHeaderSpanEnd, lastValidSpecificHeaderSpanEnd); 721return result.WithChanges(textChange); 731return result.WithChanges(textChange); 769return result.WithChanges(textChange);
Wrapping\AbstractCodeActionComputer.cs (1)
89var newSourceText = OriginalSourceText.WithChanges(
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
ExternalAccess\Razor\SimplifyMethodHandler.cs (1)
56var newSourceText = originalSourceText.WithChanges(pendingChange);
Handler\DocumentChanges\DidChangeHandler.cs (1)
77text = text.WithChanges(ProtocolConversions.ContentChangeEventToTextChange(change, text));
Handler\InlineCompletions\InlineCompletionsHandler.cs (2)
189var documentWithSnippetText = originalSourceText.WithChanges(textChange); 261originalSourceText.WithChanges(new TextChange(snippetSpan, parsedSnippet.DefaultText)));
Handler\OnAutoInsert\OnAutoInsertHandler.cs (1)
220var indentedText = textToIndent.WithChanges(new TextChange(new TextSpan(lineToIndent.End, 0), indentText));
Microsoft.CodeAnalysis.UnitTests (82)
Text\SourceTextTests.cs (1)
193var changed = text.WithChanges(change);
Text\TextChangeTests.cs (81)
87var newText = text.WithChanges( 104Assert.Throws<ArgumentException>(() => text.WithChanges(changes)); 117var newText = text.WithChanges(changes); 132var newText = text.WithChanges(changes); 141var newText = text.WithChanges( 153var newText = text.WithChanges( 170var newText = text.WithChanges(changes); 179var newText = text.WithChanges( 190var newText = text.WithChanges( 205var newText = text.WithChanges( 215var newText = text.WithChanges( 239var newText = text.WithChanges(changes); 270var changedText = SourceText.From(originalText).WithChanges(changes); 636var change1 = original.WithChanges(new TextChange(new TextSpan(5, 6), string.Empty)); // prepare a ChangedText instance 637var change2 = change1.WithChanges(); // this should not cause exception 647var change1 = original.WithChanges(new TextChange(new TextSpan(5, 6), string.Empty)); // prepare a ChangedText instance 648var change2 = change1.WithChanges(new TextChange(new TextSpan(2, 0), string.Empty)); // this should not cause exception 657var change1 = original.WithChanges(new TextChange(new TextSpan(6, 0), "Cruel ")); 658var change2 = change1.WithChanges(new TextChange(new TextSpan(7, 3), "oo")); 672var change1 = original.WithChanges(new TextChange(new TextSpan(1, 3), "aa")); 673var change2 = change1.WithChanges(new TextChange(new TextSpan(2, 0), "bb")); 686var change1 = original.WithChanges(new TextChange(new TextSpan(1, 1), "aaa")); 687var change2 = change1.WithChanges(new TextChange(new TextSpan(3, 0), "bb")); 700var change1 = original.WithChanges(new TextChange(new TextSpan(1, 3), "aa")); 701var change2 = change1.WithChanges(new TextChange(new TextSpan(2, 1), "bb")); 713var change1 = original.WithChanges(new TextChange(new TextSpan(6, 0), "Cruel ")); 714var change2 = change1.WithChanges(new TextChange(new TextSpan(2, 14), "ar")); 727var change1 = original.WithChanges(new TextChange(new TextSpan(6, 0), "Cruel ")); 728var change2 = change1.WithChanges(new TextChange(new TextSpan(4, 6), " Bel")); 741var change1 = original.WithChanges(new TextChange(new TextSpan(6, 0), "Cruel ")); 742var change2 = change1.WithChanges(new TextChange(new TextSpan(7, 6), "wazy V")); 755var change1 = original.WithChanges(new TextChange(new TextSpan(1, 0), "aa")); 756var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 0), "bb")); 768var change1 = original.WithChanges(new TextChange(new TextSpan(1, 3), "aa")); 769var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 0), "bb")); 781var change1 = original.WithChanges(new TextChange(new TextSpan(1, 0), "aa")); 782var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 1), "bb")); 794var change1 = original.WithChanges(new TextChange(new TextSpan(1, 0), "aa")); 795var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 2), "bb")); 807var change1 = original.WithChanges(new TextChange(new TextSpan(1, 0), "aa")); 808var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 3), "bb")); 821var change1 = original.WithChanges(new TextChange(new TextSpan(1, 3), "aa")); 822var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 1), "bb")); 835var change1 = original.WithChanges(new TextChange(new TextSpan(1, 3), "aa")); 836var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 3), "bb")); 847var change1 = original.WithChanges(new TextChange(new TextSpan(4, 0), "o ")); 848var change2 = change1.WithChanges(new TextChange(new TextSpan(6, 0), "World")); 861var change1 = original.WithChanges(new TextChange(new TextSpan(4, 0), "o")); 862var change2 = change1.WithChanges(new TextChange(new TextSpan(6, 0), "World")); 877var change1 = original.WithChanges(new TextChange(new TextSpan(8, 0), "l")); 878var change2 = change1.WithChanges(new TextChange(new TextSpan(4, 0), "o")); 893var change1 = original.WithChanges(new TextChange(new TextSpan(4, 0), " World")); 895var change2 = change1.WithChanges(new TextChange(new TextSpan(4, 0), "o")); 911c => c.WithChanges(new TextChange(new TextSpan(4, 0), "o ")), 912c => c.WithChanges(new TextChange(new TextSpan(6, 0), "World"))); 1047var change1 = originalText.WithChanges(new TextChange(new TextSpan(0, 2), "a")); 1048var change2 = change1.WithChanges(new TextChange(new TextSpan(0, 2), "bb")); 1061var change1 = original.WithChanges(new TextChange(new TextSpan(0, 0), "aa"), new TextChange(new TextSpan(1, 1), "aa")); 1062var change2 = change1.WithChanges(new TextChange(new TextSpan(0, 1), "b"), new TextChange(new TextSpan(2, 2), "")); 1075var change1 = originalText.WithChanges(new TextChange(new TextSpan(0, 0), "a")); 1076var change2 = change1.WithChanges(new TextChange(new TextSpan(0, 2), ""), new TextChange(new TextSpan(2, 0), "bb")); 1089var change1 = originalText.WithChanges(new TextChange(new TextSpan(0, 1), "aa"), new TextChange(new TextSpan(3, 1), "aa")); 1090var change2 = change1.WithChanges(new TextChange(new TextSpan(0, 0), "bbb")); 1102var change1 = originalText.WithChanges(new TextChange(new TextSpan(0, 3), "a"), new TextChange(new TextSpan(5, 0), "aaa")); 1103var change2 = change1.WithChanges(new TextChange(new TextSpan(0, 2), ""), new TextChange(new TextSpan(3, 1), "bb")); 1116var change1 = originalText.WithChanges(new TextChange(new TextSpan(0, 1), "aaaaa"), new TextChange(new TextSpan(3, 1), "aaaa"), new TextChange(new TextSpan(6, 1), "aaaaa")); 1117var change2 = change1.WithChanges(new TextChange(new TextSpan(0, 0), "b"), new TextChange(new TextSpan(2, 0), "b"), new TextChange(new TextSpan(3, 4), "bbbbb"), new TextChange(new TextSpan(9, 5), "bbbbb"), new TextChange(new TextSpan(15, 3), "")); 1130var change1 = originalText.WithChanges(new TextChange(new TextSpan(0, 1), "a")); 1131var change2 = change1.WithChanges(new TextChange(new TextSpan(0, 1), "b"), new TextChange(new TextSpan(2, 2), "b")); 1144var change1 = originalText.WithChanges(new TextChange(new TextSpan(0, 1), "aa")); 1145var change2 = change1.WithChanges(new TextChange(new TextSpan(0, 0), "b"), new TextChange(new TextSpan(1, 2), "b")); 1158var change1 = originalText.WithChanges(new TextChange(new TextSpan(0, 2), "a"), new TextChange(new TextSpan(3, 2), "a")); 1159var change2 = change1.WithChanges(new TextChange(new TextSpan(0, 3), "bbb")); 1172var change1 = originalText.WithChanges(new TextChange(new TextSpan(0, 4), ""), new TextChange(new TextSpan(5, 1), "")); 1173var change2 = change1.WithChanges(new TextChange(new TextSpan(0, 1), ""), new TextChange(new TextSpan(1, 0), "")); 1186var change1 = originalText.WithChanges(new TextChange(new TextSpan(0, 2), ""), new TextChange(new TextSpan(3, 1), ""), new TextChange(new TextSpan(4, 0), ""), new TextChange(new TextSpan(4, 0), ""), new TextChange(new TextSpan(4, 0), "")); 1187var change2 = change1.WithChanges(new TextChange(new TextSpan(0, 1), ""), new TextChange(new TextSpan(1, 1), ""), new TextChange(new TextSpan(2, 0), "")); 1200var change1 = originalText.WithChanges(new TextChange(new TextSpan(0, 1), ""), new TextChange(new TextSpan(2, 1), "")); 1201var change2 = change1.WithChanges(new TextChange(new TextSpan(0, 0), ""), new TextChange(new TextSpan(1, 1), "")); 1233var changedText = text.WithChanges(edits1); 1244var changedText2 = changedText.WithChanges(edits2);
Microsoft.CodeAnalysis.VisualBasic.Features (3)
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (1)
252Dim updatedText = text.WithChanges(New TextChange(TextSpan.FromBounds(insertionPoint, insertionPoint), stringToAppend))
CodeFixes\MoveToTopOfFile\MoveToTopOfFileCodeFixProvider.MoveToLineCodeAction.vb (1)
38Dim textWithoutLine = text.WithChanges(New TextChange(textLineToMove.SpanIncludingLineBreak, ""))
Snippets\VisualBasicSnippetFunctionService.vb (1)
50Dim documentWithCaseAdded = document.WithText(text.WithChanges(textChange))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (16)
IncrementalParser\IncrementalParser.vb (16)
91text = text.WithChanges(New TextChange(span, text.ToString(span))) 112Dim newText = text.WithChanges(New TextChange(New TextSpan(text.Length, 0), _s.Substring(i, 1))) 129Dim newText = oldText.WithChanges(New TextChange(New TextSpan(pos, 0), "'")) 138Dim anotherText = newText.WithChanges(New TextChange(New TextSpan(pos, 1), "")) 705Dim newText = oldText.WithChanges(New TextChange(New TextSpan(22, 0), " Sub ")) 744Dim newText = oldText.WithChanges(New TextChange(New TextSpan(103, 0), " ")) 770Dim newText = oldText.WithChanges(New TextChange(New TextSpan(insertionPoint, 0), " ")) 795Dim newText = oldText.WithChanges(New TextChange(New TextSpan(insertionPoint, replace.Length), "{")) 830Dim newText = oldText.WithChanges(New TextChange(New TextSpan(pos, 0), "'")) 1125Dim newIText = oldIText.WithChanges(change) 1162Dim newIText = oldIText.WithChanges(change) 1168newIText = newIText.WithChanges(change) 1208Dim newText = oldText.WithChanges(change) 1226Dim newText = oldText.WithChanges(change) 1244Dim newText = oldText.WithChanges(change) 1678Dim newText = oldText.WithChanges(change)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (5)
ParserTestUtilities.vb (4)
259newText = oldText.WithChanges(New TextChange(node.changeSpan, node.changeText)) 261newText = oldText.WithChanges(New TextChange(New TextSpan(0, 0), node.changeText)) 263newText = oldText.WithChanges(New TextChange(node.changeSpan, "")) 265newText = oldText.WithChanges(New TextChange(node.changeSpan, node.changeText))
SyntaxTreeExtensions.vb (1)
18Dim newFullText = oldFullText.WithChanges(New TextChange(New TextSpan(offset, length), newText))
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
64=> WithChangedText(Text.WithChanges(change), cancellationToken);
Microsoft.CodeAnalysis.Workspaces.UnitTests (7)
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
566var newText = existingText.WithChanges(new TextChange(new TextSpan(existingText.Length, length: 0), " With Change"));
SymbolKeyTests.cs (3)
874var updated = sourceText.WithChanges(new TextChange(new TextSpan(position, 0), "insertion")); 921var updated = sourceText.WithChanges(new TextChange(new TextSpan(position, 0), "insertion")); 1419var newTree = syntaxTree.WithChangedText(text.WithChanges(new TextChange(new TextSpan(0, text.Length), text.ToString().Replace(" ", " "))));
SyntaxPathTests.cs (3)
95var newText = text.WithChanges(new TextChange(new TextSpan(0, 0), "class C {}")); 109var newText = text.WithChanges(new TextChange(new TextSpan(0, text.Length), "")); 430var newFullText = oldFullText.WithChanges(new TextChange(new TextSpan(offset, length), newText));
Microsoft.VisualStudio.LanguageServices (1)
Implementation\AbstractEditorFactory.cs (1)
368formattedText = formattedText.WithChanges(new TextChange(currentSpan, targetLineEnding));
Microsoft.VisualStudio.LanguageServices.UnitTests (6)
Preview\PreviewChangesTests.vb (6)
43Dim forkedDocument = document.WithText(text.WithChanges(textChange)) 96Dim forkedDocument = document.WithText(text.WithChanges(textChange)) 138Dim forkedDocument = document.WithText(text.WithChanges(textChange)) 191Dim forkedDocument = document.WithText(text.WithChanges(textChange)) 282.WithDocumentText(documentId1, text1.WithChanges(textChange1)) _ 283.WithDocumentText(documentId2, text2.WithChanges(textChange2))
Roslyn.VisualStudio.Next.UnitTests (2)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
51var newText = oldText.WithChanges([new TextChange(new TextSpan(0, 1), "abc")]);
Services\ServiceHubServicesTests.cs (1)
90var newText = oldText.WithChanges(new TextChange(TextSpan.FromBounds(0, 0), "/* test */"));