This commit is contained in:
David Wengier 2024-08-23 07:05:50 +10:00
Родитель 3b2ba30db1
Коммит 4124ce4370
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -115,7 +115,7 @@ internal abstract class AbstractTextDocumentPresentationEndpointBase<TParams>(
// The responses we get back will be for virtual documents, so we have to map them back to the real
// document, and in the case of C#, map the returned ranges too
var edit = MapWorkspaceEdit(response, mapRanges: languageKind == RazorLanguageKind.CSharp, codeDocument, documentContext.Snapshot.Version);
var edit = MapWorkspaceEdit(response, mapRanges: languageKind == RazorLanguageKind.CSharp, codeDocument);
return edit;
}
@ -149,7 +149,7 @@ internal abstract class AbstractTextDocumentPresentationEndpointBase<TParams>(
return remappedChanges;
}
private TextDocumentEdit[] MapDocumentChanges(TextDocumentEdit[] documentEdits, bool mapRanges, RazorCodeDocument codeDocument, int hostDocumentVersion)
private TextDocumentEdit[] MapDocumentChanges(TextDocumentEdit[] documentEdits, bool mapRanges, RazorCodeDocument codeDocument)
{
using var remappedDocumentEdits = new PooledArrayBuilder<TextDocumentEdit>(documentEdits.Length);
foreach (var entry in documentEdits)
@ -206,12 +206,12 @@ internal abstract class AbstractTextDocumentPresentationEndpointBase<TParams>(
return mappedEdits.ToArray();
}
private WorkspaceEdit? MapWorkspaceEdit(WorkspaceEdit workspaceEdit, bool mapRanges, RazorCodeDocument codeDocument, int hostDocumentVersion)
private WorkspaceEdit? MapWorkspaceEdit(WorkspaceEdit workspaceEdit, bool mapRanges, RazorCodeDocument codeDocument)
{
if (workspaceEdit.TryGetTextDocumentEdits(out var documentEdits))
{
// The LSP spec says, we should prefer `DocumentChanges` property over `Changes` if available.
var remappedEdits = MapDocumentChanges(documentEdits, mapRanges, codeDocument, hostDocumentVersion);
var remappedEdits = MapDocumentChanges(documentEdits, mapRanges, codeDocument);
return new WorkspaceEdit()
{
DocumentChanges = remappedEdits