Skip to content

Commit c3fc0f0

Browse files
authored
Minor Razor EA cleanup (#78315)
2 parents 080a17d + 2c28c97 commit c3fc0f0

File tree

6 files changed

+3
-67
lines changed

6 files changed

+3
-67
lines changed

src/Tools/ExternalAccess/Razor/Features/Cohost/IRazorCohostDynamicRegistrationService.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/Tools/ExternalAccess/Razor/Features/Cohost/IRazorCustomMessageTarget.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Tools/ExternalAccess/Razor/Features/Cohost/RazorCohostClientLanguageServerManagerFactory.cs

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/Tools/ExternalAccess/Razor/Features/Cohost/RazorStartupServiceFactory.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,15 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost;
2222
[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
2323
internal sealed class RazorStartupServiceFactory(
2424
[Import(AllowDefault = true)] IUIContextActivationService? uIContextActivationService,
25-
[Import(AllowDefault = true)] Lazy<IRazorCohostDynamicRegistrationService>? dynamicRegistrationService,
2625
[Import(AllowDefault = true)] Lazy<ICohostStartupService>? cohostStartupService) : ILspServiceFactory
2726
{
2827
public ILspService CreateILspService(LspServices lspServices, WellKnownLspServerKinds serverKind)
2928
{
30-
return new RazorStartupService(uIContextActivationService, dynamicRegistrationService, cohostStartupService);
29+
return new RazorStartupService(uIContextActivationService, cohostStartupService);
3130
}
3231

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

58-
if (dynamicRegistrationService is null && cohostStartupService is null)
54+
if (cohostStartupService is null)
5955
{
6056
return Task.CompletedTask;
6157
}
@@ -96,11 +92,6 @@ private async Task InitializeRazorAsync(ClientCapabilities clientCapabilities, R
9692
{
9793
await cohostStartupService.Value.StartupAsync(serializedClientCapabilities, requestContext, cancellationToken).ConfigureAwait(false);
9894
}
99-
100-
if (dynamicRegistrationService is not null)
101-
{
102-
await dynamicRegistrationService.Value.RegisterAsync(serializedClientCapabilities, requestContext, cancellationToken).ConfigureAwait(false);
103-
}
10495
}
10596
}
10697
}

src/Tools/ExternalAccess/Razor/Features/IRazorClientLanguageServerManager.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,3 @@ internal interface IRazorClientLanguageServerManager : ILspService
1616
Task<TResponse> SendRequestAsync<TParams, TResponse>(string methodName, TParams @params, CancellationToken cancellationToken);
1717
ValueTask SendRequestAsync<TParams>(string methodName, TParams @params, CancellationToken cancellationToken);
1818
}
19-
20-
// TODO: Remove this interface once razor inserts and moves off of it.
21-
internal interface IRazorCohostClientLanguageServerManager : IRazorClientLanguageServerManager
22-
{ }

src/Tools/ExternalAccess/Razor/Features/RazorClientLanguageServerManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Microsoft.CodeAnalysis.ExternalAccess.Razor;
1010

11-
internal class RazorClientLanguageServerManager(IClientLanguageServerManager clientLanguageServerManager) : IRazorCohostClientLanguageServerManager
11+
internal class RazorClientLanguageServerManager(IClientLanguageServerManager clientLanguageServerManager) : IRazorClientLanguageServerManager
1212
{
1313
public Task<TResponse> SendRequestAsync<TParams, TResponse>(string methodName, TParams @params, CancellationToken cancellationToken)
1414
=> clientLanguageServerManager.SendRequestAsync<TParams, TResponse>(methodName, @params, cancellationToken);

0 commit comments

Comments
 (0)