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