@theia/plugin-ext 1.33.0-next.2 → 1.33.0-next.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/index.js +2 -0
- package/lib/common/index.js.map +1 -1
- package/lib/common/plugin-api-rpc-model.d.ts +78 -0
- package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc-model.js +17 -1
- package/lib/common/plugin-api-rpc-model.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +20 -7
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js +0 -2
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/plugin-protocol.d.ts +4 -4
- package/lib/common/plugin-protocol.d.ts.map +1 -1
- package/lib/common/proxy-handler.d.ts +66 -0
- package/lib/common/proxy-handler.d.ts.map +1 -0
- package/lib/common/proxy-handler.js +98 -0
- package/lib/common/proxy-handler.js.map +1 -0
- package/lib/common/reference-map.d.ts +8 -0
- package/lib/common/reference-map.d.ts.map +1 -0
- package/lib/common/reference-map.js +40 -0
- package/lib/common/reference-map.js.map +1 -0
- package/lib/common/rpc-protocol.d.ts +25 -51
- package/lib/common/rpc-protocol.d.ts.map +1 -1
- package/lib/common/rpc-protocol.js +126 -323
- package/lib/common/rpc-protocol.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin-watcher.d.ts +1 -1
- package/lib/hosted/browser/hosted-plugin-watcher.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin-watcher.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +13 -8
- package/lib/hosted/browser/hosted-plugin.js.map +1 -1
- package/lib/hosted/browser/plugin-worker.d.ts.map +1 -1
- package/lib/hosted/browser/plugin-worker.js +14 -9
- package/lib/hosted/browser/plugin-worker.js.map +1 -1
- package/lib/hosted/browser/worker/worker-main.d.ts +1 -1
- package/lib/hosted/browser/worker/worker-main.d.ts.map +1 -1
- package/lib/hosted/browser/worker/worker-main.js +23 -22
- package/lib/hosted/browser/worker/worker-main.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-process.d.ts +5 -4
- package/lib/hosted/node/hosted-plugin-process.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-process.js +20 -13
- package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-protocol.d.ts +22 -0
- package/lib/hosted/node/hosted-plugin-protocol.d.ts.map +1 -0
- package/lib/hosted/node/hosted-plugin-protocol.js +37 -0
- package/lib/hosted/node/hosted-plugin-protocol.js.map +1 -0
- package/lib/hosted/node/hosted-plugin.d.ts +1 -1
- package/lib/hosted/node/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/plugin-host.d.ts +1 -1
- package/lib/hosted/node/plugin-host.d.ts.map +1 -1
- package/lib/hosted/node/plugin-host.js +10 -21
- package/lib/hosted/node/plugin-host.js.map +1 -1
- package/lib/hosted/node/plugin-service.d.ts +1 -1
- package/lib/hosted/node/plugin-service.d.ts.map +1 -1
- package/lib/hosted/node/plugin-service.js.map +1 -1
- package/lib/main/browser/file-system-main-impl.d.ts +1 -0
- package/lib/main/browser/file-system-main-impl.d.ts.map +1 -1
- package/lib/main/browser/file-system-main-impl.js +9 -2
- package/lib/main/browser/file-system-main-impl.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts +1 -0
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/languages-main.js +10 -0
- package/lib/main/browser/languages-main.js.map +1 -1
- package/lib/main/browser/main-context.d.ts.map +1 -1
- package/lib/main/browser/main-context.js +0 -3
- package/lib/main/browser/main-context.js.map +1 -1
- package/lib/main/browser/tasks-main.d.ts.map +1 -1
- package/lib/main/browser/tasks-main.js +13 -9
- package/lib/main/browser/tasks-main.js.map +1 -1
- package/lib/plugin/debug/debug-ext.d.ts +2 -1
- package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
- package/lib/plugin/debug/debug-ext.js +10 -1
- package/lib/plugin/debug/debug-ext.js.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +6 -5
- package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-session.js +18 -4
- package/lib/plugin/debug/plugin-debug-adapter-session.js.map +1 -1
- package/lib/plugin/file-system-ext-impl.d.ts +2 -0
- package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
- package/lib/plugin/file-system-ext-impl.js +22 -5
- package/lib/plugin/file-system-ext-impl.js.map +1 -1
- package/lib/plugin/languages/inline-completion.d.ts +21 -0
- package/lib/plugin/languages/inline-completion.d.ts.map +1 -0
- package/lib/plugin/languages/inline-completion.js +94 -0
- package/lib/plugin/languages/inline-completion.js.map +1 -0
- package/lib/plugin/languages.d.ts +5 -2
- package/lib/plugin/languages.d.ts.map +1 -1
- package/lib/plugin/languages.js +16 -1
- package/lib/plugin/languages.js.map +1 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +107 -3
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/theming.d.ts.map +1 -1
- package/lib/plugin/theming.js +3 -0
- package/lib/plugin/theming.js.map +1 -1
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/type-converters.js +6 -14
- package/lib/plugin/type-converters.js.map +1 -1
- package/lib/plugin/type-converters.spec.js +5 -4
- package/lib/plugin/type-converters.spec.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +149 -9
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +205 -32
- package/lib/plugin/types-impl.js.map +1 -1
- package/package.json +25 -25
- package/src/common/index.ts +4 -0
- package/src/common/plugin-api-rpc-model.ts +96 -0
- package/src/common/plugin-api-rpc.ts +25 -7
- package/src/common/plugin-protocol.ts +4 -4
- package/src/common/proxy-handler.ts +126 -0
- package/src/common/reference-map.ts +38 -0
- package/src/common/rpc-protocol.ts +128 -401
- package/src/hosted/browser/hosted-plugin-watcher.ts +4 -3
- package/src/hosted/browser/hosted-plugin.ts +17 -8
- package/src/hosted/browser/plugin-worker.ts +16 -10
- package/src/hosted/browser/worker/worker-main.ts +25 -26
- package/src/hosted/node/hosted-plugin-process.ts +25 -16
- package/src/hosted/node/hosted-plugin-protocol.ts +49 -0
- package/src/hosted/node/hosted-plugin.ts +1 -1
- package/src/hosted/node/plugin-host.ts +11 -22
- package/src/hosted/node/plugin-service.ts +1 -1
- package/src/main/browser/file-system-main-impl.ts +12 -3
- package/src/main/browser/languages-main.ts +18 -1
- package/src/main/browser/main-context.ts +0 -4
- package/src/main/browser/tasks-main.ts +13 -9
- package/src/plugin/debug/debug-ext.ts +11 -2
- package/src/plugin/debug/plugin-debug-adapter-session.ts +17 -9
- package/src/plugin/file-system-ext-impl.ts +21 -5
- package/src/plugin/languages/inline-completion.ts +126 -0
- package/src/plugin/languages.ts +30 -3
- package/src/plugin/plugin-context.ts +142 -4
- package/src/plugin/theming.ts +3 -0
- package/src/plugin/type-converters.spec.ts +5 -4
- package/src/plugin/type-converters.ts +10 -12
- package/src/plugin/types-impl.ts +253 -27
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RpcInvocationHandler = exports.ClientProxyHandler = void 0;
|
|
4
|
+
/********************************************************************************
|
|
5
|
+
* Copyright (C) 2022 STMicroelectronics and others.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
9
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
10
|
+
*
|
|
11
|
+
* This Source Code may also be made available under the following Secondary
|
|
12
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
13
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
14
|
+
* with the GNU Classpath Exception which is available at
|
|
15
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
16
|
+
*
|
|
17
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
|
+
********************************************************************************/
|
|
19
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
20
|
+
const core_1 = require("@theia/core/");
|
|
21
|
+
const promise_util_1 = require("@theia/core/lib/common/promise-util");
|
|
22
|
+
/**
|
|
23
|
+
* A proxy handler that will send any method invocation on the proxied object
|
|
24
|
+
* as a rcp protocol message over a channel.
|
|
25
|
+
*/
|
|
26
|
+
class ClientProxyHandler {
|
|
27
|
+
constructor(options) {
|
|
28
|
+
this.rpcDeferred = new promise_util_1.Deferred();
|
|
29
|
+
this.isRpcInitialized = false;
|
|
30
|
+
Object.assign(this, options);
|
|
31
|
+
}
|
|
32
|
+
initializeRpc() {
|
|
33
|
+
const clientOptions = { encoder: this.encoder, decoder: this.decoder, mode: 'clientOnly' };
|
|
34
|
+
this.channelProvider().then(channel => {
|
|
35
|
+
const rpc = new core_1.RpcProtocol(channel, undefined, clientOptions);
|
|
36
|
+
this.rpcDeferred.resolve(rpc);
|
|
37
|
+
this.isRpcInitialized = true;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
get(target, name, receiver) {
|
|
41
|
+
if (!this.isRpcInitialized) {
|
|
42
|
+
this.initializeRpc();
|
|
43
|
+
}
|
|
44
|
+
if (target[name] || name.charCodeAt(0) !== 36 /* CharCode.DollarSign */) {
|
|
45
|
+
return target[name];
|
|
46
|
+
}
|
|
47
|
+
const isNotify = this.isNotification(name);
|
|
48
|
+
return (...args) => {
|
|
49
|
+
const method = name.toString();
|
|
50
|
+
return this.rpcDeferred.promise.then(async (connection) => {
|
|
51
|
+
if (isNotify) {
|
|
52
|
+
connection.sendNotification(method, args);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return await connection.sendRequest(method, args);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Return whether the given property represents a notification. If true,
|
|
62
|
+
* the promise returned from the invocation will resolve immediately to `undefined`
|
|
63
|
+
*
|
|
64
|
+
* A property leads to a notification rather than a method call if its name
|
|
65
|
+
* begins with `notify` or `on`.
|
|
66
|
+
*
|
|
67
|
+
* @param p - The property being called on the proxy.
|
|
68
|
+
* @return Whether `p` represents a notification.
|
|
69
|
+
*/
|
|
70
|
+
isNotification(p) {
|
|
71
|
+
let propertyString = p.toString();
|
|
72
|
+
if (propertyString.charCodeAt(0) === 36 /* CharCode.DollarSign */) {
|
|
73
|
+
propertyString = propertyString.substring(1);
|
|
74
|
+
}
|
|
75
|
+
return propertyString.startsWith('notify') || propertyString.startsWith('on');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.ClientProxyHandler = ClientProxyHandler;
|
|
79
|
+
class RpcInvocationHandler {
|
|
80
|
+
constructor(options) {
|
|
81
|
+
this.rpcDeferred = new promise_util_1.Deferred();
|
|
82
|
+
Object.assign(this, options);
|
|
83
|
+
}
|
|
84
|
+
listen(channel) {
|
|
85
|
+
const serverOptions = { encoder: this.encoder, decoder: this.decoder, mode: 'serverOnly' };
|
|
86
|
+
const server = new core_1.RpcProtocol(channel, (method, args) => this.handleRequest(method, args), serverOptions);
|
|
87
|
+
server.onNotification((e) => this.onNotification(e.method, e.args));
|
|
88
|
+
this.rpcDeferred.resolve(server);
|
|
89
|
+
}
|
|
90
|
+
handleRequest(method, args) {
|
|
91
|
+
return this.rpcDeferred.promise.then(() => this.target[method](...args));
|
|
92
|
+
}
|
|
93
|
+
onNotification(method, args) {
|
|
94
|
+
this.target[method](...args);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.RpcInvocationHandler = RpcInvocationHandler;
|
|
98
|
+
//# sourceMappingURL=proxy-handler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,EAAE,aAAa,CAAC,CAAC;QAC1H,MAAM,CAAC,cAAc,CAAC,CAAC,CAAgC,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACnG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAES,aAAa,CAAC,MAAc,EAAE,IAAW;QAC/C,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC7E,CAAC;IAES,cAAc,CAAC,MAAc,EAAE,IAAW;QAChD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACjC,CAAC;CACJ;AA1BD,oDA0BC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class ReferenceMap<T> {
|
|
2
|
+
private readonly _references;
|
|
3
|
+
private _idPool;
|
|
4
|
+
createReferenceId(value: T): number;
|
|
5
|
+
disposeReferenceId(referenceId: number): T | undefined;
|
|
6
|
+
get(referenceId: number): T | undefined;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=reference-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-map.d.ts","sourceRoot":"","sources":["../../src/common/reference-map.ts"],"names":[],"mappings":"AAkBA,qBAAa,YAAY,CAAC,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAwB;IACpD,OAAO,CAAC,OAAO,CAAK;IAEpB,iBAAiB,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM;IAMnC,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAMtD,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;CAG1C"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2022 Ericsson and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ReferenceMap = void 0;
|
|
19
|
+
// copied from hhttps://github.com/microsoft/vscode/blob/6261075646f055b99068d3688932416f2346dd3b/src/vs/workbench/api/common/extHostLanguageFeatures.ts#L1291-L1310.
|
|
20
|
+
class ReferenceMap {
|
|
21
|
+
constructor() {
|
|
22
|
+
this._references = new Map();
|
|
23
|
+
this._idPool = 1;
|
|
24
|
+
}
|
|
25
|
+
createReferenceId(value) {
|
|
26
|
+
const id = this._idPool++;
|
|
27
|
+
this._references.set(id, value);
|
|
28
|
+
return id;
|
|
29
|
+
}
|
|
30
|
+
disposeReferenceId(referenceId) {
|
|
31
|
+
const value = this._references.get(referenceId);
|
|
32
|
+
this._references.delete(referenceId);
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
get(referenceId) {
|
|
36
|
+
return this._references.get(referenceId);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ReferenceMap = ReferenceMap;
|
|
40
|
+
//# sourceMappingURL=reference-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-map.js","sourceRoot":"","sources":["../../src/common/reference-map.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAEhF,qKAAqK;AAErK,MAAa,YAAY;IAAzB;QACqB,gBAAW,GAAG,IAAI,GAAG,EAAa,CAAC;QAC5C,YAAO,GAAG,CAAC,CAAC;IAiBxB,CAAC;IAfG,iBAAiB,CAAC,KAAQ;QACtB,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC1B,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAChC,OAAO,EAAE,CAAC;IACd,CAAC;IAED,kBAAkB,CAAC,WAAmB;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAChD,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACrC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,GAAG,CAAC,WAAmB;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;CACJ;AAnBD,oCAmBC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Channel, Disposable, ReadBuffer, WriteBuffer } from '@theia/core';
|
|
2
|
+
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
3
|
+
import { MessageProvider } from '@theia/core/lib/common/message-rpc/channel';
|
|
3
4
|
export interface MessageConnection {
|
|
4
5
|
send(msg: string): void;
|
|
5
6
|
onMessage: Event<string>;
|
|
@@ -31,62 +32,35 @@ export declare namespace ConnectionClosedError {
|
|
|
31
32
|
export declare class RPCProtocolImpl implements RPCProtocol {
|
|
32
33
|
private readonly locals;
|
|
33
34
|
private readonly proxies;
|
|
34
|
-
private lastMessageId;
|
|
35
|
-
private readonly cancellationTokenSources;
|
|
36
|
-
private readonly pendingRPCReplies;
|
|
37
35
|
private readonly multiplexer;
|
|
38
|
-
private
|
|
39
|
-
private
|
|
36
|
+
private readonly encoder;
|
|
37
|
+
private readonly decoder;
|
|
40
38
|
private readonly toDispose;
|
|
41
|
-
constructor(
|
|
42
|
-
replacer?: (key: string | undefined, value: any) => any;
|
|
43
|
-
reviver?: (key: string | undefined, value: any) => any;
|
|
44
|
-
});
|
|
45
|
-
private get isDisposed();
|
|
39
|
+
constructor(channel: Channel);
|
|
46
40
|
dispose(): void;
|
|
41
|
+
protected get isDisposed(): boolean;
|
|
47
42
|
getProxy<T>(proxyId: ProxyIdentifier<T>): T;
|
|
43
|
+
protected createProxy<T>(proxyId: string): T;
|
|
48
44
|
set<T, R extends T>(identifier: ProxyIdentifier<T>, instance: R): R;
|
|
49
|
-
private createProxy;
|
|
50
|
-
private remoteCall;
|
|
51
|
-
private receiveOneMessage;
|
|
52
|
-
private receiveCancel;
|
|
53
|
-
private receiveRequest;
|
|
54
|
-
private receiveReply;
|
|
55
|
-
private receiveReplyErr;
|
|
56
|
-
private invokeHandler;
|
|
57
|
-
private doInvokeHandler;
|
|
58
|
-
private cancel;
|
|
59
|
-
private request;
|
|
60
|
-
private replyOK;
|
|
61
|
-
private replyErr;
|
|
62
45
|
}
|
|
63
46
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* and then, after receiving, revived to objects again,
|
|
68
|
-
* so there is feeling that object was transferred via rpc channel.
|
|
69
|
-
*
|
|
70
|
-
* To distinguish between regular and altered objects, field $type is added to altered ones.
|
|
71
|
-
* Also value of that field specifies kind of the object.
|
|
47
|
+
* Wraps and underlying channel to send/receive multiple messages in one go:
|
|
48
|
+
* - multiple messages to be sent from one stack get sent in bulk at `process.nextTick`.
|
|
49
|
+
* - each incoming message is handled in a separate `process.nextTick`.
|
|
72
50
|
*/
|
|
73
|
-
export declare
|
|
74
|
-
|
|
75
|
-
|
|
51
|
+
export declare class BatchingChannel implements Channel {
|
|
52
|
+
protected underlyingChannel: Channel;
|
|
53
|
+
protected messagesToSend: Uint8Array[];
|
|
54
|
+
constructor(underlyingChannel: Channel);
|
|
55
|
+
protected onMessageEmitter: Emitter<MessageProvider>;
|
|
56
|
+
get onMessage(): Event<MessageProvider>;
|
|
57
|
+
readonly onClose: Event<import("@theia/core").ChannelCloseEvent>;
|
|
58
|
+
readonly onError: Event<unknown>;
|
|
59
|
+
close(): void;
|
|
60
|
+
getWriteBuffer(): WriteBuffer;
|
|
61
|
+
protected commitSingleMessage(msg: Uint8Array): void;
|
|
62
|
+
protected sendAccumulated(): void;
|
|
63
|
+
protected handleMessages(buffer: ReadBuffer): void;
|
|
76
64
|
}
|
|
77
|
-
export declare
|
|
78
|
-
Request = 1,
|
|
79
|
-
Reply = 2,
|
|
80
|
-
ReplyErr = 3,
|
|
81
|
-
Cancel = 4,
|
|
82
|
-
Terminate = 5,
|
|
83
|
-
Terminated = 6
|
|
84
|
-
}
|
|
85
|
-
export interface SerializedError {
|
|
86
|
-
readonly $isError: true;
|
|
87
|
-
readonly name: string;
|
|
88
|
-
readonly message: string;
|
|
89
|
-
readonly stack: string;
|
|
90
|
-
}
|
|
91
|
-
export declare function transformErrorForSerialization(error: Error): SerializedError;
|
|
65
|
+
export declare function registerMsgPackExtensions(): void;
|
|
92
66
|
//# sourceMappingURL=rpc-protocol.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-protocol.d.ts","sourceRoot":"","sources":["../../src/common/rpc-protocol.ts"],"names":[],"mappings":"AAwBA,OAAO,
|
|
1
|
+
{"version":3,"file":"rpc-protocol.d.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