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)
88var newText = text.Replace(6, 0, "Beautiful "); 96var newText = text.Replace(6, 0, "Beautiful "); 379text = text.Replace(50 + i, 0, c.ToString()); 399text = text.Replace(i, 1, c.ToString()); 514t = t.Replace(t.Length, 0, b); // add b's 525t = t.Replace(t.Length, 0, "c"); 544t = t.Replace(t.Length, 0, b); // add b's 555t = t.Replace(t.Length, 0, c); // add c's that are the same segment size as the a's and b's 588var firstEdit = text.Replace(11, 3, "new"); 589secondEdit = firstEdit.Replace(11, 3, "newer");
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (42)
IncrementalParser\IncrementalParser.vb (42)
865Dim newText = oldText.Replace(start:=0, length:=0, newText:="B") 885Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:=str) 906Dim newText = oldText.Replace(start:=position, length:=1, newText:="m") 935Dim newText = oldText.Replace(start:=position, length:=5, newText:="True") 964Dim newText = oldText.Replace(start:=position, length:=1, newText:="m") 1009Dim newText = oldText.Replace(start:=position, length:=1, newText:="") 1029Dim newText = oldText.Replace(start:=position, length:=1, newText:="") 1105Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:=String.Empty) 1266Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="") 1290Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="") 1314Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Async Function ") 1338Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Async Function ") 1361Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="") 1384Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Async Function ") 1404Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="") 1424Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Iterator Function ") 1444Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="") 1464Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Iterator Function ") 1768Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 1795Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 1824Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 1844Dim newText = oldText.Replace(start:=position, length:=1, newText:=TextToAdd) 1863Dim newText = oldText.Replace(start:=position, length:=1, newText:=TextToAdd) 1888Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 1921Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 1955Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 1985Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2016Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2048Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2078Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2110Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2212Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2244Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2278Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2304Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2335Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2368Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2405Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2433Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2467Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2492Dim newText = oldText.Replace(start:=position, length:=0, newText:="Delegate") 2546Dim newText = oldText.Replace(start:=position, length:=toReplace.Length, newText:="Property")
Microsoft.CodeAnalysis.Workspaces.UnitTests (12)
SolutionTests\ProjectSemanticVersionTests.cs (12)
48document.WithText(text.Replace(position, length: 0, "public async Task M() { }")).Project); 62document.WithText(text.Replace(position, length: 0, "int x = 10;")).Project); 76document.WithText(text.Replace(position, length: 0, "int x = 10")).Project); 90document.WithText(text.Replace(position, length: 0, " \r\n")).Project); 104document.WithText(text.Replace(position, length: 0, "public int X = 20;")).Project); 132document.WithText(text.Replace(position, length: 0, "public const int X = 20;")).Project); 160document.WithText(text.Replace(position, length: 0, "Public Sub M()\r\nEnd Sub")).Project); 174document.WithText(text.Replace(position, length: 0, "Dim x As Integer = 10")).Project); 188document.WithText(text.Replace(position, length: 0, "Optional x As Integer = 10")).Project); 202document.WithText(text.Replace(position, length: 0, " \r\n")).Project); 216document.WithText(text.Replace(position, length: 0, "Public X As Integer = 20")).Project); 244document.WithText(text.Replace(position, length: 0, "Public Const X As Integer = 20")).Project);
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
CodeModel\VisualBasicCodeModelService.vb (1)
4081text = text.Replace(position, 0, textToInsert)