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,17 @@ 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 < Params extends PartialResultParams , Response , PartialResult , Error , RegistrationOptions > (
26+ type : ProtocolRequestType < Params , Response , PartialResult , Error , RegistrationOptions > ,
27+ params : Params ,
28+ onProgress : ( p : PartialResult ) => Promise < any > ,
29+ token ?: vscode . CancellationToken
30+ ) : Promise < Response > {
31+ const server = await this . _serverInitialized ;
32+ // We need to recreate the type parameter to ensure that the prototypes line up. The `ProtocolRequestType` we receive could have been
33+ // from a different version.
34+ const newType = new ProtocolRequestType < Params , Response , PartialResult , Error , RegistrationOptions > ( type . method ) ;
35+ return await server . sendRequestWithProgress ( newType , params , onProgress , token ) ;
36+ }
2337}
0 commit comments