36 writes to NewText
Microsoft.CodeAnalysis.LanguageServer.Protocol (10)
Extensions\ProtocolConversions.cs (2)
348
NewText
= textChange.NewText,
441
NewText
= textChange.NewText ?? string.Empty
Handler\CodeActions\CodeActionResolveHelper.cs (1)
261
var edit = new TextEdit { Range = emptyDocumentRange,
NewText
= newText.ToString() };
Handler\Completion\CompletionResultFactory.cs (5)
499
NewText
= completionChangeNewText,
545
NewText
= change.NewText!,
690
NewText
= newText,
702
textEdit.
NewText
= lspSnippetChangeText;
720
textEdit.
NewText
= textEdit.NewText.Insert(relativeCaretPosition, "$0");
Handler\OnAutoInsert\OnAutoInsertHandler.cs (2)
138
NewText
= result.SnippetText.Insert(result.CaretOffset, "$0"),
202
NewText
= newText,
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (24)
CodeActions\CodeActionResolveTests.cs (5)
331
NewText
= """
361
NewText
= ""
462
NewText
= """
491
NewText
= ""
526
NewText
= 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;\r\n\r\n", Range = new() { Start = new(1, 0), End = new(1, 0) } };
242
var expectedAdditionalEdit = new TextEdit() {
NewText
= "using NS2;\r\n\r\n", Range = new() { Start = new(1, 0), End = new(1, 0) } };
301
var expectedEdit = new TextEdit { Range = new LSP.Range { Start = new(1, 5), End = new(1, 9) },
NewText
= "summary" };
730
var expectedAdditionalEdit1 = new TextEdit() {
NewText
= "using Namespace1;\r\n\r\n", Range = new() { Start = new(1, 0), End = new(1, 0) } };
738
var expectedAdditionalEdit2 = new TextEdit() {
NewText
= "using Namespace2;\r\n\r\n", Range = new() { Start = new(1, 0), End = new(1, 0) } };
1004
var expectedEdit = new TextEdit { Range = new LSP.Range { Start = new(0, 5), End = new(0, 5) },
NewText
= "ComplexItem" };
1061
var 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)\r\n {\r\n throw new System.NotImplementedException();\r\n }" };
Diagnostics\PullDiagnosticTests.cs (1)
690
var textEdit = new LSP.TextEdit { Range = textLocation.Range,
NewText
= "partial " };
Rename\RenameTests.cs (8)
47
var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() {
NewText
= renameValue, Range = location.Range });
102
var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() {
NewText
= renameValue, Range = location.Range });
147
var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() {
NewText
= renameValue, Range = location.Range });
227
var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() {
NewText
= renameValue, Range = location.Range });
272
var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() {
NewText
= renameValue, Range = location.Range });
273
var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() {
NewText
= renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) });
322
var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() {
NewText
= renameValue, Range = location.Range });
323
var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() {
NewText
= renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) });
SimplifyMethod\SimplifyMethodTests.cs (2)
41
NewText
= "private Task test() => throw new NotImplementedException();",
59
TextEdit = new TextEdit() { Range = location.Range,
NewText
= newText },
Microsoft.VisualStudio.LanguageServices.Xaml (2)
Implementation\LanguageServer\Handler\Completion\CompletionHandler.cs (1)
104
NewText
= xamlCompletion.InsertText,
Implementation\LanguageServer\Handler\OnAutoInsert\OnAutoInsertHandler.cs (1)
69
NewText
= insertText,
10 references to NewText
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Extensions\ProtocolConversions.cs (1)
354
=> new TextChange(RangeToTextSpan(edit.Range, oldText), edit.
NewText
);
Handler\Completion\CompletionResultFactory.cs (1)
720
textEdit.NewText = textEdit.
NewText
.Insert(relativeCaretPosition, "$0");
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
);
390
Assert.Equal("static void Main(string[] args)\r\n {\r\n \r\n }", results.TextEdit.Value.First.
NewText
);
Diagnostics\PullDiagnosticTests.cs (2)
694
await testLspServer.ReplaceTextAsync(textLocation.DocumentUri, (textEdit.Range, textEdit.
NewText
));
703
await testLspServer.ReplaceTextAsync(textLocation.DocumentUri, (textEdit.Range, textEdit.
NewText
));
Rename\RenameTests.cs (1)
189
Assert.True(documentEdit.Edits.All(edit => edit.Unify().
NewText
== renameText));