30 references to Replace
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (2)
63
var textWithOpenParenthesis = text.
Replace
(openParenthesisPosition, 0, "(");
113
var textWithCloseParenthesis = sourceText.
Replace
(closeParenPosition, 0, ")");
Microsoft.CodeAnalysis.CSharp.Features (2)
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (2)
63
var textWithOpenParenthesis = text.
Replace
(openParenthesisPosition, 0, "(");
113
var textWithCloseParenthesis = sourceText.
Replace
(closeParenPosition, 0, ")");
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (4)
86
.WithDocumentText(documentId, text.
Replace
(textString.IndexOf("public"), "public".Length, "internal"))
87
.WithDocumentText(linkedDocumentId, linkedText.
Replace
(textString.LastIndexOf("public"), "public".Length, "private"));
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.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);