|
6 | 6 |
|
7 | 7 | import * as vscode from 'vscode'; |
8 | 8 | import { |
9 | | - CancellationTokenImpl, |
10 | | - createCancelRequestMessage, |
| 9 | + CancellationToken, CancellationTokenImpl, createCancelRequestMessage, Deferred, |
11 | 10 | equalParticipants, HOST_EXTENSION, isCancelRequestNotification, isMessage, isNotificationMessage, isRequestMessage, isResponseMessage, |
12 | 11 | isWebviewIdMessageParticipant, JsonAny, Message, MessageParticipant, MessengerAPI, NotificationHandler, |
13 | | - NotificationMessage, NotificationType, Deferred, RequestHandler, RequestMessage, RequestType, ResponseError, |
| 12 | + NotificationMessage, NotificationType, |
| 13 | + RequestHandler, RequestMessage, RequestType, ResponseError, |
14 | 14 | ResponseMessage, WebviewIdMessageParticipant |
15 | 15 | } from 'vscode-messenger-common'; |
16 | 16 | import { DiagnosticOptions, MessengerDiagnostic, MessengerEvent } from './diagnostic-api'; |
@@ -316,7 +316,7 @@ export class Messenger implements MessengerAPI { |
316 | 316 | }; |
317 | 317 | } |
318 | 318 |
|
319 | | - async sendRequest<P, R>(type: RequestType<P, R>, receiver: MessageParticipant, params?: P, cancelable?: CancellationTokenImpl): Promise<R> { |
| 319 | + async sendRequest<P, R>(type: RequestType<P, R>, receiver: MessageParticipant, params?: P, cancelable?: CancellationToken): Promise<R> { |
320 | 320 | if (receiver.type === 'extension') { |
321 | 321 | throw new Error('Requests to other extensions are not supported yet.'); |
322 | 322 | } else if (receiver.type === 'broadcast') { |
@@ -345,7 +345,7 @@ export class Messenger implements MessengerAPI { |
345 | 345 | throw new Error(`Invalid receiver: ${JSON.stringify(receiver)}`); |
346 | 346 | } |
347 | 347 |
|
348 | | - protected async sendRequestToWebview<P, R>(type: RequestType<P, R>, receiver: MessageParticipant, params: P, view: ViewContainer, cancelable?: CancellationTokenImpl): Promise<R> { |
| 348 | + protected async sendRequestToWebview<P, R>(type: RequestType<P, R>, receiver: MessageParticipant, params: P, view: ViewContainer, cancelable?: CancellationToken): Promise<R> { |
349 | 349 | // Messages are only delivered if the webview is live (either visible or in the background with `retainContextWhenHidden`). |
350 | 350 | if (!view.visible && this.options.ignoreHiddenViews) { |
351 | 351 | return Promise.reject(new Error(`Skipped request for hidden view: ${participantToString(receiver)}`)); |
|
0 commit comments