vscode-jsonrpc
Advanced tools
Comparing version 7.0.0-next.1 to 8.0.0-next.1
@@ -51,2 +51,4 @@ "use strict"; | ||
this._onData.fire(new Uint8Array(buffer)); | ||
}, () => { | ||
ral_1.default().console.error(`Converting blob to array buffer failed.`); | ||
}); | ||
@@ -53,0 +55,0 @@ }; |
@@ -185,3 +185,3 @@ import { Message, RequestType, RequestType0, RequestType1, RequestType2, RequestType3, RequestType4, RequestType5, RequestType6, RequestType7, RequestType8, RequestType9, ResponseMessage, ResponseError, NotificationMessage, NotificationType, NotificationType0, NotificationType1, NotificationType2, NotificationType3, NotificationType4, NotificationType5, NotificationType6, NotificationType7, NotificationType8, NotificationType9, _EM, ParameterStructures } from './messages'; | ||
export interface CancellationSenderStrategy { | ||
sendCancellation(conn: MessageConnection, id: CancellationId): void; | ||
sendCancellation(conn: MessageConnection, id: CancellationId): Promise<void>; | ||
cleanup(id: CancellationId): void; | ||
@@ -235,14 +235,14 @@ dispose?(): void; | ||
onRequest(handler: StarRequestHandler): Disposable; | ||
sendNotification(type: NotificationType0): void; | ||
sendNotification<P>(type: NotificationType<P>, params?: P): void; | ||
sendNotification<P1>(type: NotificationType1<P1>, p1: P1): void; | ||
sendNotification<P1, P2>(type: NotificationType2<P1, P2>, p1: P1, p2: P2): void; | ||
sendNotification<P1, P2, P3>(type: NotificationType3<P1, P2, P3>, p1: P1, p2: P2, p3: P3): void; | ||
sendNotification<P1, P2, P3, P4>(type: NotificationType4<P1, P2, P3, P4>, p1: P1, p2: P2, p3: P3, p4: P4): void; | ||
sendNotification<P1, P2, P3, P4, P5>(type: NotificationType5<P1, P2, P3, P4, P5>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): void; | ||
sendNotification<P1, P2, P3, P4, P5, P6>(type: NotificationType6<P1, P2, P3, P4, P5, P6>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): void; | ||
sendNotification<P1, P2, P3, P4, P5, P6, P7>(type: NotificationType7<P1, P2, P3, P4, P5, P6, P7>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): void; | ||
sendNotification<P1, P2, P3, P4, P5, P6, P7, P8>(type: NotificationType8<P1, P2, P3, P4, P5, P6, P7, P8>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): void; | ||
sendNotification<P1, P2, P3, P4, P5, P6, P7, P8, P9>(type: NotificationType9<P1, P2, P3, P4, P5, P6, P7, P8, P9>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): void; | ||
sendNotification(method: string, r0?: ParameterStructures | any, ...rest: any[]): void; | ||
sendNotification(type: NotificationType0): Promise<void>; | ||
sendNotification<P>(type: NotificationType<P>, params?: P): Promise<void>; | ||
sendNotification<P1>(type: NotificationType1<P1>, p1: P1): Promise<void>; | ||
sendNotification<P1, P2>(type: NotificationType2<P1, P2>, p1: P1, p2: P2): Promise<void>; | ||
sendNotification<P1, P2, P3>(type: NotificationType3<P1, P2, P3>, p1: P1, p2: P2, p3: P3): Promise<void>; | ||
sendNotification<P1, P2, P3, P4>(type: NotificationType4<P1, P2, P3, P4>, p1: P1, p2: P2, p3: P3, p4: P4): Promise<void>; | ||
sendNotification<P1, P2, P3, P4, P5>(type: NotificationType5<P1, P2, P3, P4, P5>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): Promise<void>; | ||
sendNotification<P1, P2, P3, P4, P5, P6>(type: NotificationType6<P1, P2, P3, P4, P5, P6>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): Promise<void>; | ||
sendNotification<P1, P2, P3, P4, P5, P6, P7>(type: NotificationType7<P1, P2, P3, P4, P5, P6, P7>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): Promise<void>; | ||
sendNotification<P1, P2, P3, P4, P5, P6, P7, P8>(type: NotificationType8<P1, P2, P3, P4, P5, P6, P7, P8>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): Promise<void>; | ||
sendNotification<P1, P2, P3, P4, P5, P6, P7, P8, P9>(type: NotificationType9<P1, P2, P3, P4, P5, P6, P7, P8, P9>, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): Promise<void>; | ||
sendNotification(method: string, r0?: ParameterStructures | any, ...rest: any[]): Promise<void>; | ||
onNotification(type: NotificationType0, handler: NotificationHandler0): Disposable; | ||
@@ -249,0 +249,0 @@ onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable; |
@@ -154,3 +154,3 @@ "use strict"; | ||
sendCancellation(conn, id) { | ||
conn.sendNotification(CancelNotification.type, { id }); | ||
return conn.sendNotification(CancelNotification.type, { id }); | ||
}, | ||
@@ -322,3 +322,3 @@ cleanup(_) { } | ||
traceSendingResponse(response, message.method, Date.now()); | ||
messageWriter.write(response); | ||
messageWriter.write(response).catch(() => logger.error(`Sending response for canceled message failed.`)); | ||
return; | ||
@@ -365,3 +365,3 @@ } | ||
traceSendingResponse(message, method, startTime); | ||
messageWriter.write(message); | ||
messageWriter.write(message).catch(() => logger.error(`Sending response failed.`)); | ||
} | ||
@@ -375,3 +375,3 @@ function replyError(error, method, startTime) { | ||
traceSendingResponse(message, method, startTime); | ||
messageWriter.write(message); | ||
messageWriter.write(message).catch(() => logger.error(`Sending response failed.`)); | ||
} | ||
@@ -390,3 +390,3 @@ function replySuccess(result, method, startTime) { | ||
traceSendingResponse(message, method, startTime); | ||
messageWriter.write(message); | ||
messageWriter.write(message).catch(() => logger.error(`Sending response failed.`)); | ||
} | ||
@@ -867,3 +867,3 @@ traceReceivedRequest(requestMessage); | ||
traceSendingNotification(notificationMessage); | ||
messageWriter.write(notificationMessage); | ||
return messageWriter.write(notificationMessage).catch(() => logger.error(`Sending notification failed.`)); | ||
}, | ||
@@ -909,3 +909,3 @@ onNotification: (type, handler) => { | ||
sendProgress: (_type, token, value) => { | ||
connection.sendNotification(ProgressNotification.type, { token, value }); | ||
return connection.sendNotification(ProgressNotification.type, { token, value }); | ||
}, | ||
@@ -961,3 +961,12 @@ onUnhandledProgress: unhandledProgressEmitter.event, | ||
disposable = token.onCancellationRequested(() => { | ||
cancellationStrategy.sender.sendCancellation(connection, id); | ||
const p = cancellationStrategy.sender.sendCancellation(connection, id); | ||
if (p === undefined) { | ||
logger.log(`Received no promise from cancellation strategy when cancelling id ${id}`); | ||
return Promise.resolve(); | ||
} | ||
else { | ||
return p.catch(() => { | ||
logger.log(`Sending cancellation messages for id ${id} failed`); | ||
}); | ||
} | ||
}); | ||
@@ -985,3 +994,3 @@ } | ||
try { | ||
messageWriter.write(requestMessage); | ||
messageWriter.write(requestMessage).catch(() => logger.error(`Sending request failed.`)); | ||
} | ||
@@ -1054,3 +1063,5 @@ catch (e) { | ||
if (_sendNotification && !isClosed() && !isDisposed()) { | ||
connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) }); | ||
connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) }).catch(() => { | ||
logger.error(`Sending trace notification failed`); | ||
}); | ||
} | ||
@@ -1057,0 +1068,0 @@ }, |
{ | ||
"name": "vscode-jsonrpc", | ||
"description": "A json rpc implementation over streams", | ||
"version": "7.0.0-next.1", | ||
"version": "8.0.0-next.1", | ||
"author": "Microsoft Corporation", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
193159
4559