Skip to content

Commit 5d628d4

Browse files
committed
Remove cohost endpoints
They'll be back, I promise!
1 parent 0a163de commit 5d628d4

File tree

12 files changed

+14
-543
lines changed

12 files changed

+14
-543
lines changed

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Extensions/IServiceCollectionExtensions.cs

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -114,29 +114,20 @@ public static void AddDiagnosticServices(this IServiceCollection services)
114114
services.AddSingleton(sp => new Lazy<RazorTranslateDiagnosticsService>(sp.GetRequiredService<RazorTranslateDiagnosticsService>));
115115
}
116116

117-
public static void AddHoverServices(this IServiceCollection services, LanguageServerFeatureOptions featureOptions)
117+
public static void AddHoverServices(this IServiceCollection services)
118118
{
119-
// Hover services aren't needed in a cohosted world
120-
if (featureOptions.UseRazorCohostServer)
121-
{
122-
return;
123-
}
124-
125119
services.AddHandlerWithCapabilities<HoverEndpoint>();
126120

127121
services.AddSingleton<IHoverService, HoverService>();
128122
}
129123

130-
public static void AddSemanticTokensServices(this IServiceCollection services, LanguageServerFeatureOptions featureOptions)
124+
public static void AddSemanticTokensServices(this IServiceCollection services)
131125
{
132-
if (!featureOptions.UseRazorCohostServer)
133-
{
134-
services.AddHandlerWithCapabilities<SemanticTokensRangeEndpoint>();
135-
// Ensure that we don't add the default service if something else has added one.
136-
services.TryAddSingleton<IRazorSemanticTokensInfoService, RazorSemanticTokensInfoService>();
126+
services.AddHandlerWithCapabilities<SemanticTokensRangeEndpoint>();
127+
// Ensure that we don't add the default service if something else has added one.
128+
services.TryAddSingleton<IRazorSemanticTokensInfoService, RazorSemanticTokensInfoService>();
137129

138-
services.AddSingleton<RazorSemanticTokensLegendService>();
139-
}
130+
services.AddSingleton<RazorSemanticTokensLegendService>();
140131

141132
services.AddHandler<RazorSemanticTokensRefreshEndpoint>();
142133

@@ -240,12 +231,7 @@ public static void AddDocumentManagementServices(this IServiceCollection service
240231
services.AddSingleton<DocumentProcessedListener, RazorDiagnosticsPublisher>();
241232
}
242233

243-
// Don't generate documents in the language server if cohost is enabled, let cohost do it.
244-
if (!featureOptions.UseRazorCohostServer)
245-
{
246-
services.AddSingleton<DocumentProcessedListener, GeneratedDocumentSynchronizer>();
247-
}
248-
234+
services.AddSingleton<DocumentProcessedListener, GeneratedDocumentSynchronizer>();
249235
services.AddSingleton<DocumentProcessedListener, CodeDocumentReferenceHolder>();
250236

251237
services.AddSingleton<IProjectSnapshotManagerAccessor, LspProjectSnapshotManagerAccessor>();

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverEndpoint.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT license. See License.txt in the project root for license information.
33

44
using System;
5-
using System.Diagnostics;
65
using System.Threading;
76
using System.Threading.Tasks;
87
using Microsoft.AspNetCore.Razor.LanguageServer.Common;
@@ -29,7 +28,6 @@ public HoverEndpoint(
2928
: base(languageServerFeatureOptions, documentMappingService, clientConnection, loggerFactory.CreateLogger<HoverEndpoint>())
3029
{
3130
_hoverService = hoverService ?? throw new ArgumentNullException(nameof(hoverService));
32-
Debug.Assert(languageServerFeatureOptions.UseRazorCohostServer == false, "This endpoint should not be registered when using the Razor Cohost server.");
3331
}
3432

3533
public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, VSInternalClientCapabilities clientCapabilities)

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ protected override ILspServices ConstructLspServices()
128128
services.AddLifeCycleServices(this, _clientConnection, _lspServerActivationTracker);
129129

130130
services.AddDiagnosticServices();
131-
services.AddSemanticTokensServices(featureOptions);
131+
services.AddSemanticTokensServices();
132132
services.AddDocumentManagementServices(featureOptions);
133133
services.AddCompletionServices(featureOptions);
134134
services.AddFormattingServices();
135135
services.AddCodeActionsServices();
136136
services.AddOptionsServices(_lspOptions);
137-
services.AddHoverServices(featureOptions);
137+
services.AddHoverServices();
138138
services.AddTextDocumentServices();
139139

140140
// Auto insert
@@ -183,11 +183,8 @@ static void AddHandlers(IServiceCollection services, LanguageServerFeatureOption
183183
services.AddHandler<RazorBreakpointSpanEndpoint>();
184184
services.AddHandler<RazorProximityExpressionsEndpoint>();
185185

186-
if (!featureOptions.UseRazorCohostServer)
187-
{
188-
services.AddHandlerWithCapabilities<DocumentColorEndpoint>();
189-
services.AddSingleton<IDocumentColorService, DocumentColorService>();
190-
}
186+
services.AddHandlerWithCapabilities<DocumentColorEndpoint>();
187+
services.AddSingleton<IDocumentColorService, DocumentColorService>();
191188

192189
services.AddHandler<ColorPresentationEndpoint>();
193190
services.AddHandlerWithCapabilities<FoldingRangeEndpoint>();
@@ -197,13 +194,10 @@ static void AddHandlers(IServiceCollection services, LanguageServerFeatureOption
197194
services.AddHandlerWithCapabilities<DocumentSymbolEndpoint>();
198195
services.AddHandlerWithCapabilities<MapCodeEndpoint>();
199196

200-
if (!featureOptions.UseRazorCohostServer)
201-
{
202-
services.AddSingleton<IInlayHintService, InlayHintService>();
197+
services.AddSingleton<IInlayHintService, InlayHintService>();
203198

204-
services.AddHandlerWithCapabilities<InlayHintEndpoint>();
205-
services.AddHandler<InlayHintResolveEndpoint>();
206-
}
199+
services.AddHandlerWithCapabilities<InlayHintEndpoint>();
200+
services.AddHandler<InlayHintResolveEndpoint>();
207201
}
208202
}
209203

src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/Cohost/CohostDocumentColorEndpoint.cs

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

src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/Cohost/CohostHoverEndpoint.cs

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

src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/Cohost/CohostInlayHintEndpoint.cs

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

src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/Cohost/CohostInlayHintResolveEndpoint.cs

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

src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/Cohost/CohostSemanticTokensRangeEndpoint.cs

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

0 commit comments

Comments
 (0)