-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move capabilities logic back into the endpoint
- Loading branch information
1 parent
5b6b13c
commit dfe6ec4
Showing
4 changed files
with
96 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
.../Microsoft.VisualStudio.LanguageServerClient.Razor/Cohost/IDynamicRegistrationProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT license. See License.txt in the project root for license information. | ||
|
||
using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost; | ||
using Microsoft.VisualStudio.LanguageServer.Protocol; | ||
|
||
namespace Microsoft.VisualStudio.LanguageServerClient.Razor.Cohost; | ||
|
||
internal interface IDynamicRegistrationProvider | ||
{ | ||
Registration? GetRegistration(VSInternalClientCapabilities clientCapabilities, DocumentFilter[] filter, RazorCohostRequestContext requestContext); | ||
} |
26 changes: 26 additions & 0 deletions
26
...ft.VisualStudio.LanguageServerClient.Razor/Cohost/RazorCohostClientCapabilitiesService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// 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.Composition; | ||
using Microsoft.CodeAnalysis.Razor.Workspaces.Protocol; | ||
using Microsoft.VisualStudio.LanguageServer.Protocol; | ||
|
||
namespace Microsoft.VisualStudio.LanguageServerClient.Razor.Cohost; | ||
|
||
[Shared] | ||
[Export(typeof(RazorCohostClientCapabilitiesService))] | ||
[Export(typeof(IClientCapabilitiesService))] | ||
internal class RazorCohostClientCapabilitiesService : IClientCapabilitiesService | ||
{ | ||
private VSInternalClientCapabilities? _clientCapabilities; | ||
|
||
public bool CanGetClientCapabilities => _clientCapabilities is not null; | ||
|
||
public VSInternalClientCapabilities ClientCapabilities => _clientCapabilities ?? throw new InvalidOperationException("Client capabilities requested before initialized."); | ||
|
||
public void SetCapabilities(VSInternalClientCapabilities clientCapabilities) | ||
{ | ||
_clientCapabilities = clientCapabilities; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters