Skip to content

Commit 52740ac

Browse files
committed
Removed CancellationTokenImpl usage
1 parent 377c16c commit 52740ac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/vscode-messenger/src/messenger.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
import * as vscode from 'vscode';
88
import {
9-
CancellationTokenImpl,
10-
createCancelRequestMessage,
9+
CancellationToken, CancellationTokenImpl, createCancelRequestMessage, Deferred,
1110
equalParticipants, HOST_EXTENSION, isCancelRequestNotification, isMessage, isNotificationMessage, isRequestMessage, isResponseMessage,
1211
isWebviewIdMessageParticipant, JsonAny, Message, MessageParticipant, MessengerAPI, NotificationHandler,
13-
NotificationMessage, NotificationType, Deferred, RequestHandler, RequestMessage, RequestType, ResponseError,
12+
NotificationMessage, NotificationType,
13+
RequestHandler, RequestMessage, RequestType, ResponseError,
1414
ResponseMessage, WebviewIdMessageParticipant
1515
} from 'vscode-messenger-common';
1616
import { DiagnosticOptions, MessengerDiagnostic, MessengerEvent } from './diagnostic-api';
@@ -316,7 +316,7 @@ export class Messenger implements MessengerAPI {
316316
};
317317
}
318318

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> {
320320
if (receiver.type === 'extension') {
321321
throw new Error('Requests to other extensions are not supported yet.');
322322
} else if (receiver.type === 'broadcast') {
@@ -345,7 +345,7 @@ export class Messenger implements MessengerAPI {
345345
throw new Error(`Invalid receiver: ${JSON.stringify(receiver)}`);
346346
}
347347

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> {
349349
// Messages are only delivered if the webview is live (either visible or in the background with `retainContextWhenHidden`).
350350
if (!view.visible && this.options.ignoreHiddenViews) {
351351
return Promise.reject(new Error(`Skipped request for hidden view: ${participantToString(receiver)}`));

0 commit comments

Comments
 (0)