@@ -140,10 +140,16 @@ suite ('Client Features', () => {
140140
141141 test ( 'Document Selector - Client and server' , ( ) => {
142142 const client = createClient ( documentSelector ) ;
143+ const capabilitySelector = { documentSelector : [ { scheme : 'file' , language : 'test' } ] } as any ;
144+
145+ client . info = ( message , data ) => {
146+ assert . strictEqual ( message , `Overriding client document selector for ${ lsclient . FoldingRangeRequest . method } ` ) ;
147+ assert . deepStrictEqual ( data , capabilitySelector ) ;
148+ } ;
143149
144150 const feature = client . getFeature ( lsclient . FoldingRangeRequest . method ) as unknown as FoldingRangeTestFeature ;
145151 {
146- const [ , options ] = feature . getRegistration ( documentSelector , { documentSelector : [ { scheme : 'file' , language : 'test' } ] } ) ;
152+ const [ , options ] = feature . getRegistration ( documentSelector , capabilitySelector ) ;
147153 isDefined ( options ) ;
148154 const filter = options . documentSelector [ 0 ] as lsclient . TextDocumentFilter ;
149155 assert . strictEqual ( filter . scheme , 'file' ) ;
@@ -153,7 +159,7 @@ suite ('Client Features', () => {
153159 {
154160 // Note that the old registration spec has no support for providing a document selector.
155161 // So ensure that even if we pass one in we will not honor it.
156- const options = feature . getRegistrationOptions ( documentSelector , { documentSelector : [ { scheme : 'file' , language : 'test' } ] } as any ) ;
162+ const options = feature . getRegistrationOptions ( documentSelector , capabilitySelector ) ;
157163 isDefined ( options ) ;
158164 const filter = options . documentSelector [ 0 ] as lsclient . TextDocumentFilter ;
159165 assert . strictEqual ( filter . scheme , 'lsptests' ) ;
0 commit comments