18
18
19
19
namespace Microsoft . PowerShell . EditorServices . Handlers
20
20
{
21
- internal class PsesDefinitionHandler : IDefinitionHandler
21
+ internal class PsesDefinitionHandler : DefinitionHandlerBase
22
22
{
23
23
private readonly ILogger _logger ;
24
24
private readonly SymbolsService _symbolsService ;
25
25
private readonly WorkspaceService _workspaceService ;
26
26
27
- private DefinitionCapability _capability ;
28
-
29
27
public PsesDefinitionHandler (
30
28
ILoggerFactory factory ,
31
29
SymbolsService symbolsService ,
@@ -36,15 +34,12 @@ public PsesDefinitionHandler(
36
34
_workspaceService = workspaceService ;
37
35
}
38
36
39
- public DefinitionRegistrationOptions GetRegistrationOptions ( )
37
+ protected override DefinitionRegistrationOptions CreateRegistrationOptions ( DefinitionCapability capability , ClientCapabilities clientCapabilities ) => new DefinitionRegistrationOptions
40
38
{
41
- return new DefinitionRegistrationOptions
42
- {
43
- DocumentSelector = LspUtils . PowerShellDocumentSelector
44
- } ;
45
- }
39
+ DocumentSelector = LspUtils . PowerShellDocumentSelector
40
+ } ;
46
41
47
- public async Task < LocationOrLocationLinks > Handle ( DefinitionParams request , CancellationToken cancellationToken )
42
+ public override async Task < LocationOrLocationLinks > Handle ( DefinitionParams request , CancellationToken cancellationToken )
48
43
{
49
44
ScriptFile scriptFile = _workspaceService . GetFile ( request . TextDocument . Uri ) ;
50
45
@@ -76,11 +71,6 @@ public async Task<LocationOrLocationLinks> Handle(DefinitionParams request, Canc
76
71
return new LocationOrLocationLinks ( definitionLocations ) ;
77
72
}
78
73
79
- public void SetCapability ( DefinitionCapability capability )
80
- {
81
- _capability = capability ;
82
- }
83
-
84
74
private static Range GetRangeFromScriptRegion ( ScriptRegion scriptRegion )
85
75
{
86
76
return new Range
0 commit comments