@theia/plugin-ext 1.26.0-next.44 → 1.26.0-next.45
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/connection.d.ts +6 -9
- package/lib/common/connection.d.ts.map +1 -1
- package/lib/common/connection.js +10 -19
- package/lib/common/connection.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts.map +1 -1
- package/package.json +23 -23
- package/src/common/connection.ts +16 -28
- package/src/main/browser/debug/plugin-debug-session-factory.ts +1 -1
- package/src/plugin/node/debug/plugin-debug-adapter-session.ts +1 -1
|
@@ -1,25 +1,22 @@
|
|
|
1
|
+
import { Channel } from '@theia/debug/lib/common/debug-service';
|
|
1
2
|
import { ConnectionExt, ConnectionMain } from './plugin-api-rpc';
|
|
2
|
-
import { Event } from '@theia/core/lib/common/event';
|
|
3
|
-
import { ChannelCloseEvent, MessageProvider } from '@theia/core/lib/common/message-rpc/channel';
|
|
4
|
-
import { WriteBuffer, Channel } from '@theia/core';
|
|
5
3
|
/**
|
|
6
4
|
* A channel communicating with a counterpart in a plugin host.
|
|
7
5
|
*/
|
|
8
6
|
export declare class PluginChannel implements Channel {
|
|
9
|
-
readonly id: string;
|
|
7
|
+
protected readonly id: string;
|
|
10
8
|
protected readonly connection: ConnectionExt | ConnectionMain;
|
|
11
9
|
private messageEmitter;
|
|
12
10
|
private errorEmitter;
|
|
13
11
|
private closedEmitter;
|
|
14
12
|
constructor(id: string, connection: ConnectionExt | ConnectionMain);
|
|
15
|
-
getWriteBuffer(): WriteBuffer;
|
|
16
13
|
send(content: string): void;
|
|
17
|
-
fireMessageReceived(msg:
|
|
14
|
+
fireMessageReceived(msg: string): void;
|
|
18
15
|
fireError(error: unknown): void;
|
|
19
16
|
fireClosed(): void;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
onMessage(cb: (data: any) => void): void;
|
|
18
|
+
onError(cb: (reason: any) => void): void;
|
|
19
|
+
onClose(cb: (code: number, reason: string) => void): void;
|
|
23
20
|
close(): void;
|
|
24
21
|
}
|
|
25
22
|
export declare class ConnectionImpl implements ConnectionMain, ConnectionExt {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/common/connection.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/common/connection.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGjE;;GAEG;AACH,qBAAa,aAAc,YAAW,OAAO;IAMrC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM;IAC7B,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,aAAa,GAAG,cAAc;IANjE,OAAO,CAAC,cAAc,CAAkC;IACxD,OAAO,CAAC,YAAY,CAAmC;IACvD,OAAO,CAAC,aAAa,CAAgC;gBAG9B,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,GAAG,cAAc;IAEjE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAItC,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAI/B,UAAU,IAAI,IAAI;IAKlB,SAAS,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAKxC,OAAO,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAIxC,OAAO,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAIzD,KAAK,IAAI,IAAI;CAGhB;AAED,qBAAa,cAAe,YAAW,cAAc,EAAE,aAAa;IAChE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IACtD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoC;gBAEpD,KAAK,EAAE,cAAc,GAAG,aAAa;IAIjD;;;;;OAKG;IACG,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ9D;;;OAGG;IACG,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMlD;;;OAGG;IACG,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASlD;;;OAGG;IACG,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAO1D;;;OAGG;IACG,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;cAM5C,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAKzE"}
|
package/lib/common/connection.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConnectionImpl = exports.PluginChannel = void 0;
|
|
4
4
|
const event_1 = require("@theia/core/lib/common/event");
|
|
5
|
-
const uint8_array_message_buffer_1 = require("@theia/core/lib/common/message-rpc/uint8-array-message-buffer");
|
|
6
5
|
/**
|
|
7
6
|
* A channel communicating with a counterpart in a plugin host.
|
|
8
7
|
*/
|
|
@@ -14,13 +13,6 @@ class PluginChannel {
|
|
|
14
13
|
this.errorEmitter = new event_1.Emitter();
|
|
15
14
|
this.closedEmitter = new event_1.Emitter();
|
|
16
15
|
}
|
|
17
|
-
getWriteBuffer() {
|
|
18
|
-
const result = new uint8_array_message_buffer_1.Uint8ArrayWriteBuffer();
|
|
19
|
-
result.onCommit(buffer => {
|
|
20
|
-
this.connection.$sendMessage(this.id, new uint8_array_message_buffer_1.Uint8ArrayReadBuffer(buffer).readString());
|
|
21
|
-
});
|
|
22
|
-
return result;
|
|
23
|
-
}
|
|
24
16
|
send(content) {
|
|
25
17
|
this.connection.$sendMessage(this.id, content);
|
|
26
18
|
}
|
|
@@ -31,16 +23,18 @@ class PluginChannel {
|
|
|
31
23
|
this.errorEmitter.fire(error);
|
|
32
24
|
}
|
|
33
25
|
fireClosed() {
|
|
34
|
-
this.closedEmitter.fire(
|
|
26
|
+
this.closedEmitter.fire();
|
|
35
27
|
}
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
+
onMessage(cb) {
|
|
30
|
+
this.messageEmitter.event(cb);
|
|
38
31
|
}
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
onError(cb) {
|
|
34
|
+
this.errorEmitter.event(cb);
|
|
41
35
|
}
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
onClose(cb) {
|
|
37
|
+
this.closedEmitter.event(() => cb(-1, 'closed'));
|
|
44
38
|
}
|
|
45
39
|
close() {
|
|
46
40
|
this.connection.$deleteConnection(this.id);
|
|
@@ -60,10 +54,7 @@ class ConnectionImpl {
|
|
|
60
54
|
*/
|
|
61
55
|
async $sendMessage(id, message) {
|
|
62
56
|
if (this.connections.has(id)) {
|
|
63
|
-
|
|
64
|
-
const reader = new uint8_array_message_buffer_1.Uint8ArrayReadBuffer(writer.getCurrentContents());
|
|
65
|
-
writer.dispose();
|
|
66
|
-
this.connections.get(id).fireMessageReceived(() => reader);
|
|
57
|
+
this.connections.get(id).fireMessageReceived(message);
|
|
67
58
|
}
|
|
68
59
|
else {
|
|
69
60
|
console.warn(`Received message for unknown connection: ${id}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/common/connection.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/common/connection.ts"],"names":[],"mappings":";;;AAiBA,wDAAuD;AAEvD;;GAEG;AACH,MAAa,aAAa;IAKtB,YACuB,EAAU,EACV,UAA0C;QAD1C,OAAE,GAAF,EAAE,CAAQ;QACV,eAAU,GAAV,UAAU,CAAgC;QANzD,mBAAc,GAAoB,IAAI,eAAO,EAAE,CAAC;QAChD,iBAAY,GAAqB,IAAI,eAAO,EAAE,CAAC;QAC/C,kBAAa,GAAkB,IAAI,eAAO,EAAE,CAAC;IAIgB,CAAC;IAEtE,IAAI,CAAC,OAAe;QAChB,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAED,mBAAmB,CAAC,GAAW;QAC3B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,SAAS,CAAC,KAAc;QACpB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,UAAU;QACN,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;IAED,8DAA8D;IAC9D,SAAS,CAAC,EAAuB;QAC7B,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IAED,8DAA8D;IAC9D,OAAO,CAAC,EAAyB;QAC7B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,CAAC,EAA0C;QAC9C,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,C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;QAClD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACrD,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;QACvC,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,kBAAkB,CAAC,EAAU;QAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,MAAM,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACjF,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QACrC,OAAO,UAAU,CAAC;IACtB,CAAC;IAES,KAAK,CAAC,kBAAkB,CAAC,EAAU;QACzC,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QACnD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAvED,wCAuEC"}
|
|
@@ -14,7 +14,7 @@ import { TerminalOptionsExt } from '../../../common/plugin-api-rpc';
|
|
|
14
14
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
15
15
|
import { DebugContribution } from '@theia/debug/lib/browser/debug-contribution';
|
|
16
16
|
import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
|
|
17
|
-
import { Channel } from '@theia/
|
|
17
|
+
import { Channel } from '@theia/debug/lib/common/debug-service';
|
|
18
18
|
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
19
19
|
export declare class PluginDebugSession extends DebugSession {
|
|
20
20
|
readonly id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-debug-session-factory.d.ts","sourceRoot":"","sources":["../../../../src/main/browser/debug/plugin-debug-session-factory.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qDAAqD,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AACzG,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"plugin-debug-session-factory.d.ts","sourceRoot":"","sources":["../../../../src/main/browser/debug/plugin-debug-session-factory.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qDAAqD,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,w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CAAC,EACjD,WAAW,EAAE,WAAW,EACjC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,EACzC,yBAAyB,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,EAClE,gBAAgB,EAAE,gBAAgB;IAKzD,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,aAAa,CAAC,EAAE,YAAY,GAAG,YAAY;CAsB5G"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DebugAdapterSessionImpl } from '@theia/debug/lib/node/debug-adapter-session';
|
|
2
2
|
import * as theia from '@theia/plugin';
|
|
3
3
|
import { DebugAdapter } from '@theia/debug/lib/node/debug-model';
|
|
4
|
-
import { Channel } from '@theia/
|
|
4
|
+
import { Channel } from '@theia/debug/lib/common/debug-service';
|
|
5
5
|
/**
|
|
6
6
|
* Server debug adapter session.
|
|
7
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-debug-adapter-session.d.ts","sourceRoot":"","sources":["../../../../src/plugin/node/debug/plugin-debug-adapter-session.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"plugin-debug-adapter-session.d.ts","sourceRoot":"","sources":["../../../../src/plugin/node/debug/plugin-debug-adapter-session.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAIhE;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,uBAAuB;aAO5C,YAAY,EAAE,YAAY;IAC5C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,mBAAmB;IACrD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY;IARvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,eAAe,GAAG,SAAS,CAAC;IAC5D,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,kBAAkB,CAAC;gBAG3B,YAAY,EAAE,YAAY,EACzB,OAAO,EAAE,KAAK,CAAC,mBAAmB,EAClC,YAAY,EAAE,KAAK,CAAC,YAAY;IAUxC,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAOtC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAO9B,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;cAI3C,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;cAOvC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;cAU3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;cAO5B,kBAAkB,IAAI,IAAI;CAMhD"}
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/plugin-ext",
|
|
3
|
-
"version": "1.26.0-next.
|
|
3
|
+
"version": "1.26.0-next.45+e6ad6166f5d",
|
|
4
4
|
"description": "Theia - Plugin Extension",
|
|
5
5
|
"main": "lib/common/index.js",
|
|
6
6
|
"typings": "lib/common/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@theia/bulk-edit": "1.26.0-next.
|
|
9
|
-
"@theia/callhierarchy": "1.26.0-next.
|
|
10
|
-
"@theia/console": "1.26.0-next.
|
|
11
|
-
"@theia/core": "1.26.0-next.
|
|
12
|
-
"@theia/debug": "1.26.0-next.
|
|
13
|
-
"@theia/editor": "1.26.0-next.
|
|
14
|
-
"@theia/file-search": "1.26.0-next.
|
|
15
|
-
"@theia/filesystem": "1.26.0-next.
|
|
16
|
-
"@theia/markers": "1.26.0-next.
|
|
17
|
-
"@theia/messages": "1.26.0-next.
|
|
18
|
-
"@theia/monaco": "1.26.0-next.
|
|
8
|
+
"@theia/bulk-edit": "1.26.0-next.45+e6ad6166f5d",
|
|
9
|
+
"@theia/callhierarchy": "1.26.0-next.45+e6ad6166f5d",
|
|
10
|
+
"@theia/console": "1.26.0-next.45+e6ad6166f5d",
|
|
11
|
+
"@theia/core": "1.26.0-next.45+e6ad6166f5d",
|
|
12
|
+
"@theia/debug": "1.26.0-next.45+e6ad6166f5d",
|
|
13
|
+
"@theia/editor": "1.26.0-next.45+e6ad6166f5d",
|
|
14
|
+
"@theia/file-search": "1.26.0-next.45+e6ad6166f5d",
|
|
15
|
+
"@theia/filesystem": "1.26.0-next.45+e6ad6166f5d",
|
|
16
|
+
"@theia/markers": "1.26.0-next.45+e6ad6166f5d",
|
|
17
|
+
"@theia/messages": "1.26.0-next.45+e6ad6166f5d",
|
|
18
|
+
"@theia/monaco": "1.26.0-next.45+e6ad6166f5d",
|
|
19
19
|
"@theia/monaco-editor-core": "1.65.2",
|
|
20
|
-
"@theia/navigator": "1.26.0-next.
|
|
21
|
-
"@theia/output": "1.26.0-next.
|
|
22
|
-
"@theia/plugin": "1.26.0-next.
|
|
23
|
-
"@theia/preferences": "1.26.0-next.
|
|
24
|
-
"@theia/scm": "1.26.0-next.
|
|
25
|
-
"@theia/search-in-workspace": "1.26.0-next.
|
|
26
|
-
"@theia/task": "1.26.0-next.
|
|
27
|
-
"@theia/terminal": "1.26.0-next.
|
|
28
|
-
"@theia/timeline": "1.26.0-next.
|
|
29
|
-
"@theia/workspace": "1.26.0-next.
|
|
20
|
+
"@theia/navigator": "1.26.0-next.45+e6ad6166f5d",
|
|
21
|
+
"@theia/output": "1.26.0-next.45+e6ad6166f5d",
|
|
22
|
+
"@theia/plugin": "1.26.0-next.45+e6ad6166f5d",
|
|
23
|
+
"@theia/preferences": "1.26.0-next.45+e6ad6166f5d",
|
|
24
|
+
"@theia/scm": "1.26.0-next.45+e6ad6166f5d",
|
|
25
|
+
"@theia/search-in-workspace": "1.26.0-next.45+e6ad6166f5d",
|
|
26
|
+
"@theia/task": "1.26.0-next.45+e6ad6166f5d",
|
|
27
|
+
"@theia/terminal": "1.26.0-next.45+e6ad6166f5d",
|
|
28
|
+
"@theia/timeline": "1.26.0-next.45+e6ad6166f5d",
|
|
29
|
+
"@theia/workspace": "1.26.0-next.45+e6ad6166f5d",
|
|
30
30
|
"@types/mime": "^2.0.1",
|
|
31
31
|
"decompress": "^4.2.1",
|
|
32
32
|
"escape-html": "^1.0.3",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"nyc": {
|
|
92
92
|
"extends": "../../configs/nyc.json"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "e6ad6166f5d29f8ab42d99b5f9f2d06934854a01"
|
|
95
95
|
}
|
package/src/common/connection.ts
CHANGED
|
@@ -13,38 +13,27 @@
|
|
|
13
13
|
//
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
|
+
import { Channel } from '@theia/debug/lib/common/debug-service';
|
|
16
17
|
import { ConnectionExt, ConnectionMain } from './plugin-api-rpc';
|
|
17
|
-
import { Emitter
|
|
18
|
-
import { ChannelCloseEvent, MessageProvider } from '@theia/core/lib/common/message-rpc/channel';
|
|
19
|
-
import { WriteBuffer, Channel } from '@theia/core';
|
|
20
|
-
import { Uint8ArrayReadBuffer, Uint8ArrayWriteBuffer } from '@theia/core/lib/common/message-rpc/uint8-array-message-buffer';
|
|
18
|
+
import { Emitter } from '@theia/core/lib/common/event';
|
|
21
19
|
|
|
22
20
|
/**
|
|
23
21
|
* A channel communicating with a counterpart in a plugin host.
|
|
24
22
|
*/
|
|
25
23
|
export class PluginChannel implements Channel {
|
|
26
|
-
private messageEmitter: Emitter<
|
|
24
|
+
private messageEmitter: Emitter<string> = new Emitter();
|
|
27
25
|
private errorEmitter: Emitter<unknown> = new Emitter();
|
|
28
|
-
private closedEmitter: Emitter<
|
|
26
|
+
private closedEmitter: Emitter<void> = new Emitter();
|
|
29
27
|
|
|
30
28
|
constructor(
|
|
31
|
-
readonly id: string,
|
|
29
|
+
protected readonly id: string,
|
|
32
30
|
protected readonly connection: ConnectionExt | ConnectionMain) { }
|
|
33
31
|
|
|
34
|
-
getWriteBuffer(): WriteBuffer {
|
|
35
|
-
const result = new Uint8ArrayWriteBuffer();
|
|
36
|
-
result.onCommit(buffer => {
|
|
37
|
-
this.connection.$sendMessage(this.id, new Uint8ArrayReadBuffer(buffer).readString());
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
32
|
send(content: string): void {
|
|
44
33
|
this.connection.$sendMessage(this.id, content);
|
|
45
34
|
}
|
|
46
35
|
|
|
47
|
-
fireMessageReceived(msg:
|
|
36
|
+
fireMessageReceived(msg: string): void {
|
|
48
37
|
this.messageEmitter.fire(msg);
|
|
49
38
|
}
|
|
50
39
|
|
|
@@ -53,19 +42,21 @@ export class PluginChannel implements Channel {
|
|
|
53
42
|
}
|
|
54
43
|
|
|
55
44
|
fireClosed(): void {
|
|
56
|
-
this.closedEmitter.fire(
|
|
45
|
+
this.closedEmitter.fire();
|
|
57
46
|
}
|
|
58
47
|
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
+
onMessage(cb: (data: any) => void): void {
|
|
50
|
+
this.messageEmitter.event(cb);
|
|
61
51
|
}
|
|
62
52
|
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
+
onError(cb: (reason: any) => void): void {
|
|
55
|
+
this.errorEmitter.event(cb);
|
|
65
56
|
}
|
|
66
57
|
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
onClose(cb: (code: number, reason: string) => void): void {
|
|
59
|
+
this.closedEmitter.event(() => cb(-1, 'closed'));
|
|
69
60
|
}
|
|
70
61
|
|
|
71
62
|
close(): void {
|
|
@@ -89,10 +80,7 @@ export class ConnectionImpl implements ConnectionMain, ConnectionExt {
|
|
|
89
80
|
*/
|
|
90
81
|
async $sendMessage(id: string, message: string): Promise<void> {
|
|
91
82
|
if (this.connections.has(id)) {
|
|
92
|
-
|
|
93
|
-
const reader = new Uint8ArrayReadBuffer(writer.getCurrentContents());
|
|
94
|
-
writer.dispose();
|
|
95
|
-
this.connections.get(id)!.fireMessageReceived(() => reader);
|
|
83
|
+
this.connections.get(id)!.fireMessageReceived(message);
|
|
96
84
|
} else {
|
|
97
85
|
console.warn(`Received message for unknown connection: ${id}`);
|
|
98
86
|
}
|
|
@@ -30,7 +30,7 @@ import { TerminalOptionsExt } from '../../../common/plugin-api-rpc';
|
|
|
30
30
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
31
31
|
import { DebugContribution } from '@theia/debug/lib/browser/debug-contribution';
|
|
32
32
|
import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
|
|
33
|
-
import { Channel } from '@theia/
|
|
33
|
+
import { Channel } from '@theia/debug/lib/common/debug-service';
|
|
34
34
|
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
35
35
|
|
|
36
36
|
export class PluginDebugSession extends DebugSession {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { DebugAdapterSessionImpl } from '@theia/debug/lib/node/debug-adapter-session';
|
|
18
18
|
import * as theia from '@theia/plugin';
|
|
19
19
|
import { DebugAdapter } from '@theia/debug/lib/node/debug-model';
|
|
20
|
-
import { Channel } from '@theia/
|
|
20
|
+
import { Channel } from '@theia/debug/lib/common/debug-service';
|
|
21
21
|
|
|
22
22
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
23
23
|
|