51 references to WithReplaceFirst
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (50)
IncrementalParsing\BinaryExpression.cs (2)
30var newTree = oldTree.WithReplaceFirst("+", "*"); 200var newTree = oldTree.WithReplaceFirst(oldName, newName);
IncrementalParsing\ChangingIdentifiers.cs (1)
267var newTree = oldTree.WithReplaceFirst(oldName, newName);
IncrementalParsing\CompoundAssignment.cs (1)
106var newTree = oldTree.WithReplaceFirst(oldName, newName);
IncrementalParsing\IncrementalParsingTests.cs (20)
53var newTree = oldTree.WithReplaceFirst("goo", "bar"); 74var newTree = oldTree.WithReplaceFirst("?", ""); 101var newTree = oldTree.WithReplaceFirst("goo", "bar"); 145var newTree = oldTree.WithReplaceFirst("goo", "bar"); 161var newTree = oldTree.WithReplaceFirst("goo", "bar"); 177var newTree = oldTree.WithReplaceFirst("goo", "bar"); 195var newTree = oldTree.WithReplaceFirst("class", "interface"); 213var newTree = oldTree.WithReplaceFirst("class", "struct"); 229var newTree = oldTree.WithReplaceFirst("goo", "bar"); 250var newTree = oldTree.WithReplaceFirst("GOO", "BAR"); 272var newTree = oldTree.WithReplaceFirst("GOO", "BAR"); 296var newTree = oldTree.WithReplaceFirst("GOO", "BAR"); 858var newTree = oldTree.WithReplaceFirst("extension", "class D"); 916var newTree = oldTree.WithReplaceFirst("extension", "class D"); 983var newTree = oldTree.WithReplaceFirst("extension", "class"); 1044var newTree = oldTree.WithReplaceFirst("class D", "extension"); 1100var newTree = oldTree.WithReplaceFirst("class D", "extension"); 1160var newTree = oldTree.WithReplaceFirst("struct", "extension"); 1222var newTree = oldTree.WithReplaceFirst("z1", "z2"); 3550var newTree = oldTree.WithReplaceFirst(@"world"" ", @"world"" ");
IncrementalParsing\UnaryExpression.cs (1)
82var newTree = oldTree.WithReplaceFirst(oldName, newName);
Syntax\SyntaxDiffingTests.cs (1)
247var newTree = oldTree.WithReplaceFirst("class", "struct");
Syntax\SyntaxEquivalenceTests.cs (24)
112var tree2 = tree1.WithReplaceFirst("N", "N1"); 122var tree2 = tree1.WithReplaceFirst("z", "y"); 132var tree2 = tree1.WithReplaceFirst("N", "N"); 142var tree2 = tree1.WithReplaceFirst("z", "z"); 202var tree2 = tree1.WithReplaceFirst("5", "6"); 212var tree2 = tree1.WithReplaceFirst("7", "8"); 216tree2 = tree1.WithReplaceFirst("5", "6"); 226var tree2 = tree1.WithReplaceFirst("5", "6"); 236var tree2 = tree1.WithReplaceFirst("5", "6"); 241tree2 = tree1.WithReplaceFirst("7", "8"); 251var tree2 = tree1.WithReplaceFirst("5", "6"); 261var tree2 = tree1.WithReplaceFirst("5", "6"); 271var tree2 = tree1.WithReplaceFirst("true", "false"); 281var tree2 = tree1.WithReplaceFirst("Write", "WriteLine"); 291var tree2 = tree1.WithReplaceFirst("System", "System.Linq"); 311var tree2 = tree1.WithReplaceFirst("void", "int"); 351var tree2 = tree1.WithReplaceFirst("Console.Write(0);", "/* Console.Write(0); */"); 361var tree2 = tree1.WithReplaceFirst("void Goo() { }", "/* void Goo() { } */"); 371var tree2 = tree1.WithReplaceFirst("void Goo() { }", "\r\n#if true\r\n void Goo() { }\r\n#endif\r\n"); 381var tree2 = tree1.WithReplaceFirst("void Goo() { }", "\r\n#if false\r\n void Goo() { }\r\n#endif\r\n"); 391var tree2 = tree1.WithReplaceFirst("int i;", "\r\n#if true\r\n int i;\r\n#endif\r\n"); 401var tree2 = tree1.WithReplaceFirst("int i;", "\r\n#if false\r\n int i;\r\n#endif\r\n"); 443var tree2 = tree1.WithReplaceFirst("N1", "N2"); 448tree2 = tree1.WithReplaceFirst("Hello", "World");
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
SyntaxTreeExtensions.cs (1)
59return WithReplaceFirst(syntaxTree, oldText, string.Empty);