Fix auto insert service after merge from main

This commit is contained in:
David Wengier 2024-09-09 16:42:50 +10:00
Родитель 64786251c1
Коммит 98421fada3
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -154,8 +154,8 @@ internal sealed class RemoteAutoInsertService(in ServiceArgs args)
var razorFormattingOptions = options.FormattingOptions;
var sourceText = await remoteDocumentContext.GetSourceTextAsync(cancellationToken).ConfigureAwait(false);
var csharpTextChange = new TextChange(sourceText.GetTextSpan(autoInsertResponseItem.TextEdit.Range), autoInsertResponseItem.TextEdit.NewText);
var csharpSourceText = await remoteDocumentContext.GetCSharpSourceTextAsync(cancellationToken).ConfigureAwait(false);
var csharpTextChange = new TextChange(csharpSourceText.GetTextSpan(autoInsertResponseItem.TextEdit.Range), autoInsertResponseItem.TextEdit.NewText);
var mappedChange = autoInsertResponseItem.TextEditFormat == RoslynInsertTextFormat.Snippet
? await _razorFormattingService.TryGetCSharpSnippetFormattingEditAsync(
remoteDocumentContext,
@ -175,6 +175,7 @@ internal sealed class RemoteAutoInsertService(in ServiceArgs args)
return Response.NoFurtherHandling;
}
var sourceText = await remoteDocumentContext.GetSourceTextAsync(cancellationToken).ConfigureAwait(false);
return Response.Results(
new RemoteAutoInsertTextEdit(
sourceText.GetLinePositionSpan(change.Span),