This commit is contained in:
Alex Gavrilov (DEV PROD) 2024-11-05 01:41:10 -08:00
Родитель b3762aff2b
Коммит e68e12c1e9
3 изменённых файлов: 11 добавлений и 13 удалений

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

@ -46,8 +46,8 @@ internal static class DelegatedCompletionHelper
Debug.Assert(languageKind != RazorLanguageKind.Razor,
$"{nameof(RewriteContext)} should be called for delegated completion only");
if (context.TriggerKind != CompletionTriggerKind.TriggerCharacter ||
context.TriggerCharacter is not { } triggerCharacter)
if (context.TriggerKind != CompletionTriggerKind.TriggerCharacter
|| context.TriggerCharacter is not { } triggerCharacter)
{
// Non-triggered based completion, the existing context is valid.
return context;

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

@ -69,7 +69,6 @@ internal sealed class RemoteCompletionService(in ServiceArgs args) : RazorDocume
DocumentMappingService,
cancellationToken)
.ConfigureAwait(false) is { } provisionalCompletionInfo)
{
return new CompletionPositionInfo(
provisionalCompletionInfo.ProvisionalTextEdit,
@ -118,14 +117,14 @@ internal sealed class RemoteCompletionService(in ServiceArgs args) : RazorDocume
{
var mappedPosition = documentPositionInfo.Position;
csharpCompletionList = await GetCSharpCompletionAsync(
remoteDocumentContext,
documentPositionInfo.HostDocumentIndex,
mappedPosition,
positionInfo.ProvisionalTextEdit,
completionContext,
razorCompletionOptions,
cancellationToken)
.ConfigureAwait(false);
remoteDocumentContext,
documentPositionInfo.HostDocumentIndex,
mappedPosition,
positionInfo.ProvisionalTextEdit,
completionContext,
razorCompletionOptions,
cancellationToken)
.ConfigureAwait(false);
if (csharpCompletionList is not null)
{

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

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT license. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
@ -440,7 +439,7 @@ public class CohostDocumentCompletionEndpointTest(ITestOutputHelper testOutputHe
var snippetInfos = snippetLabels.Select(label => new SnippetInfo(label, label, label, string.Empty, SnippetLanguage.Html)).ToImmutableArray();
snippetCompletionItemProvider.SnippetCache.Update(SnippetLanguage.Html, snippetInfos);
}
;
var endpoint = new CohostDocumentCompletionEndpoint(
RemoteServiceInvoker,
clientSettingsManager,