45 writes to Range
Microsoft.CodeAnalysis.LanguageServer.Protocol (9)
Extensions\ProtocolConversions.cs (3)
374Range = TextSpanToRange(textChange.Span, oldText) 473Range = MappedSpanResultToRange(mappedSpan), 512Range = TextSpanToRange(textChange.Span, mappedText),
Handler\CodeActions\CodeActionResolveHelper.cs (1)
259var edit = new TextEdit { Range = emptyDocumentRange, NewText = newText.ToString() };
Handler\Completion\CompletionResultFactory.cs (3)
511Range = ProtocolConversions.TextSpanToRange(completionChangeSpan, documentText), 557Range = ProtocolConversions.TextSpanToRange(change.Span, sourceText), 702Range = ProtocolConversions.TextSpanToRange(completionChangeSpan, documentText),
Handler\OnAutoInsert\OnAutoInsertHandler.cs (2)
155Range = ProtocolConversions.TextSpanToRange(result.SpanToReplace, sourceText) 220Range = ProtocolConversions.TextSpanToRange(textChange.Span, sourceText)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (26)
CodeActions\CodeActionResolveTests.cs (5)
319Range = new LSP.Range 349Range = new LSP.Range 450Range = new LSP.Range 479Range = new LSP.Range 528Range = 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;{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)
683var textEdit = new LSP.TextEdit { Range = textLocation.Range, NewText = "partial " };
Rename\RenameTests.cs (12)
49var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 104var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 149var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 229var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 282var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 283var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() { NewText = renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) }); 337var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 389var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 390var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() { NewText = renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) }); 455var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range }); 456var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() { NewText = renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) }); 508var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() { NewText = renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) });
Microsoft.CodeAnalysis.Razor.Workspaces (8)
CodeActions\CSharp\UnformattedRemappingCSharpCodeActionResolver.cs (1)
65textEdit.Range = originalRange;
CodeActions\Razor\ExtractToComponentCodeActionResolver.cs (2)
92Range = removeRange, 104Range = LspFactory.DefaultRange,
CodeActions\Razor\SimplifyFullyQualifiedComponentCodeActionResolver.cs (2)
78Range = endTagRange, 87Range = startTagRange,
CodeActions\Razor\SimplifyTagToSelfClosingCodeActionResolver.cs (1)
46Range = removeRange,
Completion\Delegation\TextEditResponseRewriter.cs (1)
57textEdit.Range = translatedRange;
Extensions\LspFactory.cs (1)
183=> new() { Range = range, NewText = newText };
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (1)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostOnAutoInsertEndpointTest.cs (1)
569TextEdit = new TextEdit() { NewText = delegatedResponseText, Range = new() { Start = start, End = end } },
Microsoft.VisualStudioCode.RazorExtension.UnitTests (1)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostOnAutoInsertEndpointTest.cs (1)
569TextEdit = new TextEdit() { NewText = delegatedResponseText, Range = new() { Start = start, End = end } },
16 references to Range
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Extensions\ProtocolConversions.cs (1)
379=> new(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)
687await testLspServer.ReplaceTextAsync(textLocation.DocumentUri, (textEdit.Range, textEdit.NewText)); 696await testLspServer.ReplaceTextAsync(textLocation.DocumentUri, (textEdit.Range, textEdit.NewText));
Rename\RenameTests.cs (1)
190Assert.Equal(expectedMappedRanges, documentEdit.Edits.Select(edit => edit.Unify().Range));
Microsoft.CodeAnalysis.Razor.Workspaces (5)
CodeActions\CSharp\UnformattedRemappingCSharpCodeActionResolver.cs (1)
59if (!_documentMappingService.TryMapToRazorDocumentRange(codeDocument.GetRequiredCSharpDocument(), textEdit.Range, MappingBehavior.Inclusive, out var originalRange))
Completion\Delegation\TextEditResponseRewriter.cs (1)
56var translatedRange = TranslateRange(hostDocumentPosition, projectedPosition, textEdit.Range);
Extensions\LspExtensions_SourceText.cs (2)
46=> new(text.GetTextSpan(edit.Range), edit.NewText); 51Span = text.GetTextSpan(edit.Range).ToRazorTextSpan(),
Protocol\AutoInsert\RemoteAutoInsertTextEdit.cs (1)
17edit.TextEdit.Range.ToLinePositionSpan(),
Microsoft.CodeAnalysis.Remote.Razor (1)
AutoInsert\RemoteAutoInsertService.cs (1)
159var csharpTextChange = new TextChange(csharpSourceText.GetTextSpan(autoInsertResponseItem.TextEdit.Range), autoInsertResponseItem.TextEdit.NewText);
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (2)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostInlayHintEndpointTest.cs (2)
264.OrderByDescending(e => e.Range.Start.Line) 265.ThenByDescending(e => e.Range.Start.Character)
Microsoft.VisualStudioCode.RazorExtension.UnitTests (2)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostInlayHintEndpointTest.cs (2)
264.OrderByDescending(e => e.Range.Start.Line) 265.ThenByDescending(e => e.Range.Start.Character)