Skip to content

Commit d02193d

Browse files
committed
Fix registration for PsesSemanticTokensHandler
1 parent 93b2ec0 commit d02193d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/PowerShellEditorServices/Services/TextDocument/Handlers/PsesSemanticTokensHandler.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//
1+
//
22
// Copyright (c) Microsoft. All rights reserved.
33
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
44
//
@@ -20,7 +20,7 @@ namespace Microsoft.PowerShell.EditorServices.Handlers
2020
{
2121
internal class PsesSemanticTokensHandler : SemanticTokensHandlerBase
2222
{
23-
private static readonly SemanticTokensRegistrationOptions s_registrationOptions = new SemanticTokensRegistrationOptions
23+
protected override SemanticTokensRegistrationOptions CreateRegistrationOptions(SemanticTokensCapability capability, ClientCapabilities clientCapabilities) => new SemanticTokensRegistrationOptions
2424
{
2525
DocumentSelector = LspUtils.PowerShellDocumentSelector,
2626
Legend = new SemanticTokensLegend(),
@@ -35,7 +35,6 @@ internal class PsesSemanticTokensHandler : SemanticTokensHandlerBase
3535
private readonly WorkspaceService _workspaceService;
3636

3737
public PsesSemanticTokensHandler(ILogger<PsesSemanticTokensHandler> logger, WorkspaceService workspaceService)
38-
: base(s_registrationOptions)
3938
{
4039
_logger = logger;
4140
_workspaceService = workspaceService;
@@ -160,7 +159,7 @@ protected override Task<SemanticTokensDocument> GetSemanticTokensDocument(
160159
ITextDocumentIdentifierParams @params,
161160
CancellationToken cancellationToken)
162161
{
163-
return Task.FromResult(new SemanticTokensDocument(GetRegistrationOptions().Legend));
162+
return Task.FromResult(new SemanticTokensDocument(RegistrationOptions.Legend));
164163
}
165164
}
166165
}

0 commit comments

Comments
 (0)