497 instantiations of TextChange
IdeCoreBenchmarks (5)
Microsoft.AspNetCore.App.Analyzers (4)
Microsoft.CodeAnalysis (4)
Microsoft.CodeAnalysis.CodeStyle (6)
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (8)
333edits.Add(new TextChange(TextSpan.FromBounds(startPos, startEnd), ""));
337edits.Add(new TextChange(TextSpan.FromBounds(firstMiddlePos, bottomEnd), ""));
346edits.Add(new TextChange(TextSpan.FromBounds(startPos, equalsEnd), ""));
350edits.Add(new TextChange(TextSpan.FromBounds(endPos, bottomEnd), ""));
359edits.Add(new TextChange(TextSpan.FromBounds(startPos, startEnd), ""));
365edits.Add(new TextChange(TextSpan.FromBounds(secondMiddlePos, equalsEnd), ""));
371edits.Add(new TextChange(TextSpan.FromBounds(firstMiddlePos, equalsEnd), ""));
376edits.Add(new TextChange(TextSpan.FromBounds(endPos, bottomEnd), ""));
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (9)
StringCopyPaste\KnownSourcePasteProcessor.cs (5)
189edits.Add(new TextChange(new TextSpan(StringExpressionBeforePaste.Span.Start, 0), dollarSignsToAdd));
193edits.Add(new TextChange(new TextSpan(StringExpressionBeforePasteInfo.ContentSpans.First().Start, 0), quotesToAdd));
218edits.Add(new TextChange(new TextSpan(StringExpressionBeforePasteInfo.EndDelimiterSpanWithoutSuffix.End, 0), quotesToAdd));
238edits.Add(new TextChange(new TextSpan(interpolation.OpenBraceToken.Span.End, 0), new string('{', dollarSignsToAdd)));
239edits.Add(new TextChange(new TextSpan(interpolation.CloseBraceToken.Span.Start, 0), new string('}', dollarSignsToAdd)));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Features (25)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (47)
IncrementalParsing\IncrementalParsingTests.cs (45)
497var change = new TextChange(span, ".");
529var change = new TextChange(span, " ");
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), ""));
2748new TextChange(new TextSpan(str.IndexOf(" abc", StringComparison.Ordinal), 0), "//"),
2749new TextChange(new TextSpan(str.IndexOf(" 123", StringComparison.Ordinal), 0), "//"),
2750new TextChange(new TextSpan(str.IndexOf(" def", StringComparison.Ordinal), 0), "//"));
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)
2901var change = new TextChange(span, text1);
2915change = new TextChange(span, text2);
2984var change = new TextChange(span, "// ");
3021var change = new TextChange(span, "// ");
3100var change = new TextChange(new TextSpan(0, 0), items[1]); // Prepend
3199var change = new TextChange(span, "p");
3220var change = new TextChange(span, "");
3241var change = new TextChange(span, "[");
3262var change = new TextChange(span, "[Obsolete]");
3283var change = new TextChange(span, "public");
3305var change = new TextChange(span, "c");
3329var change = new TextChange(span, "1, Attr2");
3353var change = new TextChange(span, ", Attr2");
3377var change = new TextChange(span, " [Attr2]");
3401var change = new TextChange(span, "Arg");
3425var change = new TextChange(span, "2");
3451var change = new TextChange(span, "1, Attr2");
3476var change = new TextChange(span, "[Attr]");
3502var change = new TextChange(span, " [Attr2]");
3528var change = new TextChange(span, "");
3546var change = new TextChange(span, ".z");
3564var change = new TextChange(span, " if (c) { }");
3582var change = new TextChange(span, " else (c) { }");
3596var change = new TextChange(span, "");
3610var change = new TextChange(span, "{ ");
3625var change = new TextChange(span, "");
3662var change = new TextChange(span, "[");
3691new TextChange(new TextSpan(locationOfChange, 0), "/*"),
3692new TextChange(new TextSpan(locationOfChange + widthOfChange, 0), "*/")
3701var newText = oldText.WithChanges(new TextChange(new TextSpan(locationOfChange, widthOfChange), ""));
3727var newText = oldText.WithChanges(new TextChange(new TextSpan(oldText.Length, 0), newChar.ToString()));
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
Microsoft.CodeAnalysis.EditorFeatures (12)
EditorConfigSettings\Updater\SettingsUpdateHelper.cs (5)
171var textChange = new TextChange();
185textChange = new TextChange(curLine.Span, $"{untrimmedKey}= {optionValue}{comment}");
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));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (85)
CommentSelection\CommentUncommentSelectionCommandHandlerTests.cs (81)
87CommentSelection(code, new[] { new TextChange(TextSpan.FromBounds(0, 0), "//") }, supportBlockComments: true);
103new TextChange(new TextSpan(8, 0), "/*"),
104new TextChange(new TextSpan(14, 0), "*/"),
117new TextChange(new TextSpan(0, 0), "//"),
118new TextChange(new TextSpan(16, 0), "//"),
127CommentSelection(code, new[] { new TextChange(TextSpan.FromBounds(0, 0), "//") }, supportBlockComments: false);
145new TextChange(new TextSpan(20, 0), "//"),
146new TextChange(new TextSpan(34, 0), "//"),
147new TextChange(new TextSpan(41, 0), "//"),
171new TextChange(new TextSpan(0, 0), "//"),
172new TextChange(new TextSpan(9, 0), "//"),
173new TextChange(new TextSpan(12, 0), "//"),
174new TextChange(new TextSpan(30, 0), "//"),
185new TextChange(new TextSpan(0, 0), "//"),
186new TextChange(new TextSpan(11, 0), "//"),
187new TextChange(new TextSpan(16, 0), "//"),
188new TextChange(new TextSpan(36, 0), "//"),
211new TextChange(new TextSpan(20, 0), "//"),
212new TextChange(new TextSpan(34, 0), "//"),
213new TextChange(new TextSpan(41, 0), "//"),
232new TextChange(new TextSpan(20, 0), "//"),
233new TextChange(new TextSpan(34, 0), "//"),
234new TextChange(new TextSpan(41, 0), "//"),
254new TextChange(new TextSpan(20, 0), "//"),
255new TextChange(new TextSpan(34, 0), "//"),
256new TextChange(new TextSpan(41, 0), "//"),
277new TextChange(new TextSpan(20, 0), "/*"),
278new TextChange(new TextSpan(21, 0), "*/"),
279new TextChange(new TextSpan(34, 0), "//"),
280new TextChange(new TextSpan(41, 0), "/*"),
281new TextChange(new TextSpan(42, 0), "*/"),
282new TextChange(new TextSpan(52, 0), "//"),
302new TextChange(new TextSpan(20, 0), "//"),
303new TextChange(new TextSpan(34, 0), "//"),
304new TextChange(new TextSpan(41, 0), "//"),
313UncommentSelection(code, new[] { new TextChange(new TextSpan(0, 2), string.Empty) }, Span.FromBounds(0, 6), supportBlockComments: true);
322new TextChange(new TextSpan(7, 2), string.Empty),
323new TextChange(new TextSpan(30, 2), string.Empty),
335new TextChange(new TextSpan(11, 2), string.Empty),
336new TextChange(new TextSpan(34, 2), string.Empty),
359new TextChange(new TextSpan(18, 2), string.Empty),
360new TextChange(new TextSpan(34, 2), string.Empty),
361new TextChange(new TextSpan(47, 2), string.Empty),
362new TextChange(new TextSpan(68, 2), string.Empty),
363new TextChange(new TextSpan(119, 2), string.Empty),
364new TextChange(new TextSpan(128, 2), string.Empty),
385new TextChange(new TextSpan(20, 2), string.Empty),
386new TextChange(new TextSpan(23, 2), string.Empty),
387new TextChange(new TextSpan(38, 2), string.Empty),
388new TextChange(new TextSpan(49, 2), string.Empty),
389new TextChange(new TextSpan(52, 2), string.Empty),
390new TextChange(new TextSpan(64, 2), string.Empty),
411new TextChange(new TextSpan(2, 2), string.Empty),
412new TextChange(new TextSpan(19, 2), string.Empty),
413new TextChange(new TextSpan(26, 2), string.Empty),
423CommentSelection(code, new[] { new TextChange(TextSpan.FromBounds(0, 0), "//") }, new[] { new Span(0, 15) }, supportBlockComments: true);
433new TextChange(new TextSpan(6, 2), string.Empty),
434new TextChange(new TextSpan(16, 2), string.Empty)
447new TextChange(new TextSpan(19, 2), string.Empty),
448new TextChange(new TextSpan(29, 2), string.Empty)
461new TextChange(new TextSpan(0, 2), string.Empty),
462new TextChange(new TextSpan(15, 2), string.Empty)
475new TextChange(new TextSpan(0, 2), string.Empty),
476new TextChange(new TextSpan(15, 2), string.Empty)
513new TextChange(new TextSpan(18, 2), string.Empty),
514new TextChange(new TextSpan(112, 2), string.Empty),
544new TextChange(new TextSpan(20, 2), string.Empty),
545new TextChange(new TextSpan(114, 2), string.Empty),
573new TextChange(new TextSpan(18, 2), string.Empty),
574new TextChange(new TextSpan(112, 2), string.Empty),
602new TextChange(new TextSpan(18, 2), string.Empty),
603new TextChange(new TextSpan(112, 2), string.Empty),
631new TextChange(new TextSpan(55, 2), string.Empty),
659new TextChange(new TextSpan(55, 2), string.Empty),
687new TextChange(new TextSpan(18, 2), string.Empty),
688new TextChange(new TextSpan(28, 2), string.Empty),
689new TextChange(new TextSpan(44, 2), string.Empty),
690new TextChange(new TextSpan(53, 2), string.Empty),
691new TextChange(new TextSpan(78, 2), string.Empty),
692new TextChange(new TextSpan(109, 2), string.Empty),
693new TextChange(new TextSpan(118, 2), string.Empty),
Snippets\RoslynLSPSnippetConvertTests.cs (3)
404ImmutableArray<SnippetPlaceholder>.Empty, new TextChange(new TextSpan(8, 0), "quux"), triggerLocation: 12, CancellationToken.None).Result;
415ImmutableArray<SnippetPlaceholder>.Empty, new TextChange(new TextSpan(4, 4), "bar quux"), triggerLocation: 12, CancellationToken.None).Result;
492var textChange = new TextChange(new TextSpan(stringSpan.Start, 0), text.Substring(stringSpan.Start, stringSpan.Length));
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Microsoft.CodeAnalysis.Features (45)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (8)
333edits.Add(new TextChange(TextSpan.FromBounds(startPos, startEnd), ""));
337edits.Add(new TextChange(TextSpan.FromBounds(firstMiddlePos, bottomEnd), ""));
346edits.Add(new TextChange(TextSpan.FromBounds(startPos, equalsEnd), ""));
350edits.Add(new TextChange(TextSpan.FromBounds(endPos, bottomEnd), ""));
359edits.Add(new TextChange(TextSpan.FromBounds(startPos, startEnd), ""));
365edits.Add(new TextChange(TextSpan.FromBounds(secondMiddlePos, equalsEnd), ""));
371edits.Add(new TextChange(TextSpan.FromBounds(firstMiddlePos, equalsEnd), ""));
376edits.Add(new TextChange(TextSpan.FromBounds(endPos, bottomEnd), ""));
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (4)
Microsoft.CodeAnalysis.UnitTests (156)
Text\TextChangeTests.cs (155)
88new TextChange(new TextSpan(0, 5), "Halo"),
89new TextChange(new TextSpan(6, 5), "Universe"));
100new TextChange(new TextSpan(0, 5), "Halo"),
101new TextChange(new TextSpan(3, 5), "Universe")
113new TextChange(new TextSpan(6, 5), "Universe"),
114new TextChange(new TextSpan(0, 5), "Halo")
127new TextChange(new TextSpan(6, 7), "Universe"),
128new TextChange(new TextSpan(0, 5), "Halo")
142new TextChange(new TextSpan(6, 0), "Super "),
143new TextChange(new TextSpan(6, 0), "Spectacular "));
154new TextChange(new TextSpan(6, 0), "Super "),
155new TextChange(new TextSpan(6, 2), "Vu"));
166new TextChange(new TextSpan(6, 2), "Vu"),
167new TextChange(new TextSpan(6, 0), "Super ")
180new TextChange(new TextSpan(4, 1), string.Empty),
181new TextChange(new TextSpan(5, 1), string.Empty));
191new TextChange(new TextSpan(4, 1), string.Empty),
192new TextChange(new TextSpan(6, 5), "Universe"));
206new TextChange(new TextSpan(4, 1), string.Empty));
216new TextChange(new TextSpan(6, 5), "Universe"));
233new TextChange(new TextSpan(0, 1), "[1]"),
234new TextChange(new TextSpan(1, 1), "[2]"),
235new TextChange(new TextSpan(5, 0), "[3]"),
236new TextChange(new TextSpan(25, 2), "[4]")
278new TextChange(new TextSpan(8, 2), "IN"),
279new TextChange(new TextSpan(15, 2), "IN"));
286new TextChange(new TextSpan(8, 2), new string('a', 10)),
287new TextChange(new TextSpan(15, 2), new string('a', 10)));
294new TextChange(new TextSpan(8, 2), "\r\n"),
295new TextChange(new TextSpan(15, 2), "\r\n"));
302new TextChange(new TextSpan(6, 0), "aa\r"),
303new TextChange(new TextSpan(11, 0), "aa\r"));
310new TextChange(new TextSpan(6, 0), "aa\n"),
311new TextChange(new TextSpan(11, 0), "aa\n"));
318new TextChange(new TextSpan(4, 4), "aaaaaa"),
319new TextChange(new TextSpan(15, 4), "aaaaaa"));
326new TextChange(new TextSpan(5, 0), "aaaaaa"));
333new TextChange(new TextSpan(5, 0), "\naaaaaa\r"));
340new TextChange(new TextSpan(21, 0), "Line4\r\n"),
341new TextChange(new TextSpan(21, 0), "Line5\r\n"));
636var change1 = original.WithChanges(new TextChange(new TextSpan(5, 6), string.Empty)); // prepare a ChangedText instance
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"));
678Assert.Equal(new[] { new TextChange(new TextSpan(1, 3), "abba") }, changes);
686var change1 = original.WithChanges(new TextChange(new TextSpan(1, 1), "aaa"));
687var change2 = change1.WithChanges(new TextChange(new TextSpan(3, 0), "bb"));
692Assert.Equal(new[] { new TextChange(new TextSpan(1, 1), "aabba") }, changes);
700var change1 = original.WithChanges(new TextChange(new TextSpan(1, 3), "aa"));
701var change2 = change1.WithChanges(new TextChange(new TextSpan(2, 1), "bb"));
706Assert.Equal(new[] { new TextChange(new TextSpan(1, 3), "abb") }, changes);
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"));
761Assert.Equal(new[] { new TextChange(new TextSpan(1, 0), "bbaa") }, changes);
768var change1 = original.WithChanges(new TextChange(new TextSpan(1, 3), "aa"));
769var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 0), "bb"));
774Assert.Equal(new[] { new TextChange(new TextSpan(1, 3), "bbaa") }, changes);
781var change1 = original.WithChanges(new TextChange(new TextSpan(1, 0), "aa"));
782var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 1), "bb"));
787Assert.Equal(new[] { new TextChange(new TextSpan(1, 0), "bba") }, changes);
794var change1 = original.WithChanges(new TextChange(new TextSpan(1, 0), "aa"));
795var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 2), "bb"));
800Assert.Equal(new[] { new TextChange(new TextSpan(1, 0), "bb") }, changes);
807var change1 = original.WithChanges(new TextChange(new TextSpan(1, 0), "aa"));
808var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 3), "bb"));
813Assert.Equal(new[] { new TextChange(new TextSpan(1, 1), "bb") }, changes);
821var change1 = original.WithChanges(new TextChange(new TextSpan(1, 3), "aa"));
822var change2 = change1.WithChanges(new TextChange(new TextSpan(1, 1), "bb"));
827Assert.Equal(new[] { new TextChange(new TextSpan(1, 3), "bba") }, changes);
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")));
954Assert.Equal("new TextChange(new TextSpan(0, 1), \"abc\")", new TextChange(new TextSpan(0, 1), "abc").GetDebuggerDisplay());
955Assert.Equal("new TextChange(new TextSpan(0, 1), (NewLength = 10))", new TextChange(new TextSpan(0, 1), "0123456789").GetDebuggerDisplay());
979var newChange = new TextChange(new TextSpan(i, length: random.Next(originalText.Length - i)), newText);
999var newChange = new TextChange(new TextSpan(i, length: random.Next(editedLength - i)), newText);
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), ""));
1226new TextChange(new TextSpan(39, 0), " "),
1227new TextChange(new TextSpan(42, 0), " "),
1228new TextChange(new TextSpan(57, 0), " "),
1229new TextChange(new TextSpan(58, 0), "\r\n"),
1230new TextChange(new TextSpan(64, 2), " "),
1231new TextChange(new TextSpan(69, 0), " "),
1237new TextChange(new TextSpan(35, 4), string.Empty),
1238new TextChange(new TextSpan(46, 4), string.Empty),
1239new TextChange(new TextSpan(73, 4), string.Empty),
1240new TextChange(new TextSpan(88, 0), " "),
1241new TextChange(new TextSpan(90, 4), string.Empty),
1242new TextChange(new TextSpan(105, 4), string.Empty),
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (2)
Microsoft.CodeAnalysis.VisualBasic.Features (6)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (14)
IncrementalParser\IncrementalParser.vb (14)
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), "'"))
1124Dim change = New TextChange(span, "")
1161Dim change = New TextChange(span, code1)
1167change = New TextChange(span, "")
1524New TextChange(TextSpan.FromBounds(29, 45), ""))
1677Dim change = New TextChange(New TextSpan(position, 2), "71")
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (5)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
Microsoft.CodeAnalysis.Workspaces (8)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (7)
Microsoft.VisualStudio.LanguageServices (4)
Microsoft.VisualStudio.LanguageServices.UnitTests (3)
Roslyn.VisualStudio.Next.UnitTests (2)
657 references to TextChange
Microsoft.AspNetCore.App.Analyzers (2)
Microsoft.CodeAnalysis (29)
Microsoft.CodeAnalysis.CodeStyle (33)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (10)
190protected abstract LineColumnDelta Format(LineColumn lineColumn, SyntaxTrivia trivia, ArrayBuilder<TextChange> changes, CancellationToken cancellationToken);
266public ImmutableArray<TextChange> FormatToTextChanges(CancellationToken cancellationToken)
268using var _ = ArrayBuilder<TextChange>.GetInstance(out var changes);
675private void AddExtraLines(int linesBetweenTokens, ArrayBuilder<TextChange> changes)
703var change = GetWhitespaceTextChange(
713private bool TryGetMatchingChangeIndex(ArrayBuilder<TextChange> changes, out int index)
720var change = changes[i];
731private TextSpan GetInsertionSpan(ArrayBuilder<TextChange> changes)
823private TextChange GetWhitespaceTextChange(LineColumn lineColumn, LineColumnDelta delta, TextSpan span)
826private void AddWhitespaceTextChange(LineColumn lineColumn, LineColumnDelta delta, TextSpan span, ArrayBuilder<TextChange> changes)
Microsoft.CodeAnalysis.CodeStyle.Fixes (11)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (6)
315Action<SourceText, ArrayBuilder<TextChange>, int, int, int, int> addEdits,
320using var _ = ArrayBuilder<TextChange>.GetInstance(out var edits);
328SourceText text, ArrayBuilder<TextChange> edits,
341SourceText text, ArrayBuilder<TextChange> edits,
354SourceText text, ArrayBuilder<TextChange> edits,
411using var _ = ArrayBuilder<TextChange>.GetInstance(out var edits);
Microsoft.CodeAnalysis.CSharp (1)
Microsoft.CodeAnalysis.CSharp.CodeStyle (8)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (31)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Features (33)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (29)
IncrementalParsing\IncrementalParsingTests.cs (29)
497var change = new TextChange(span, ".");
529var change = new TextChange(span, " ");
2901var change = new TextChange(span, text1);
2984var change = new TextChange(span, "// ");
3021var change = new TextChange(span, "// ");
3100var change = new TextChange(new TextSpan(0, 0), items[1]); // Prepend
3199var change = new TextChange(span, "p");
3220var change = new TextChange(span, "");
3241var change = new TextChange(span, "[");
3262var change = new TextChange(span, "[Obsolete]");
3283var change = new TextChange(span, "public");
3305var change = new TextChange(span, "c");
3329var change = new TextChange(span, "1, Attr2");
3353var change = new TextChange(span, ", Attr2");
3377var change = new TextChange(span, " [Attr2]");
3401var change = new TextChange(span, "Arg");
3425var change = new TextChange(span, "2");
3451var change = new TextChange(span, "1, Attr2");
3476var change = new TextChange(span, "[Attr]");
3502var change = new TextChange(span, " [Attr2]");
3528var change = new TextChange(span, "");
3546var change = new TextChange(span, ".z");
3564var change = new TextChange(span, " if (c) { }");
3582var change = new TextChange(span, " else (c) { }");
3596var change = new TextChange(span, "");
3610var change = new TextChange(span, "{ ");
3625var change = new TextChange(span, "");
3662var change = new TextChange(span, "[");
3690new TextChange[] {
Microsoft.CodeAnalysis.CSharp.Workspaces (13)
Microsoft.CodeAnalysis.EditorFeatures (67)
CommentSelection\CommentUncommentSelectionCommandHandler.cs (10)
79var textChanges = ArrayBuilder<TextChange>.GetInstance();
100ArrayBuilder<TextChange> textChanges, ArrayBuilder<CommentTrackingSpan> trackingSpans)
162private static void AddSingleLineComments(SnapshotSpan span, ArrayBuilder<TextChange> textChanges, ArrayBuilder<CommentTrackingSpan> trackingSpans, ITextSnapshotLine firstLine, ITextSnapshotLine lastLine, CommentSelectionInfo commentInfo)
171private static void AddBlockComment(SnapshotSpan span, ArrayBuilder<TextChange> textChanges, ArrayBuilder<CommentTrackingSpan> trackingSpans, CommentSelectionInfo commentInfo)
183ArrayBuilder<TextChange> textChanges, ArrayBuilder<CommentTrackingSpan> spansToSelect)
211private static bool TryUncommentExactlyBlockComment(CommentSelectionInfo info, SnapshotSpan span, ArrayBuilder<TextChange> textChanges,
229private static void UncommentContainingBlockComment(CommentSelectionInfo info, SnapshotSpan span, ArrayBuilder<TextChange> textChanges,
257private static void UncommentPosition(CommentSelectionInfo info, ArrayBuilder<TextChange> textChanges,
270private static bool TryUncommentSingleLineComments(CommentSelectionInfo info, SnapshotSpan span, ArrayBuilder<TextChange> textChanges,
302CommentSelectionInfo info, ArrayBuilder<TextChange> textChanges, ITextSnapshotLine firstLine, ITextSnapshotLine lastLine, int indentToCommentAt)
ExternalAccess\VSTypeScript\Api\IVSTypeScriptFormattingInteractionService.cs (4)
31Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, TextSpan? textSpan, DocumentOptionSet? documentOptions, CancellationToken cancellationToken);
36Task<ImmutableArray<TextChange>> GetFormattingChangesOnPasteAsync(Document document, TextSpan textSpan, DocumentOptionSet? documentOptions, CancellationToken cancellationToken);
43Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, char typedChar, int position, DocumentOptionSet? documentOptions, CancellationToken cancellationToken);
48Task<ImmutableArray<TextChange>> GetFormattingChangesOnReturnAsync(Document document, int position, DocumentOptionSet? documentOptions, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\VSTypeScriptFormattingInteractionService.cs (4)
33public Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, TextSpan? textSpan, CancellationToken cancellationToken)
36public Task<ImmutableArray<TextChange>> GetFormattingChangesOnPasteAsync(Document document, ITextBuffer textBuffer, TextSpan textSpan, CancellationToken cancellationToken)
39public Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, char typedChar, int position, CancellationToken cancellationToken)
42public Task<ImmutableArray<TextChange>> GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken)
Formatting\IFormattingInteractionService.cs (4)
31Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, TextSpan? textSpan, CancellationToken cancellationToken);
36Task<ImmutableArray<TextChange>> GetFormattingChangesOnPasteAsync(Document document, ITextBuffer textBuffer, TextSpan textSpan, CancellationToken cancellationToken);
43Task<ImmutableArray<TextChange>> GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, char typedChar, int position, CancellationToken cancellationToken);
48Task<ImmutableArray<TextChange>> GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (8)
Microsoft.CodeAnalysis.EditorFeatures.Text (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (13)
CommentSelection\CommentUncommentSelectionCommandHandlerTests.cs (11)
80CommentSelection(code, Enumerable.Empty<TextChange>(), supportBlockComments: true);
94CommentSelection(code, Enumerable.Empty<TextChange>(), supportBlockComments: true);
486UncommentSelection(code, Enumerable.Empty<TextChange>(), new Span(17, 0), supportBlockComments: true);
493UncommentSelection(code, Enumerable.Empty<TextChange>(), new Span(8, 0), supportBlockComments: true);
704private static void UncommentSelection(string code, IEnumerable<TextChange> expectedChanges, Span expectedSelectedSpan, bool supportBlockComments)
707private static void UncommentSelection(string code, IEnumerable<TextChange> expectedChanges, IEnumerable<Span> expectedSelectedSpans, bool supportBlockComments)
710private static void CommentSelection(string code, IEnumerable<TextChange> expectedChanges, bool supportBlockComments)
713private static void CommentSelection(string code, IEnumerable<TextChange> expectedChanges, IEnumerable<Span> expectedSelectedSpans, bool supportBlockComments)
716private static void CommentSelection(ExportProvider exportProvider, ITextView textView, IEnumerable<TextChange> expectedChanges, IEnumerable<Span> expectedSelectedSpans, bool supportBlockComments)
724IEnumerable<TextChange> expectedChanges,
740IEnumerable<TextChange> expectedChanges,
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Microsoft.CodeAnalysis.ExternalAccess.AspNetCore (1)
Microsoft.CodeAnalysis.ExternalAccess.Copilot (2)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (19)
Internal\Editor\FSharpEditorFormattingService.cs (12)
44public Task<IList<TextChange>> GetFormattingChangesAsync(Document document, TextSpan? textSpan, CancellationToken cancellationToken)
49public Task<IList<TextChange>?> GetFormattingChangesAsync(Document document, char typedChar, int position, CancellationToken cancellationToken)
54public Task<IList<TextChange>> GetFormattingChangesOnPasteAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken)
59public Task<IList<TextChange>?> GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken)
79async Task<ImmutableArray<TextChange>> IFormattingInteractionService.GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, TextSpan? textSpan, CancellationToken cancellationToken)
82return changes?.ToImmutableArray() ?? ImmutableArray<TextChange>.Empty;
85async Task<ImmutableArray<TextChange>> IFormattingInteractionService.GetFormattingChangesAsync(Document document, ITextBuffer textBuffer, char typedChar, int position, CancellationToken cancellationToken)
88return changes?.ToImmutableArray() ?? ImmutableArray<TextChange>.Empty;
91async Task<ImmutableArray<TextChange>> IFormattingInteractionService.GetFormattingChangesOnPasteAsync(Document document, ITextBuffer textBuffer, TextSpan textSpan, CancellationToken cancellationToken)
94return changes?.ToImmutableArray() ?? ImmutableArray<TextChange>.Empty;
97async Task<ImmutableArray<TextChange>> IFormattingInteractionService.GetFormattingChangesOnReturnAsync(Document document, int position, CancellationToken cancellationToken)
100return changes?.ToImmutableArray() ?? ImmutableArray<TextChange>.Empty;
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
Microsoft.CodeAnalysis.ExternalAccess.Razor (7)
Microsoft.CodeAnalysis.Features (113)
AddImport\AddImportFixData.cs (6)
18ImmutableArray<TextChange> textChanges,
41public readonly ImmutableArray<TextChange> TextChanges = textChanges;
113public static AddImportFixData CreateForProjectSymbol(ImmutableArray<TextChange> textChanges, string title, ImmutableArray<string> tags, CodeActionPriority priority, ProjectId projectReferenceToAdd)
121public static AddImportFixData CreateForMetadataSymbol(ImmutableArray<TextChange> textChanges, string title, ImmutableArray<string> tags, CodeActionPriority priority, ProjectId portableExecutableReferenceProjectId, string portableExecutableReferenceFilePathToAdd)
130public static AddImportFixData CreateForReferenceAssemblySymbol(ImmutableArray<TextChange> textChanges, string title, string assemblyReferenceAssemblyName, string assemblyReferenceFullyQualifiedTypeName)
139public static AddImportFixData CreateForPackageSymbol(ImmutableArray<TextChange> textChanges, string packageSource, string packageName, string packageVersionOpt)
Completion\CommonCompletionProvider.cs (5)
82var change = await GetTextChangeAsync(document, item, ch: '\t', cancellationToken: cancellationToken).ConfigureAwait(false) ??
112var change = (await GetTextChangeAsync(document, item, commitKey, cancellationToken).ConfigureAwait(false))
117public virtual Task<TextChange?> GetTextChangeAsync(Document document, CompletionItem selectedItem, char? ch, CancellationToken cancellationToken)
120protected virtual Task<TextChange?> GetTextChangeAsync(CompletionItem selectedItem, char? ch, CancellationToken cancellationToken)
121=> SpecializedTasks.Default<TextChange?>();
Completion\CompletionChange.cs (16)
21public TextChange TextChange { get; }
28public ImmutableArray<TextChange> TextChanges { get; }
46TextChange textChange, ImmutableArray<TextChange> textChanges, int? newPosition, bool includesCommitCharacter)
52TextChange textChange, ImmutableArray<TextChange> textChanges, int? newPosition, bool includesCommitCharacter, ImmutableDictionary<string, string> properties)
74/// are multiple entries, <see cref="Create(TextChange, ImmutableArray{TextChange}, int?, bool)"/> must be called instead,
79ImmutableArray<TextChange> textChanges,
89TextChange textChange,
101TextChange textChange,
102ImmutableArray<TextChange> textChanges,
110TextChange textChange,
111ImmutableArray<TextChange> textChanges,
122public CompletionChange WithTextChange(TextChange textChange)
128public CompletionChange WithTextChanges(ImmutableArray<TextChange> textChanges)
Snippets\RoslynLSPSnippetConverter.cs (7)
23public static async Task<string> GenerateLSPSnippetAsync(Document document, int caretPosition, ImmutableArray<SnippetPlaceholder> placeholders, TextChange textChange, int triggerLocation, CancellationToken cancellationToken)
25var extendedTextChange = await ExtendSnippetTextChangeAsync(document, textChange, placeholders, caretPosition, triggerLocation, cancellationToken).ConfigureAwait(false);
33private static string ConvertToLSPSnippetString(TextChange textChange, ImmutableArray<SnippetPlaceholder> placeholders, int caretPosition)
109private static async Task<TextChange> ExtendSnippetTextChangeAsync(Document document, TextChange textChange, ImmutableArray<SnippetPlaceholder> placeholders, int caretPosition, int triggerLocation, CancellationToken cancellationToken)
114var newTextChange = new TextChange(extendedSpan, newString);
124private static TextSpan GetUpdatedTextSpan(TextChange textChange, ImmutableArray<SnippetPlaceholder> placeholders, int caretPosition, int triggerLocation)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (6)
315Action<SourceText, ArrayBuilder<TextChange>, int, int, int, int> addEdits,
320using var _ = ArrayBuilder<TextChange>.GetInstance(out var edits);
328SourceText text, ArrayBuilder<TextChange> edits,
341SourceText text, ArrayBuilder<TextChange> edits,
354SourceText text, ArrayBuilder<TextChange> edits,
411using var _ = ArrayBuilder<TextChange>.GetInstance(out var edits);
Microsoft.CodeAnalysis.LanguageServer.Protocol (16)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Microsoft.CodeAnalysis.Remote.Workspaces (1)
Microsoft.CodeAnalysis.UnitTests (15)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (8)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (2)
Microsoft.CodeAnalysis.VisualBasic.Features (4)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (12)
Microsoft.CodeAnalysis.Workspaces (122)
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (29)
21private readonly struct IntervalIntrospector : IIntervalIntrospector<TextChange>
23public TextSpan GetSpan(TextChange value)
30private readonly SimpleMutableIntervalTree<TextChange, IntervalIntrospector> _totalChangesIntervalTree =
31SimpleMutableIntervalTree.Create(new IntervalIntrospector(), Array.Empty<TextChange>());
53foreach (var change in currentChanges)
81SimpleMutableIntervalTree<TextChange, IntervalIntrospector> cumulativeChanges,
82ImmutableArray<TextChange> currentChanges)
84using var overlappingSpans = TemporaryArray<TextChange>.Empty;
85using var intersectingSpans = TemporaryArray<TextChange>.Empty;
94SimpleMutableIntervalTree<TextChange, IntervalIntrospector> cumulativeChanges,
95ImmutableArray<TextChange> currentChanges,
96ref TemporaryArray<TextChange> overlappingSpans,
97ref TemporaryArray<TextChange> intersectingSpans)
99foreach (var change in currentChanges)
124TextChange change,
125in TemporaryArray<TextChange> overlappingSpans,
126in TemporaryArray<TextChange> intersectingSpans)
147private static bool IsPureInsertion(TextChange change)
151TextChange change,
152in TemporaryArray<TextChange> overlappingSpans,
153in TemporaryArray<TextChange> intersectingSpans)
180var otherChange = intersectingSpans[0];
198TextChange change,
199in TemporaryArray<TextChange> overlappingSpans,
200in TemporaryArray<TextChange> intersectingSpans)
209TextChange change,
210in TemporaryArray<TextChange> overlappingSpans)
229TextChange change,
230in TemporaryArray<TextChange> intersectingSpans)
Formatting\Formatter.cs (9)
268public static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, Workspace workspace, OptionSet? options = null, CancellationToken cancellationToken = default)
271internal static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, SolutionServices services, SyntaxFormattingOptions options, CancellationToken cancellationToken)
283public static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, TextSpan span, Workspace workspace, OptionSet? options = null, CancellationToken cancellationToken = default)
286internal static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, TextSpan span, SolutionServices services, SyntaxFormattingOptions options, CancellationToken cancellationToken = default)
298public static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, IEnumerable<TextSpan>? spans, Workspace workspace, OptionSet? options = null, CancellationToken cancellationToken = default)
301internal static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, IEnumerable<TextSpan>? spans, SolutionServices services, SyntaxFormattingOptions options, CancellationToken cancellationToken = default)
304private static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, IEnumerable<TextSpan>? spans, Workspace workspace, OptionSet? options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken)
308? SpecializedCollections.EmptyList<TextChange>()
312internal static IList<TextChange> GetFormattedTextChanges(SyntaxNode node, IEnumerable<TextSpan>? spans, SolutionServices services, SyntaxFormattingOptions options, ImmutableArray<AbstractFormattingRule> rules, CancellationToken cancellationToken = default)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (10)
190protected abstract LineColumnDelta Format(LineColumn lineColumn, SyntaxTrivia trivia, ArrayBuilder<TextChange> changes, CancellationToken cancellationToken);
266public ImmutableArray<TextChange> FormatToTextChanges(CancellationToken cancellationToken)
268using var _ = ArrayBuilder<TextChange>.GetInstance(out var changes);
675private void AddExtraLines(int linesBetweenTokens, ArrayBuilder<TextChange> changes)
703var change = GetWhitespaceTextChange(
713private bool TryGetMatchingChangeIndex(ArrayBuilder<TextChange> changes, out int index)
720var change = changes[i];
731private TextSpan GetInsertionSpan(ArrayBuilder<TextChange> changes)
823private TextChange GetWhitespaceTextChange(LineColumn lineColumn, LineColumnDelta delta, TextSpan span)
826private void AddWhitespaceTextChange(LineColumn lineColumn, LineColumnDelta delta, TextSpan span, ArrayBuilder<TextChange> changes)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
Microsoft.VisualStudio.LanguageServices (23)
Venus\ContainedDocument.cs (17)
214public ITextSnapshot ApplyChanges(IEnumerable<TextChange> changes)
233private ITextSnapshot ApplyChanges(SourceText originalText, IEnumerable<TextChange> changes)
261private IEnumerable<TextChange> FilterTextChanges(SourceText originalText, List<TextSpan> editorVisibleSpansInOriginal, IEnumerable<TextChange> changes)
270using var pooledObject = SharedPools.Default<List<TextChange>>().GetPooledObject();
328private static bool WhitespaceOnEdges(TextSpan visibleTextSpan, TextChange change)
348private IEnumerable<TextChange> GetSubTextChanges(SourceText originalText, TextChange changeInOriginalText, TextSpan visibleSpanInOriginalText)
350using var changes = SharedPools.Default<List<TextChange>>().GetPooledObject();
365SourceText originalText, TextSpan visibleSpanInOriginalText, string leftText, string rightText, int offsetInOriginalText, List<TextChange> changes)
386if (TryGetSubTextChange(originalText, visibleSpanInOriginalText, rightText, spanInOriginalText, spanInRightText, out var textChange))
398private IEnumerable<TextChange> GetSubTextChanges(
417if (TryGetSubTextChange(originalText, visibleSpanInOriginalText, rightText, spanInOriginalText, spanInRightText.ToTextSpan(), out var textChange))
504string rightText, TextSpan spanInOriginalText, TextSpan spanInRightText, out TextChange textChange)
720IEnumerable<TextChange> changes,
730foreach (var change in changes)
818foreach (var change in newChanges)
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
Microsoft.VisualStudio.LanguageServices.Xaml (3)