@@ -35,7 +35,7 @@ import {
3535 TypeHierarchyPrepareRequest , InlineValueRequest , InlayHintRequest , WorkspaceSymbolRequest , TextDocumentRegistrationOptions , FileOperationRegistrationOptions ,
3636 ConnectionOptions , PositionEncodingKind , DocumentDiagnosticRequest , NotebookDocumentSyncRegistrationType , NotebookDocumentSyncRegistrationOptions , ErrorCodes ,
3737 MessageStrategy , DidOpenTextDocumentParams , CodeLensResolveRequest , CompletionResolveRequest , CodeActionResolveRequest , InlayHintResolveRequest , DocumentLinkResolveRequest , WorkspaceSymbolResolveRequest ,
38- CancellationToken as ProtocolCancellationToken , InlineCompletionRequest , InlineCompletionRegistrationOptions , ExecuteCommandRequest , ExecuteCommandOptions , HandlerResult ,
38+ CancellationToken as ProtocolCancellationToken , InlineCompletionRequest , InlineCompletionRegistrationOptions , ExecuteCommandRequest , ExecuteCommandOptions , RequestParam , HandlerResult ,
3939 type DidCloseTextDocumentParams , type TextDocumentContentRequest
4040} from 'vscode-languageserver-protocol' ;
4141
@@ -875,9 +875,9 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
875875 }
876876
877877 public sendRequest < R , PR , E , RO > ( type : ProtocolRequestType0 < R , PR , E , RO > , token ?: CancellationToken ) : Promise < R > ;
878- public sendRequest < P , R , PR , E , RO > ( type : ProtocolRequestType < P , R , PR , E , RO > , params : P , token ?: CancellationToken ) : Promise < R > ;
878+ public sendRequest < P , R , PR , E , RO > ( type : ProtocolRequestType < P , R , PR , E , RO > , params : NoInfer < RequestParam < P > > , token ?: CancellationToken ) : Promise < R > ;
879879 public sendRequest < R , E > ( type : RequestType0 < R , E > , token ?: CancellationToken ) : Promise < R > ;
880- public sendRequest < P , R , E > ( type : RequestType < P , R , E > , params : P , token ?: CancellationToken ) : Promise < R > ;
880+ public sendRequest < P , R , E > ( type : RequestType < P , R , E > , params : NoInfer < RequestParam < P > > , token ?: CancellationToken ) : Promise < R > ;
881881 public sendRequest < R > ( method : string , token ?: CancellationToken ) : Promise < R > ;
882882 public sendRequest < R > ( method : string , param : any , token ?: CancellationToken ) : Promise < R > ;
883883 public async sendRequest < R > ( type : string | MessageSignature , ...params : any [ ] ) : Promise < R > {
@@ -938,10 +938,10 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
938938 }
939939 }
940940
941- public onRequest < R , PR , E , RO > ( type : ProtocolRequestType0 < R , PR , E , RO > , handler : RequestHandler0 < R , E > ) : Disposable ;
942- public onRequest < P , R , PR , E , RO > ( type : ProtocolRequestType < P , R , PR , E , RO > , handler : RequestHandler < P , R , E > ) : Disposable ;
943- public onRequest < R , E > ( type : RequestType0 < R , E > , handler : RequestHandler0 < R , E > ) : Disposable ;
944- public onRequest < P , R , E > ( type : RequestType < P , R , E > , handler : RequestHandler < P , R , E > ) : Disposable ;
941+ public onRequest < R , PR , E , RO > ( type : ProtocolRequestType0 < R , PR , E , RO > , handler : NoInfer < RequestHandler0 < R , E > > ) : Disposable ;
942+ public onRequest < P , R , PR , E , RO > ( type : ProtocolRequestType < P , R , PR , E , RO > , handler : NoInfer < RequestHandler < P , R , E > > ) : Disposable ;
943+ public onRequest < R , E > ( type : RequestType0 < R , E > , handler : NoInfer < RequestHandler0 < R , E > > ) : Disposable ;
944+ public onRequest < P , R , E > ( type : RequestType < P , R , E > , handler : NoInfer < RequestHandler < P , R , E > > ) : Disposable ;
945945 public onRequest < R , E > ( method : string , handler : GenericRequestHandler < R , E > ) : Disposable ;
946946 public onRequest < R , E > ( type : string | MessageSignature , handler : GenericRequestHandler < R , E > ) : Disposable {
947947 const method = typeof type === 'string' ? type : type . method ;
@@ -981,9 +981,9 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
981981 }
982982
983983 public sendNotification < RO > ( type : ProtocolNotificationType0 < RO > ) : Promise < void > ;
984- public sendNotification < P , RO > ( type : ProtocolNotificationType < P , RO > , params ?: P ) : Promise < void > ;
984+ public sendNotification < P , RO > ( type : ProtocolNotificationType < P , RO > , params ?: NoInfer < RequestParam < P > > ) : Promise < void > ;
985985 public sendNotification ( type : NotificationType0 ) : Promise < void > ;
986- public sendNotification < P > ( type : NotificationType < P > , params ?: P ) : Promise < void > ;
986+ public sendNotification < P > ( type : NotificationType < P > , params ?: NoInfer < RequestParam < P > > ) : Promise < void > ;
987987 public sendNotification ( method : string ) : Promise < void > ;
988988 public sendNotification ( method : string , params : any ) : Promise < void > ;
989989 public async sendNotification < P > ( type : string | MessageSignature , params ?: P ) : Promise < void > {
@@ -1038,9 +1038,9 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
10381038 }
10391039
10401040 public onNotification < RO > ( type : ProtocolNotificationType0 < RO > , handler : NotificationHandler0 ) : Disposable ;
1041- public onNotification < P , RO > ( type : ProtocolNotificationType < P , RO > , handler : NotificationHandler < P > ) : Disposable ;
1041+ public onNotification < P , RO > ( type : ProtocolNotificationType < P , RO > , handler : NoInfer < NotificationHandler < P > > ) : Disposable ;
10421042 public onNotification ( type : NotificationType0 , handler : NotificationHandler0 ) : Disposable ;
1043- public onNotification < P > ( type : NotificationType < P > , handler : NotificationHandler < P > ) : Disposable ;
1043+ public onNotification < P > ( type : NotificationType < P > , handler : NoInfer < NotificationHandler < P > > ) : Disposable ;
10441044 public onNotification ( method : string , handler : GenericNotificationHandler ) : Disposable ;
10451045 public onNotification ( type : string | MessageSignature , handler : GenericNotificationHandler ) : Disposable {
10461046 const method = typeof type === 'string' ? type : type . method ;
@@ -1079,7 +1079,7 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
10791079 } ;
10801080 }
10811081
1082- public async sendProgress < P > ( type : ProgressType < P > , token : string | number , value : P ) : Promise < void > {
1082+ public async sendProgress < P > ( type : ProgressType < P > , token : string | number , value : NoInfer < RequestParam < P > > ) : Promise < void > {
10831083 if ( this . $state === ClientState . StartFailed || this . $state === ClientState . Stopping || this . $state === ClientState . Stopped ) {
10841084 return Promise . reject ( new ResponseError ( ErrorCodes . ConnectionInactive , `Client is not running` ) ) ;
10851085 }
@@ -1093,7 +1093,7 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
10931093 }
10941094 }
10951095
1096- public onProgress < P > ( type : ProgressType < P > , token : string | number , handler : NotificationHandler < P > ) : Disposable {
1096+ public onProgress < P > ( type : ProgressType < P > , token : string | number , handler : NoInfer < NotificationHandler < P > > ) : Disposable {
10971097 this . _progressHandlers . set ( token , { type, handler } ) ;
10981098 const connection = this . activeConnection ( ) ;
10991099 let disposable : Disposable ;
@@ -2377,33 +2377,33 @@ interface Connection {
23772377 listen ( ) : void ;
23782378
23792379 sendRequest < R , PR , E , RO > ( type : ProtocolRequestType0 < R , PR , E , RO > , token ?: CancellationToken ) : Promise < R > ;
2380- sendRequest < P , R , PR , E , RO > ( type : ProtocolRequestType < P , R , PR , E , RO > , params : P , token ?: CancellationToken ) : Promise < R > ;
2380+ sendRequest < P , R , PR , E , RO > ( type : ProtocolRequestType < P , R , PR , E , RO > , params : NoInfer < RequestParam < P > > , token ?: CancellationToken ) : Promise < R > ;
23812381 sendRequest < R , E > ( type : RequestType0 < R , E > , token ?: CancellationToken ) : Promise < R > ;
2382- sendRequest < P , R , E > ( type : RequestType < P , R , E > , params : P , token ?: CancellationToken ) : Promise < R > ;
2382+ sendRequest < P , R , E > ( type : RequestType < P , R , E > , params : NoInfer < RequestParam < P > > , token ?: CancellationToken ) : Promise < R > ;
23832383 sendRequest < R > ( type : string | MessageSignature , ...params : any [ ] ) : Promise < R > ;
23842384
2385- onRequest < R , PR , E , RO > ( type : ProtocolRequestType0 < R , PR , E , RO > , handler : RequestHandler0 < R , E > ) : Disposable ;
2386- onRequest < P , R , PR , E , RO > ( type : ProtocolRequestType < P , R , PR , E , RO > , handler : RequestHandler < P , R , E > ) : Disposable ;
2387- onRequest < R , E > ( type : RequestType0 < R , E > , handler : RequestHandler0 < R , E > ) : Disposable ;
2388- onRequest < P , R , E > ( type : RequestType < P , R , E > , handler : RequestHandler < P , R , E > ) : Disposable ;
2385+ onRequest < R , PR , E , RO > ( type : ProtocolRequestType0 < R , PR , E , RO > , handler : NoInfer < RequestHandler0 < R , E > > ) : Disposable ;
2386+ onRequest < P , R , PR , E , RO > ( type : ProtocolRequestType < P , R , PR , E , RO > , handler : NoInfer < RequestHandler < P , R , E > > ) : Disposable ;
2387+ onRequest < R , E > ( type : RequestType0 < R , E > , handler : NoInfer < RequestHandler0 < R , E > > ) : Disposable ;
2388+ onRequest < P , R , E > ( type : RequestType < P , R , E > , handler : NoInfer < RequestHandler < P , R , E > > ) : Disposable ;
23892389 onRequest < R , E > ( method : string | MessageSignature , handler : GenericRequestHandler < R , E > ) : Disposable ;
23902390
23912391 hasPendingResponse ( ) : boolean ;
23922392
23932393 sendNotification < RO > ( type : ProtocolNotificationType0 < RO > ) : Promise < void > ;
2394- sendNotification < P , RO > ( type : ProtocolNotificationType < P , RO > , params ?: P ) : Promise < void > ;
2394+ sendNotification < P , RO > ( type : ProtocolNotificationType < P , RO > , params ?: NoInfer < RequestParam < P > > ) : Promise < void > ;
23952395 sendNotification ( type : NotificationType0 ) : Promise < void > ;
2396- sendNotification < P > ( type : NotificationType < P > , params ?: P ) : Promise < void > ;
2396+ sendNotification < P > ( type : NotificationType < P > , params ?: NoInfer < RequestParam < P > > ) : Promise < void > ;
23972397 sendNotification ( method : string | MessageSignature , params ?: any ) : Promise < void > ;
23982398
23992399 onNotification < RO > ( type : ProtocolNotificationType0 < RO > , handler : NotificationHandler0 ) : Disposable ;
2400- onNotification < P , RO > ( type : ProtocolNotificationType < P , RO > , handler : NotificationHandler < P > ) : Disposable ;
2400+ onNotification < P , RO > ( type : ProtocolNotificationType < P , RO > , handler : NoInfer < NotificationHandler < P > > ) : Disposable ;
24012401 onNotification ( type : NotificationType0 , handler : NotificationHandler0 ) : Disposable ;
2402- onNotification < P > ( type : NotificationType < P > , handler : NotificationHandler < P > ) : Disposable ;
2402+ onNotification < P > ( type : NotificationType < P > , handler : NoInfer < NotificationHandler < P > > ) : Disposable ;
24032403 onNotification ( method : string | MessageSignature , handler : GenericNotificationHandler ) : Disposable ;
24042404
2405- onProgress < P > ( type : ProgressType < P > , token : string | number , handler : NotificationHandler < P > ) : Disposable ;
2406- sendProgress < P > ( type : ProgressType < P > , token : string | number , value : P ) : Promise < void > ;
2405+ onProgress < P > ( type : ProgressType < P > , token : string | number , handler : NoInfer < NotificationHandler < P > > ) : Disposable ;
2406+ sendProgress < P > ( type : ProgressType < P > , token : string | number , value : NoInfer < RequestParam < P > > ) : Promise < void > ;
24072407
24082408 trace ( value : Trace , tracer : Tracer , sendNotification ?: boolean ) : Promise < void > ;
24092409 trace ( value : Trace , tracer : Tracer , traceOptions ?: TraceOptions ) : Promise < void > ;
0 commit comments