17
17
18
18
namespace Microsoft . PowerShell . EditorServices . Handlers
19
19
{
20
- internal class PsesDocumentHighlightHandler : IDocumentHighlightHandler
20
+ internal class PsesDocumentHighlightHandler : DocumentHighlightHandlerBase
21
21
{
22
22
private static readonly DocumentHighlightContainer s_emptyHighlightContainer = new DocumentHighlightContainer ( ) ;
23
-
24
23
private readonly ILogger _logger ;
25
-
26
24
private readonly WorkspaceService _workspaceService ;
27
-
28
25
private readonly SymbolsService _symbolsService ;
29
26
30
- private DocumentHighlightCapability _capability ;
31
-
32
27
public PsesDocumentHighlightHandler (
33
28
ILoggerFactory loggerFactory ,
34
29
WorkspaceService workspaceService ,
@@ -40,15 +35,12 @@ public PsesDocumentHighlightHandler(
40
35
_logger . LogInformation ( "highlight handler loaded" ) ;
41
36
}
42
37
43
- public DocumentHighlightRegistrationOptions GetRegistrationOptions ( )
38
+ protected override DocumentHighlightRegistrationOptions CreateRegistrationOptions ( DocumentHighlightCapability capability , ClientCapabilities clientCapabilities ) => new DocumentHighlightRegistrationOptions
44
39
{
45
- return new DocumentHighlightRegistrationOptions
46
- {
47
- DocumentSelector = LspUtils . PowerShellDocumentSelector
48
- } ;
49
- }
40
+ DocumentSelector = LspUtils . PowerShellDocumentSelector
41
+ } ;
50
42
51
- public Task < DocumentHighlightContainer > Handle (
43
+ public override Task < DocumentHighlightContainer > Handle (
52
44
DocumentHighlightParams request ,
53
45
CancellationToken cancellationToken )
54
46
{
@@ -76,10 +68,5 @@ public Task<DocumentHighlightContainer> Handle(
76
68
77
69
return Task . FromResult ( new DocumentHighlightContainer ( highlights ) ) ;
78
70
}
79
-
80
- public void SetCapability ( DocumentHighlightCapability capability )
81
- {
82
- _capability = capability ;
83
- }
84
71
}
85
72
}
0 commit comments