67 references to Replace
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (2)
108
.WithDocumentText(document.Id, (await document.GetTextAsync()).
Replace
(textString.IndexOf("public"), "public".Length, "internal"))
109
.WithDocumentText(linkedDocument.Id, sourceText.
Replace
(textString.LastIndexOf("public"), "public".Length, "private"));
Microsoft.CodeAnalysis.UnitTests (10)
Text\TextChangeTests.cs (10)
65
var newText = text.
Replace
(6, 0, "Beautiful ");
73
var newText = text.
Replace
(6, 0, "Beautiful ");
356
text = text.
Replace
(50 + i, 0, c.ToString());
376
text = text.
Replace
(i, 1, c.ToString());
491
t = t.
Replace
(t.Length, 0, b); // add b's
502
t = t.
Replace
(t.Length, 0, "c");
521
t = t.
Replace
(t.Length, 0, b); // add b's
532
t = t.
Replace
(t.Length, 0, c); // add c's that are the same segment size as the a's and b's
565
var firstEdit = text.
Replace
(11, 3, "new");
566
secondEdit = firstEdit.
Replace
(11, 3, "newer");
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (42)
IncrementalParser\IncrementalParser.vb (42)
868
Dim newText = oldText.
Replace
(start:=0, length:=0, newText:="B")
888
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:=str)
909
Dim newText = oldText.
Replace
(start:=position, length:=1, newText:="m")
938
Dim newText = oldText.
Replace
(start:=position, length:=5, newText:="True")
967
Dim newText = oldText.
Replace
(start:=position, length:=1, newText:="m")
1012
Dim newText = oldText.
Replace
(start:=position, length:=1, newText:="")
1032
Dim newText = oldText.
Replace
(start:=position, length:=1, newText:="")
1108
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:=String.Empty)
1269
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="")
1293
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="")
1317
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="Async Function ")
1341
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="Async Function ")
1364
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="")
1387
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="Async Function ")
1407
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="")
1427
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="Iterator Function ")
1447
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="")
1467
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="Iterator Function ")
1771
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1798
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1827
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1847
Dim newText = oldText.
Replace
(start:=position, length:=1, newText:=TextToAdd)
1866
Dim newText = oldText.
Replace
(start:=position, length:=1, newText:=TextToAdd)
1891
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1924
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1958
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1988
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2019
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2051
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2081
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2113
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2215
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2247
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2281
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2307
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2338
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2371
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2408
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2436
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2470
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2495
Dim newText = oldText.
Replace
(start:=position, length:=0, newText:="Delegate")
2549
Dim newText = oldText.
Replace
(start:=position, length:=toReplace.Length, newText:="Property")
Microsoft.CodeAnalysis.Workspaces.UnitTests (12)
SolutionTests\ProjectSemanticVersionTests.cs (12)
48
document.WithText(text.
Replace
(position, length: 0, "public async Task M() { }")).Project);
62
document.WithText(text.
Replace
(position, length: 0, "int x = 10;")).Project);
76
document.WithText(text.
Replace
(position, length: 0, "int x = 10")).Project);
90
document.WithText(text.
Replace
(position, length: 0, " \r\n")).Project);
104
document.WithText(text.
Replace
(position, length: 0, "public int X = 20;")).Project);
132
document.WithText(text.
Replace
(position, length: 0, "public const int X = 20;")).Project);
160
document.WithText(text.
Replace
(position, length: 0, "Public Sub M()\r\nEnd Sub")).Project);
174
document.WithText(text.
Replace
(position, length: 0, "Dim x As Integer = 10")).Project);
188
document.WithText(text.
Replace
(position, length: 0, "Optional x As Integer = 10")).Project);
202
document.WithText(text.
Replace
(position, length: 0, " \r\n")).Project);
216
document.WithText(text.
Replace
(position, length: 0, "Public X As Integer = 20")).Project);
244
document.WithText(text.
Replace
(position, length: 0, "Public Const X As Integer = 20")).Project);
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
CodeModel\VisualBasicCodeModelService.vb (1)
4081
text = text.
Replace
(position, 0, textToInsert)