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)
65var newText = text.Replace(6, 0, "Beautiful "); 73var newText = text.Replace(6, 0, "Beautiful "); 356text = text.Replace(50 + i, 0, c.ToString()); 376text = text.Replace(i, 1, c.ToString()); 491t = t.Replace(t.Length, 0, b); // add b's 502t = t.Replace(t.Length, 0, "c"); 521t = t.Replace(t.Length, 0, b); // add b's 532t = t.Replace(t.Length, 0, c); // add c's that are the same segment size as the a's and b's 565var firstEdit = text.Replace(11, 3, "new"); 566secondEdit = firstEdit.Replace(11, 3, "newer");
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (42)
IncrementalParser\IncrementalParser.vb (42)
868Dim newText = oldText.Replace(start:=0, length:=0, newText:="B") 888Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:=str) 909Dim newText = oldText.Replace(start:=position, length:=1, newText:="m") 938Dim newText = oldText.Replace(start:=position, length:=5, newText:="True") 967Dim newText = oldText.Replace(start:=position, length:=1, newText:="m") 1012Dim newText = oldText.Replace(start:=position, length:=1, newText:="") 1032Dim newText = oldText.Replace(start:=position, length:=1, newText:="") 1108Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:=String.Empty) 1269Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="") 1293Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="") 1317Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Async Function ") 1341Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Async Function ") 1364Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="") 1387Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Async Function ") 1407Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="") 1427Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Iterator Function ") 1447Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="") 1467Dim newText = oldText.Replace(start:=position, length:=str.Length, newText:="Iterator Function ") 1771Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 1798Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 1827Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 1847Dim newText = oldText.Replace(start:=position, length:=1, newText:=TextToAdd) 1866Dim newText = oldText.Replace(start:=position, length:=1, newText:=TextToAdd) 1891Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 1924Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 1958Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 1988Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2019Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2051Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2081Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2113Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2215Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2247Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2281Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2307Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2338Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2371Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2408Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2436Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2470Dim newText = oldText.Replace(start:=position, length:=TextToRemove.Length, newText:=TextToAdd) 2495Dim newText = oldText.Replace(start:=position, length:=0, newText:="Delegate") 2549Dim 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)