@@ -134,8 +134,7 @@ public void Should_Contain_AllDefinedMethods_OnLanguageServer(Type requestHandle
134
134
var sub = ( IJsonRpcHandler ) Substitute . For ( new Type [ ] { requestHandler , type2 } , new object [ 0 ] ) ;
135
135
if ( sub is IRegistration < TextDocumentRegistrationOptions > reg )
136
136
reg . GetRegistrationOptions ( )
137
- . Returns ( new TextDocumentRegistrationOptions ( )
138
- {
137
+ . Returns ( new TextDocumentRegistrationOptions ( ) {
139
138
DocumentSelector = new DocumentSelector ( )
140
139
} ) ;
141
140
handler . Add ( sub ) ;
@@ -152,15 +151,13 @@ public void Should_Contain_AllDefinedMethods_OnLanguageServer_WithDifferentKeys(
152
151
var sub = ( IJsonRpcHandler ) Substitute . For ( new Type [ ] { requestHandler , type2 } , new object [ 0 ] ) ;
153
152
if ( sub is IRegistration < TextDocumentRegistrationOptions > reg )
154
153
reg . GetRegistrationOptions ( )
155
- . Returns ( new TextDocumentRegistrationOptions ( )
156
- {
157
- DocumentSelector = new DocumentSelector ( )
154
+ . Returns ( new TextDocumentRegistrationOptions ( ) {
155
+ DocumentSelector = new DocumentSelector ( ) { }
158
156
} ) ;
159
157
var sub2 = ( IJsonRpcHandler ) Substitute . For ( new Type [ ] { requestHandler , type2 } , new object [ 0 ] ) ;
160
158
if ( sub2 is IRegistration < TextDocumentRegistrationOptions > reg2 )
161
159
reg2 . GetRegistrationOptions ( )
162
- . Returns ( new TextDocumentRegistrationOptions ( )
163
- {
160
+ . Returns ( new TextDocumentRegistrationOptions ( ) {
164
161
DocumentSelector = new DocumentSelector ( )
165
162
} ) ;
166
163
handler . Add ( sub ) ;
@@ -197,10 +194,29 @@ public void Should_DealWithClassesThatImplementMultipleHandlers_WithoutConflicti
197
194
198
195
public static IEnumerable < object [ ] > Should_DealWithClassesThatImplementMultipleHandlers_WithoutConflictingRegistrations_Data ( )
199
196
{
200
- yield return new object [ ] {
201
- DocumentNames . CodeLensResolve ,
202
- Substitute . For ( new Type [ ] { typeof ( ICodeLensHandler ) , typeof ( ICodeLensResolveHandler ) } , new object [ 0 ] )
203
- } ;
197
+ var codeLensHandler = Substitute . For ( new Type [ ] { typeof ( ICodeLensHandler ) , typeof ( ICodeLensResolveHandler ) } , new object [ 0 ] ) ;
198
+ ( ( ICodeLensHandler ) codeLensHandler ) . GetRegistrationOptions ( )
199
+ . Returns ( new CodeLensRegistrationOptions ( ) {
200
+ DocumentSelector = new DocumentSelector ( ) { }
201
+ } ) ;
202
+
203
+ yield return new object [ ] { DocumentNames . CodeLensResolve , codeLensHandler } ;
204
+
205
+ var documentLinkHandler = Substitute . For ( new Type [ ] { typeof ( IDocumentLinkHandler ) , typeof ( IDocumentLinkResolveHandler ) } , new object [ 0 ] ) ;
206
+ ( ( IDocumentLinkHandler ) documentLinkHandler ) . GetRegistrationOptions ( )
207
+ . Returns ( new DocumentLinkRegistrationOptions ( ) {
208
+ DocumentSelector = new DocumentSelector ( ) { }
209
+ } ) ;
210
+
211
+ yield return new object [ ] { DocumentNames . DocumentLinkResolve , documentLinkHandler } ;
212
+
213
+ var completionHandler = Substitute . For ( new Type [ ] { typeof ( ICompletionHandler ) , typeof ( ICompletionResolveHandler ) } , new object [ 0 ] ) ;
214
+ ( ( ICompletionHandler ) completionHandler ) . GetRegistrationOptions ( )
215
+ . Returns ( new CompletionRegistrationOptions ( ) {
216
+ DocumentSelector = new DocumentSelector ( ) { }
217
+ } ) ;
218
+
219
+ yield return new object [ ] { DocumentNames . CompletionResolve , completionHandler } ;
204
220
}
205
221
}
206
222
}
0 commit comments