Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,15 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost;
[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
internal sealed class RazorStartupServiceFactory(
[Import(AllowDefault = true)] IUIContextActivationService? uIContextActivationService,
[Import(AllowDefault = true)] Lazy<IRazorCohostDynamicRegistrationService>? dynamicRegistrationService,
[Import(AllowDefault = true)] Lazy<ICohostStartupService>? cohostStartupService) : ILspServiceFactory
{
public ILspService CreateILspService(LspServices lspServices, WellKnownLspServerKinds serverKind)
{
return new RazorStartupService(uIContextActivationService, dynamicRegistrationService, cohostStartupService);
return new RazorStartupService(uIContextActivationService, cohostStartupService);
}

private class RazorStartupService(
IUIContextActivationService? uIContextActivationService,
#pragma warning disable CS0618 // Type or member is obsolete
Lazy<IRazorCohostDynamicRegistrationService>? dynamicRegistrationService,
#pragma warning restore CS0618 // Type or member is obsolete
Lazy<ICohostStartupService>? cohostStartupService) : ILspService, IOnInitialized, IDisposable
{
private readonly CancellationTokenSource _disposalTokenSource = new();
Expand All @@ -55,7 +51,7 @@ public Task OnInitializedAsync(ClientCapabilities clientCapabilities, RequestCon
return Task.CompletedTask;
}

if (dynamicRegistrationService is null && cohostStartupService is null)
if (cohostStartupService is null)
{
return Task.CompletedTask;
}
Expand Down Expand Up @@ -96,11 +92,6 @@ private async Task InitializeRazorAsync(ClientCapabilities clientCapabilities, R
{
await cohostStartupService.Value.StartupAsync(serializedClientCapabilities, requestContext, cancellationToken).ConfigureAwait(false);
}

if (dynamicRegistrationService is not null)
{
await dynamicRegistrationService.Value.RegisterAsync(serializedClientCapabilities, requestContext, cancellationToken).ConfigureAwait(false);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,3 @@ internal interface IRazorClientLanguageServerManager : ILspService
Task<TResponse> SendRequestAsync<TParams, TResponse>(string methodName, TParams @params, CancellationToken cancellationToken);
ValueTask SendRequestAsync<TParams>(string methodName, TParams @params, CancellationToken cancellationToken);
}

// TODO: Remove this interface once razor inserts and moves off of it.
internal interface IRazorCohostClientLanguageServerManager : IRazorClientLanguageServerManager
{ }
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Microsoft.CodeAnalysis.ExternalAccess.Razor;

internal class RazorClientLanguageServerManager(IClientLanguageServerManager clientLanguageServerManager) : IRazorCohostClientLanguageServerManager
internal class RazorClientLanguageServerManager(IClientLanguageServerManager clientLanguageServerManager) : IRazorClientLanguageServerManager
{
public Task<TResponse> SendRequestAsync<TParams, TResponse>(string methodName, TParams @params, CancellationToken cancellationToken)
=> clientLanguageServerManager.SendRequestAsync<TParams, TResponse>(methodName, @params, cancellationToken);
Expand Down
Loading