Skip to content

Commit 6c56cc0

Browse files
fixed failing unit tests
1 parent 05be685 commit 6c56cc0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Shared/SharedHandlerCollection.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,7 @@ private LspHandlerDescriptor GetDescriptor(string method, Type handlerType, IJso
193193
}
194194

195195
var key = "default";
196-
if (handler is ICanBeIdentifiedHandler identifiedHandler)
197-
{
198-
key = identifiedHandler.Id.ToString("N");
199-
}
200-
else if (handler is IRegistration<TextDocumentRegistrationOptions> handlerRegistration)
196+
if (handler is IRegistration<TextDocumentRegistrationOptions> handlerRegistration)
201197
{
202198
// Ensure we only do this check for the specific registartion type that was found
203199
if (typeof(TextDocumentRegistrationOptions).GetTypeInfo().IsAssignableFrom(registrationType))
@@ -215,6 +211,11 @@ private LspHandlerDescriptor GetDescriptor(string method, Type handlerType, IJso
215211

216212
if (string.IsNullOrWhiteSpace(key)) key = "default";
217213

214+
if (handler is ICanBeIdentifiedHandler identifiedHandler && identifiedHandler.Id != Guid.Empty)
215+
{
216+
key += ":" + identifiedHandler.Id.ToString("N");
217+
}
218+
218219
var requestProcessType =
219220
options?.RequestProcessType ??
220221
typeDescriptor?.RequestProcessType ??

0 commit comments

Comments
 (0)