55import * as vscode from 'vscode' ;
66import { RequestType } from 'vscode-jsonrpc' ;
77import { RoslynLanguageServer } from '../server/roslynLanguageServer' ;
8+ import { PartialResultParams , ProtocolRequestType } from 'vscode-languageserver-protocol' ;
89
910export class RoslynLanguageServerExport {
1011 constructor ( private _serverInitialized : Promise < RoslynLanguageServer > ) { }
@@ -20,4 +21,25 @@ export class RoslynLanguageServerExport {
2021 const newType = new RequestType < Params , Response , Error > ( type . method ) ;
2122 return await server . sendRequest ( newType , params , token ) ;
2223 }
24+
25+ public async sendRequestWithProgress <
26+ Params extends PartialResultParams ,
27+ Response ,
28+ PartialResult ,
29+ Error ,
30+ RegistrationOptions
31+ > (
32+ type : ProtocolRequestType < Params , Response , PartialResult , Error , RegistrationOptions > ,
33+ params : Params ,
34+ onProgress : ( p : PartialResult ) => Promise < any > ,
35+ token ?: vscode . CancellationToken
36+ ) : Promise < Response > {
37+ const server = await this . _serverInitialized ;
38+ // We need to recreate the type parameter to ensure that the prototypes line up. The `ProtocolRequestType` we receive could have been
39+ // from a different version.
40+ const newType = new ProtocolRequestType < Params , Response , PartialResult , Error , RegistrationOptions > (
41+ type . method
42+ ) ;
43+ return await server . sendRequestWithProgress ( newType , params , onProgress , token ) ;
44+ }
2345}
0 commit comments