38 writes to NewText
Microsoft.CodeAnalysis.LanguageServer.Protocol (12)
Extensions\ProtocolConversions.cs (3)
362NewText = textChange.NewText, 463NewText = textChange.NewText ?? string.Empty 502NewText = textChange.NewText ?? string.Empty
Handler\CodeActions\CodeActionResolveHelper.cs (1)
259var edit = new TextEdit { Range = emptyDocumentRange, NewText = newText.ToString() };
Handler\Completion\CompletionResultFactory.cs (5)
508NewText = completionChangeNewText, 554NewText = change.NewText!, 699NewText = newText, 711textEdit.NewText = lspSnippetChangeText; 729textEdit.NewText = textEdit.NewText.Insert(relativeCaretPosition, "$0");
Handler\OnAutoInsert\OnAutoInsertHandler.cs (3)
155NewText = result.SnippetText.Insert(result.CaretOffset, "$0"), 220NewText = newText, 309edit.NewText = edit.NewText.Insert(0, "$0"); // Insert caret at the original position after the typed quote.
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (26)
CodeActions\CodeActionResolveTests.cs (5)
332NewText = """ 362NewText = "" 463NewText = """ 492NewText = "" 527NewText = newText,
Completion\CompletionFeaturesTests.cs (8)
156? new() { NewText = "System.Threading.Tasks.Task", Range = new() { Start = new(0, 20), End = new(0, 24) } } 157: new() { NewText = $"using System.Threading.Tasks;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } }; 242var expectedAdditionalEdit = new TextEdit() { NewText = $"using NS2;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } }; 301var expectedEdit = new TextEdit { Range = new LSP.Range { Start = new(1, 5), End = new(1, 9) }, NewText = "summary" }; 731var expectedAdditionalEdit1 = new TextEdit() { NewText = $"using Namespace1;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } }; 739var expectedAdditionalEdit2 = new TextEdit() { NewText = $"using Namespace2;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } }; 1005var expectedEdit = new TextEdit { Range = new LSP.Range { Start = new(0, 5), End = new(0, 5) }, NewText = "ComplexItem" }; 1062var expectedEdit = new TextEdit { Range = new LSP.Range { Start = new(7, 4), End = new(7, 13) }, NewText = $"public override global::System.Boolean AbstractMethod(global::System.Int32 x){Environment.NewLine} {{{Environment.NewLine} throw new System.NotImplementedException();{Environment.NewLine} }}" };
Diagnostics\PullDiagnosticTests.cs (1)
703var textEdit = new LSP.TextEdit { Range = textLocation.Range, NewText = "partial " };
Rename\RenameTests.cs (10)
48var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 103var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 148var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 228var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 281var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 282var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() { NewText = renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) }); 336var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 395var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 396var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() { NewText = renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) }); 448var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() { NewText = renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) });
SimplifyMethod\SimplifyMethodTests.cs (2)
41NewText = "private Task test() => throw new NotImplementedException();", 59TextEdit = new TextEdit() { Range = location.Range, NewText = newText },
11 references to NewText
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Extensions\ProtocolConversions.cs (1)
368=> new(RangeToTextSpan(edit.Range, oldText), edit.NewText);
Handler\Completion\CompletionResultFactory.cs (1)
729textEdit.NewText = textEdit.NewText.Insert(relativeCaretPosition, "$0");
Handler\OnAutoInsert\OnAutoInsertHandler.cs (1)
309edit.NewText = edit.NewText.Insert(0, "$0"); // Insert caret at the original position after the typed quote.
Protocol\CompletionItem.cs (1)
178/// <see cref="TextEdit.NewText"/> property on <see cref="TextEdit"/>.
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (7)
Completion\CompletionResolveTests.cs (4)
126""", results.TextEdit.Value.First.NewText); 175""", results.TextEdit.Value.First.NewText); 206""", textEdit.NewText); 390Assert.Equal("static void Main(string[] args)\r\n {\r\n \r\n }", results.TextEdit.Value.First.NewText.NormalizeLineEndings());
Diagnostics\PullDiagnosticTests.cs (2)
707await testLspServer.ReplaceTextAsync(textLocation.DocumentUri, (textEdit.Range, textEdit.NewText)); 716await testLspServer.ReplaceTextAsync(textLocation.DocumentUri, (textEdit.Range, textEdit.NewText));
Rename\RenameTests.cs (1)
190Assert.True(documentEdit.Edits.All(edit => edit.Unify().NewText == renameText));