17
17
18
18
namespace Microsoft . PowerShell . EditorServices . Handlers
19
19
{
20
- internal class PsesHoverHandler : IHoverHandler
20
+ internal class PsesHoverHandler : HoverHandlerBase
21
21
{
22
22
private readonly ILogger _logger ;
23
23
private readonly SymbolsService _symbolsService ;
24
24
private readonly WorkspaceService _workspaceService ;
25
25
26
- private HoverCapability _capability ;
27
-
28
26
public PsesHoverHandler (
29
27
ILoggerFactory factory ,
30
28
SymbolsService symbolsService ,
@@ -35,15 +33,12 @@ public PsesHoverHandler(
35
33
_workspaceService = workspaceService ;
36
34
}
37
35
38
- public HoverRegistrationOptions GetRegistrationOptions ( )
36
+ protected override HoverRegistrationOptions CreateRegistrationOptions ( HoverCapability capability , ClientCapabilities clientCapabilities ) => new HoverRegistrationOptions
39
37
{
40
- return new HoverRegistrationOptions
41
- {
42
- DocumentSelector = LspUtils . PowerShellDocumentSelector
43
- } ;
44
- }
38
+ DocumentSelector = LspUtils . PowerShellDocumentSelector
39
+ } ;
45
40
46
- public async Task < Hover > Handle ( HoverParams request , CancellationToken cancellationToken )
41
+ public override async Task < Hover > Handle ( HoverParams request , CancellationToken cancellationToken )
47
42
{
48
43
if ( cancellationToken . IsCancellationRequested )
49
44
{
@@ -81,11 +76,6 @@ await _symbolsService.FindSymbolDetailsAtLocationAsync(
81
76
} ;
82
77
}
83
78
84
- public void SetCapability ( HoverCapability capability )
85
- {
86
- _capability = capability ;
87
- }
88
-
89
79
private static Range GetRangeFromScriptRegion ( ScriptRegion scriptRegion )
90
80
{
91
81
return new Range
0 commit comments