31 writes to Range
Microsoft.CodeAnalysis.LanguageServer.Protocol (8)
Extensions\ProtocolConversions.cs (2)
349Range = TextSpanToRange(textChange.Span, oldText) 440Range = MappedSpanResultToRange(mappedSpan),
Handler\CodeActions\CodeActionResolveHelper.cs (1)
261var edit = new TextEdit { Range = emptyDocumentRange, NewText = newText.ToString() };
Handler\Completion\CompletionResultFactory.cs (3)
500Range = ProtocolConversions.TextSpanToRange(completionChangeSpan, documentText), 546Range = ProtocolConversions.TextSpanToRange(change.Span, sourceText), 691Range = ProtocolConversions.TextSpanToRange(completionChangeSpan, documentText),
Handler\OnAutoInsert\OnAutoInsertHandler.cs (2)
139Range = ProtocolConversions.TextSpanToRange(result.SpanToReplace, sourceText) 203Range = ProtocolConversions.TextSpanToRange(textChange.Span, sourceText)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (21)
CodeActions\CodeActionResolveTests.cs (5)
318Range = new LSP.Range 348Range = new LSP.Range 449Range = new LSP.Range 478Range = new LSP.Range 527Range = range
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)
689var textEdit = new LSP.TextEdit { Range = textLocation.Range, NewText = "partial " };
Rename\RenameTests.cs (5)
39var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 94var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 139var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 221var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 264var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range });
SimplifyMethod\SimplifyMethodTests.cs (2)
42Range = methodInsertionLocation.Range, 59TextEdit = new TextEdit() { Range = location.Range, NewText = newText },
Microsoft.VisualStudio.LanguageServices.Xaml (2)
Implementation\LanguageServer\Handler\Completion\CompletionHandler.cs (1)
105Range = ProtocolConversions.LinePositionToRange(text.Lines.GetLinePositionSpan(xamlCompletion.Span.Value))
Implementation\LanguageServer\Handler\OnAutoInsert\OnAutoInsertHandler.cs (1)
70Range = ProtocolConversions.TextSpanToRange(result.TextChange.Span, text)
6 references to Range
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Extensions\ProtocolConversions.cs (1)
354=> new TextChange(RangeToTextSpan(edit.Range, oldText), edit.NewText);
Protocol\CompletionItem.cs (1)
209/// The <see cref="TextEdit.Range"/> must be single-line and must contain the position at which completion was requested.
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (4)
Completion\CompletionResolveTests.cs (1)
393Assert.Equal(editRange, results.TextEdit.Value.First.Range);
Diagnostics\PullDiagnosticTests.cs (2)
693await testLspServer.ReplaceTextAsync(textLocation.DocumentUri, (textEdit.Range, textEdit.NewText)); 702await testLspServer.ReplaceTextAsync(textLocation.DocumentUri, (textEdit.Range, textEdit.NewText));
Rename\RenameTests.cs (1)
180Assert.Equal(expectedMappedRanges, documentEdit.Edits.Select(edit => edit.Unify().Range));