зеркало из https://github.com/dotnet/razor.git
Misc cleanup per PR feedback
This commit is contained in:
Родитель
b3762aff2b
Коммит
e68e12c1e9
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче