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)
88
var newText = text.
Replace
(6, 0, "Beautiful ");
96
var newText = text.
Replace
(6, 0, "Beautiful ");
379
text = text.
Replace
(50 + i, 0, c.ToString());
399
text = text.
Replace
(i, 1, c.ToString());
514
t = t.
Replace
(t.Length, 0, b); // add b's
525
t = t.
Replace
(t.Length, 0, "c");
544
t = t.
Replace
(t.Length, 0, b); // add b's
555
t = t.
Replace
(t.Length, 0, c); // add c's that are the same segment size as the a's and b's
588
var firstEdit = text.
Replace
(11, 3, "new");
589
secondEdit = firstEdit.
Replace
(11, 3, "newer");
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (42)
IncrementalParser\IncrementalParser.vb (42)
865
Dim newText = oldText.
Replace
(start:=0, length:=0, newText:="B")
885
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:=str)
906
Dim newText = oldText.
Replace
(start:=position, length:=1, newText:="m")
935
Dim newText = oldText.
Replace
(start:=position, length:=5, newText:="True")
964
Dim newText = oldText.
Replace
(start:=position, length:=1, newText:="m")
1009
Dim newText = oldText.
Replace
(start:=position, length:=1, newText:="")
1029
Dim newText = oldText.
Replace
(start:=position, length:=1, newText:="")
1105
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:=String.Empty)
1266
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="")
1290
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="")
1314
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="Async Function ")
1338
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="Async Function ")
1361
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="")
1384
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="Async Function ")
1404
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="")
1424
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="Iterator Function ")
1444
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="")
1464
Dim newText = oldText.
Replace
(start:=position, length:=str.Length, newText:="Iterator Function ")
1768
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1795
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1824
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1844
Dim newText = oldText.
Replace
(start:=position, length:=1, newText:=TextToAdd)
1863
Dim newText = oldText.
Replace
(start:=position, length:=1, newText:=TextToAdd)
1888
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1921
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1955
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
1985
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2016
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2048
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2078
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2110
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2212
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2244
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2278
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2304
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2335
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2368
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2405
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2433
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2467
Dim newText = oldText.
Replace
(start:=position, length:=TextToRemove.Length, newText:=TextToAdd)
2492
Dim newText = oldText.
Replace
(start:=position, length:=0, newText:="Delegate")
2546
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)