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