@@ -11,11 +11,12 @@ class HandlerDescriptor : ILspHandlerDescriptor, IDisposable
1111 {
1212 private readonly Action _disposeAction ;
1313
14- public HandlerDescriptor ( string method , IJsonRpcHandler handler , Type handlerType , Type @params , Type registrationType , Type capabilityType , Action disposeAction )
14+ public HandlerDescriptor ( string method , string key , IJsonRpcHandler handler , Type handlerType , Type @params , Type registrationType , Type capabilityType , Action disposeAction )
1515 {
1616 _disposeAction = disposeAction ;
1717 Handler = handler ;
1818 Method = method ;
19+ Key = key ;
1920 HandlerType = handlerType ;
2021 Params = @params ;
2122 RegistrationType = registrationType ;
@@ -70,6 +71,7 @@ public void SetCapability(object instance)
7071 }
7172
7273 public string Method { get ; }
74+ public string Key { get ; }
7375 public Type Params { get ; }
7476
7577 public bool IsDynamicCapability => typeof ( DynamicCapability ) . GetTypeInfo ( ) . IsAssignableFrom ( CapabilityType ) ;
@@ -94,15 +96,14 @@ public override bool Equals(object obj)
9496 {
9597 if ( obj is HandlerDescriptor handler )
9698 {
97- return handler . HandlerType == HandlerType && handler . Handler . Key == Handler . Key ;
99+ return handler . HandlerType == HandlerType && handler . Key == Key ;
98100 }
99101 return false ;
100102 }
101103
102104 public override int GetHashCode ( )
103105 {
104- if ( string . IsNullOrWhiteSpace ( Handler . Key ) ) return HandlerType . GetHashCode ( ) ;
105- return Tuple . Create ( HandlerType , Handler . Key ) . GetHashCode ( ) ;
106+ return Tuple . Create ( HandlerType , Key ) . GetHashCode ( ) ;
106107 }
107108 }
108109}
0 commit comments