18
18
19
19
namespace Microsoft . PowerShell . EditorServices . Handlers
20
20
{
21
- class PsesReferencesHandler : IReferencesHandler
21
+ class PsesReferencesHandler : ReferencesHandlerBase
22
22
{
23
23
private readonly ILogger _logger ;
24
24
private readonly SymbolsService _symbolsService ;
25
25
private readonly WorkspaceService _workspaceService ;
26
- private ReferenceCapability _capability ;
27
26
28
27
public PsesReferencesHandler ( ILoggerFactory factory , SymbolsService symbolsService , WorkspaceService workspaceService )
29
28
{
@@ -32,15 +31,12 @@ public PsesReferencesHandler(ILoggerFactory factory, SymbolsService symbolsServi
32
31
_workspaceService = workspaceService ;
33
32
}
34
33
35
- public ReferenceRegistrationOptions GetRegistrationOptions ( )
34
+ protected override ReferenceRegistrationOptions CreateRegistrationOptions ( ReferenceCapability capability , ClientCapabilities clientCapabilities ) => new ReferenceRegistrationOptions
36
35
{
37
- return new ReferenceRegistrationOptions
38
- {
39
- DocumentSelector = LspUtils . PowerShellDocumentSelector
40
- } ;
41
- }
36
+ DocumentSelector = LspUtils . PowerShellDocumentSelector
37
+ } ;
42
38
43
- public Task < LocationContainer > Handle ( ReferenceParams request , CancellationToken cancellationToken )
39
+ public override Task < LocationContainer > Handle ( ReferenceParams request , CancellationToken cancellationToken )
44
40
{
45
41
ScriptFile scriptFile = _workspaceService . GetFile ( request . TextDocument . Uri ) ;
46
42
@@ -73,11 +69,6 @@ public Task<LocationContainer> Handle(ReferenceParams request, CancellationToken
73
69
return Task . FromResult ( new LocationContainer ( locations ) ) ;
74
70
}
75
71
76
- public void SetCapability ( ReferenceCapability capability )
77
- {
78
- _capability = capability ;
79
- }
80
-
81
72
private static Range GetRangeFromScriptRegion ( ScriptRegion scriptRegion )
82
73
{
83
74
return new Range
0 commit comments