@@ -25,7 +25,7 @@ public IEnumerable<ILspHandlerDescriptor> FindHandler(object parameters, IEnumer
25
25
{
26
26
case ITextDocumentIdentifierParams textDocumentIdentifierParams :
27
27
{
28
- var attributes = GetTextDocumentAttributes ( descriptors , textDocumentIdentifierParams . TextDocument . Uri ) ;
28
+ var attributes = GetTextDocumentAttributes ( textDocumentIdentifierParams . TextDocument . Uri ) ;
29
29
30
30
_logger . LogTrace ( "Found attributes {Count}, {Attributes}" , attributes . Count , attributes . Select ( x => $ "{ x . LanguageId } :{ x . Scheme } :{ x . Uri } ") ) ;
31
31
@@ -42,7 +42,7 @@ public IEnumerable<ILspHandlerDescriptor> FindHandler(object parameters, IEnumer
42
42
case DidChangeTextDocumentParams didChangeDocumentParams :
43
43
{
44
44
// TODO: Do something with document version here?
45
- var attributes = GetTextDocumentAttributes ( descriptors , didChangeDocumentParams . TextDocument . Uri ) ;
45
+ var attributes = GetTextDocumentAttributes ( didChangeDocumentParams . TextDocument . Uri ) ;
46
46
47
47
_logger . LogTrace ( "Found attributes {Count}, {Attributes}" , attributes . Count , attributes . Select ( x => $ "{ x . LanguageId } :{ x . Scheme } :{ x . Uri } ") ) ;
48
48
@@ -53,7 +53,7 @@ public IEnumerable<ILspHandlerDescriptor> FindHandler(object parameters, IEnumer
53
53
return Enumerable . Empty < ILspHandlerDescriptor > ( ) ;
54
54
}
55
55
56
- private List < TextDocumentAttributes > GetTextDocumentAttributes ( IEnumerable < ILspHandlerDescriptor > method , Uri uri )
56
+ private List < TextDocumentAttributes > GetTextDocumentAttributes ( Uri uri )
57
57
{
58
58
return _getSyncHandlers ( )
59
59
. Select ( x => x . GetTextDocumentAttributes ( uri ) )
@@ -62,16 +62,17 @@ private List<TextDocumentAttributes> GetTextDocumentAttributes(IEnumerable<ILspH
62
62
. ToList ( ) ;
63
63
}
64
64
65
- private IEnumerable < ILspHandlerDescriptor > GetHandler ( IEnumerable < ILspHandlerDescriptor > method , IEnumerable < TextDocumentAttributes > attributes )
65
+ private IEnumerable < ILspHandlerDescriptor > GetHandler ( IEnumerable < ILspHandlerDescriptor > descriptors , IEnumerable < TextDocumentAttributes > attributes )
66
66
{
67
67
return attributes
68
- . SelectMany ( x => GetHandler ( method , x ) ) ;
68
+ . SelectMany ( x => GetHandler ( descriptors , x ) ) ;
69
69
}
70
70
71
- private IEnumerable < ILspHandlerDescriptor > GetHandler ( IEnumerable < ILspHandlerDescriptor > method , TextDocumentAttributes attributes )
71
+ private IEnumerable < ILspHandlerDescriptor > GetHandler ( IEnumerable < ILspHandlerDescriptor > descriptors , TextDocumentAttributes attributes )
72
72
{
73
- _logger . LogTrace ( "Looking for handler for method {Method}" , method ) ;
74
- foreach ( var handler in method )
73
+ var method = descriptors . FirstOrDefault ( ) ? . Method ;
74
+ _logger . LogTrace ( "Looking for handler for descriptors {Method}" , method ) ;
75
+ foreach ( var handler in descriptors )
75
76
{
76
77
_logger . LogTrace ( "Checking handler {Method}:{Handler}" , method , handler . Handler . GetType ( ) . FullName ) ;
77
78
var registrationOptions = handler . Registration . RegisterOptions as ITextDocumentRegistrationOptions ;
0 commit comments