Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions client/src/common/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -875,9 +875,9 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
}

public sendRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, token?: CancellationToken): Promise<R>;
public sendRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, params: P, token?: CancellationToken): Promise<R>;
public sendRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, params: NoInfer<P>, token?: CancellationToken): Promise<R>;
public sendRequest<R, E>(type: RequestType0<R, E>, token?: CancellationToken): Promise<R>;
public sendRequest<P, R, E>(type: RequestType<P, R, E>, params: P, token?: CancellationToken): Promise<R>;
public sendRequest<P, R, E>(type: RequestType<P, R, E>, params: NoInfer<P>, token?: CancellationToken): Promise<R>;
public sendRequest<R>(method: string, token?: CancellationToken): Promise<R>;
public sendRequest<R>(method: string, param: any, token?: CancellationToken): Promise<R>;
public async sendRequest<R>(type: string | MessageSignature, ...params: any[]): Promise<R> {
Expand Down Expand Up @@ -938,10 +938,10 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
}
}

public onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: RequestHandler0<R, E>): Disposable;
public onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: RequestHandler<P, R, E>): Disposable;
public onRequest<R, E>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): Disposable;
public onRequest<P, R, E>(type: RequestType<P, R, E>, handler: RequestHandler<P, R, E>): Disposable;
public onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: NoInfer<RequestHandler0<R, E>>): Disposable;
public onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: NoInfer<RequestHandler<P, R, E>>): Disposable;
public onRequest<R, E>(type: RequestType0<R, E>, handler: NoInfer<RequestHandler0<R, E>>): Disposable;
public onRequest<P, R, E>(type: RequestType<P, R, E>, handler: NoInfer<RequestHandler<P, R, E>>): Disposable;
public onRequest<R, E>(method: string, handler: GenericRequestHandler<R, E>): Disposable;
public onRequest<R, E>(type: string | MessageSignature, handler: GenericRequestHandler<R, E>): Disposable {
const method = typeof type === 'string' ? type : type.method;
Expand Down Expand Up @@ -981,9 +981,9 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
}

public sendNotification<RO>(type: ProtocolNotificationType0<RO>): Promise<void>;
public sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: P): Promise<void>;
public sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: NoInfer<P>): Promise<void>;
public sendNotification(type: NotificationType0): Promise<void>;
public sendNotification<P>(type: NotificationType<P>, params?: P): Promise<void>;
public sendNotification<P>(type: NotificationType<P>, params?: NoInfer<P>): Promise<void>;
public sendNotification(method: string): Promise<void>;
public sendNotification(method: string, params: any): Promise<void>;
public async sendNotification<P>(type: string | MessageSignature, params?: P): Promise<void> {
Expand Down Expand Up @@ -1038,9 +1038,9 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
}

public onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable;
public onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): Disposable;
public onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NoInfer<NotificationHandler<P>>): Disposable;
public onNotification(type: NotificationType0, handler: NotificationHandler0): Disposable;
public onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable;
public onNotification<P>(type: NotificationType<P>, handler: NoInfer<NotificationHandler<P>>): Disposable;
public onNotification(method: string, handler: GenericNotificationHandler): Disposable;
public onNotification(type: string | MessageSignature, handler: GenericNotificationHandler): Disposable {
const method = typeof type === 'string' ? type : type.method;
Expand Down Expand Up @@ -1079,7 +1079,7 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
};
}

public async sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): Promise<void> {
public async sendProgress<P>(type: ProgressType<P>, token: string | number, value: NoInfer<P>): Promise<void> {
if (this.$state === ClientState.StartFailed || this.$state === ClientState.Stopping || this.$state === ClientState.Stopped) {
return Promise.reject(new ResponseError(ErrorCodes.ConnectionInactive, `Client is not running`));
}
Expand All @@ -1093,7 +1093,7 @@ export abstract class BaseLanguageClient implements FeatureClient<Middleware, La
}
}

public onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable {
public onProgress<P>(type: ProgressType<P>, token: string | number, handler: NoInfer<NotificationHandler<P>>): Disposable {
this._progressHandlers.set(token, { type, handler });
const connection = this.activeConnection();
let disposable: Disposable;
Expand Down Expand Up @@ -2362,33 +2362,33 @@ interface Connection {
listen(): void;

sendRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, token?: CancellationToken): Promise<R>;
sendRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, params: P, token?: CancellationToken): Promise<R>;
sendRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, params: NoInfer<P>, token?: CancellationToken): Promise<R>;
sendRequest<R, E>(type: RequestType0<R, E>, token?: CancellationToken): Promise<R>;
sendRequest<P, R, E>(type: RequestType<P, R, E>, params: P, token?: CancellationToken): Promise<R>;
sendRequest<P, R, E>(type: RequestType<P, R, E>, params: NoInfer<P>, token?: CancellationToken): Promise<R>;
sendRequest<R>(type: string | MessageSignature, ...params: any[]): Promise<R>;

onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: RequestHandler0<R, E>): Disposable;
onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: RequestHandler<P, R, E>): Disposable;
onRequest<R, E>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): Disposable;
onRequest<P, R, E>(type: RequestType<P, R, E>, handler: RequestHandler<P, R, E>): Disposable;
onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: NoInfer<RequestHandler0<R, E>>): Disposable;
onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: NoInfer<RequestHandler<P, R, E>>): Disposable;
onRequest<R, E>(type: RequestType0<R, E>, handler: NoInfer<RequestHandler0<R, E>>): Disposable;
onRequest<P, R, E>(type: RequestType<P, R, E>, handler: NoInfer<RequestHandler<P, R, E>>): Disposable;
onRequest<R, E>(method: string | MessageSignature, handler: GenericRequestHandler<R, E>): Disposable;

hasPendingResponse(): boolean;

sendNotification<RO>(type: ProtocolNotificationType0<RO>): Promise<void>;
sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: P): Promise<void>;
sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: NoInfer<P>): Promise<void>;
sendNotification(type: NotificationType0): Promise<void>;
sendNotification<P>(type: NotificationType<P>, params?: P): Promise<void>;
sendNotification<P>(type: NotificationType<P>, params?: NoInfer<P>): Promise<void>;
sendNotification(method: string | MessageSignature, params?: any): Promise<void>;

onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable;
onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): Disposable;
onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NoInfer<NotificationHandler<P>>): Disposable;
onNotification(type: NotificationType0, handler: NotificationHandler0): Disposable;
onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable;
onNotification<P>(type: NotificationType<P>, handler: NoInfer<NotificationHandler<P>>): Disposable;
onNotification(method: string | MessageSignature, handler: GenericNotificationHandler): Disposable;

onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable;
sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): Promise<void>;
onProgress<P>(type: ProgressType<P>, token: string | number, handler: NoInfer<NotificationHandler<P>>): Disposable;
sendProgress<P>(type: ProgressType<P>, token: string | number, value: NoInfer<P>): Promise<void>;

trace(value: Trace, tracer: Tracer, sendNotification?: boolean): Promise<void>;
trace(value: Trace, tracer: Tracer, traceOptions?: TraceOptions): Promise<void>;
Expand Down
24 changes: 12 additions & 12 deletions client/src/common/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export abstract class TextDocumentEventFeature<P extends { textDocument: TextDoc
}

constructor(client: FeatureClient<M>, event: Event<E>, type: ProtocolNotificationType<P, TextDocumentRegistrationOptions>,
middleware: () => NextSignature<E, Promise<void>> | undefined, createParams: CreateParamsSignature<E, P>,
middleware: () => NextSignature<E, Promise<void>> | undefined, createParams: NoInfer<CreateParamsSignature<E, P>>,
textDocument: (data: E) => TextDocument,
selectorFilter?: (selectors: IterableIterator<VDocumentSelector>, data: E) => boolean
) {
Expand Down Expand Up @@ -678,32 +678,32 @@ export interface FeatureClient<M, CO = object> {
stop(): Promise<void>;

sendRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, token?: CancellationToken): Promise<R>;
sendRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, params: P, token?: CancellationToken): Promise<R>;
sendRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, params: NoInfer<P>, token?: CancellationToken): Promise<R>;
sendRequest<R, E>(type: RequestType0<R, E>, token?: CancellationToken): Promise<R>;
sendRequest<P, R, E>(type: RequestType<P, R, E>, params: P, token?: CancellationToken): Promise<R>;
sendRequest<P, R, E>(type: RequestType<P, R, E>, params: NoInfer<P>, token?: CancellationToken): Promise<R>;
sendRequest<R>(method: string, token?: CancellationToken): Promise<R>;
sendRequest<R>(method: string, param: any, token?: CancellationToken): Promise<R>;

onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: RequestHandler0<R, E>): Disposable;
onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: RequestHandler<P, R, E>): Disposable;
onRequest<R, E>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): Disposable;
onRequest<P, R, E>(type: RequestType<P, R, E>, handler: RequestHandler<P, R, E>): Disposable;
onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: NoInfer<RequestHandler0<R, E>>): Disposable;
onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: NoInfer<RequestHandler<P, R, E>>): Disposable;
onRequest<R, E>(type: RequestType0<R, E>, handler: NoInfer<RequestHandler0<R, E>>): Disposable;
onRequest<P, R, E>(type: RequestType<P, R, E>, handler: NoInfer<RequestHandler<P, R, E>>): Disposable;
onRequest<R, E>(method: string, handler: GenericRequestHandler<R, E>): Disposable;

sendNotification<RO>(type: ProtocolNotificationType0<RO>): Promise<void>;
sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: P): Promise<void>;
sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: NoInfer<P>): Promise<void>;
sendNotification(type: NotificationType0): Promise<void>;
sendNotification<P>(type: NotificationType<P>, params?: P): Promise<void>;
sendNotification<P>(type: NotificationType<P>, params?: NoInfer<P>): Promise<void>;
sendNotification(method: string): Promise<void>;
sendNotification(method: string, params: any): Promise<void>;

onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable;
onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): Disposable;
onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NoInfer<NotificationHandler<P>>): Disposable;
onNotification(type: NotificationType0, handler: NotificationHandler0): Disposable;
onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable;
onNotification<P>(type: NotificationType<P>, handler: NoInfer<NotificationHandler<P>>): Disposable;
onNotification(method: string, handler: GenericNotificationHandler): Disposable;

onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable;
onProgress<P>(type: ProgressType<P>, token: string | number, handler: NoInfer<NotificationHandler<P>>): Disposable;

info(message: string, data?: any, showNotification?: boolean): void;
warn(message: string, data?: any, showNotification?: boolean): void;
Expand Down
4 changes: 2 additions & 2 deletions client/src/common/progressPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
import * as Is from './utils/is';

export interface ProgressContext {
onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable;
sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: P): void;
onProgress<P>(type: ProgressType<P>, token: string | number, handler: NoInfer<NotificationHandler<P>>): Disposable;
sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: NoInfer<P>): void;
}

export class ProgressPart {
Expand Down
Loading