diff --git a/src/Tools/ExternalAccess/Razor/Features/Cohost/Handlers/SemanticTokensRange.cs b/src/Tools/ExternalAccess/Razor/Features/Cohost/Handlers/SemanticTokensRange.cs index aca32fd5cb26c..10811b65078ef 100644 --- a/src/Tools/ExternalAccess/Razor/Features/Cohost/Handlers/SemanticTokensRange.cs +++ b/src/Tools/ExternalAccess/Razor/Features/Cohost/Handlers/SemanticTokensRange.cs @@ -13,18 +13,6 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost.Handlers { internal static class SemanticTokensRange { - public static void RegisterRefresh(RazorCohostRequestContext requestContext) - { - var refreshQueue = requestContext.GetRequiredService(); - refreshQueue.AllowRazorRefresh = true; - } - - public static Task TryEnqueueRefreshComputationAsync(RazorCohostRequestContext requestContext, Project project, CancellationToken cancellationToken) - { - var refreshQueue = requestContext.GetRequiredService(); - return refreshQueue.TryEnqueueRefreshComputationAsync(project, cancellationToken); - } - public static Task GetSemanticTokensAsync( Document document, ImmutableArray spans, diff --git a/src/Tools/ExternalAccess/Razor/Features/Cohost/RazorSemanticTokensRefreshQueueWrapper.cs b/src/Tools/ExternalAccess/Razor/Features/Cohost/RazorSemanticTokensRefreshQueueWrapper.cs index 09c4cabc17d9d..ef5b47ed1dd73 100644 --- a/src/Tools/ExternalAccess/Razor/Features/Cohost/RazorSemanticTokensRefreshQueueWrapper.cs +++ b/src/Tools/ExternalAccess/Razor/Features/Cohost/RazorSemanticTokensRefreshQueueWrapper.cs @@ -27,7 +27,7 @@ public ILspService CreateILspService(LspServices lspServices, WellKnownLspServer return new RazorSemanticTokensRefreshQueueWrapper(semanticTokensRefreshQueue); } - internal class RazorSemanticTokensRefreshQueueWrapper(SemanticTokensRefreshQueue semanticTokensRefreshQueue) : IRazorSemanticTokensRefreshQueue, IDisposable + internal class RazorSemanticTokensRefreshQueueWrapper(SemanticTokensRefreshQueue semanticTokensRefreshQueue) : IRazorSemanticTokensRefreshQueue { public void Initialize(string clientCapabilitiesString) { @@ -36,14 +36,10 @@ public void Initialize(string clientCapabilitiesString) // Initialize method in the queue itself is resilient to being called twice, so it doesn't actually do // any harm. semanticTokensRefreshQueue.Initialize(clientCapabilities); + semanticTokensRefreshQueue.AllowRazorRefresh = true; } public Task TryEnqueueRefreshComputationAsync(Project project, CancellationToken cancellationToken) => semanticTokensRefreshQueue.TryEnqueueRefreshComputationAsync(project, cancellationToken); - - public void Dispose() - { - semanticTokensRefreshQueue.Dispose(); - } } }