@hydranium/data-client-theia 1.0.0-next.19 → 1.0.0-next.193
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/README.md +35 -27
- package/lib/browser/channel-connection.d.ts +2 -2
- package/lib/browser/channel-connection.js.map +1 -1
- package/lib/browser/channel-data-port.d.ts +83 -0
- package/lib/browser/channel-data-port.d.ts.map +1 -0
- package/lib/browser/channel-data-port.js +179 -0
- package/lib/browser/channel-data-port.js.map +1 -0
- package/lib/browser/data-session-stop-contribution.d.ts +64 -0
- package/lib/browser/data-session-stop-contribution.d.ts.map +1 -0
- package/lib/browser/data-session-stop-contribution.js +117 -0
- package/lib/browser/data-session-stop-contribution.js.map +1 -0
- package/lib/browser/host-diagnostics-frontend.js.map +1 -1
- package/lib/browser/index.d.ts +2 -3
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +2 -3
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/workspace-gate.js.map +1 -1
- package/lib/common/emitter-data-client.d.ts +13 -1
- package/lib/common/emitter-data-client.d.ts.map +1 -1
- package/lib/common/emitter-data-client.js +18 -0
- package/lib/common/emitter-data-client.js.map +1 -1
- package/lib/node/connection-container-module.d.ts +5 -4
- package/lib/node/connection-container-module.d.ts.map +1 -1
- package/lib/node/connection-container-module.js +5 -4
- package/lib/node/connection-container-module.js.map +1 -1
- package/lib/node/data-server-connection-handler.d.ts +9 -9
- package/lib/node/data-server-connection-handler.d.ts.map +1 -1
- package/lib/node/data-server-connection-handler.js +8 -12
- package/lib/node/data-server-connection-handler.js.map +1 -1
- package/lib/node/host-diagnostics-server.d.ts.map +1 -1
- package/lib/node/host-diagnostics-server.js.map +1 -1
- package/lib/node/index.d.ts +0 -1
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +0 -1
- package/lib/node/index.js.map +1 -1
- package/package.json +25 -24
- package/src/browser/channel-connection.ts +2 -2
- package/src/browser/channel-data-port.ts +173 -0
- package/src/browser/data-session-stop-contribution.ts +117 -0
- package/src/browser/index.ts +2 -3
- package/src/common/emitter-data-client.ts +27 -0
- package/src/node/connection-container-module.ts +5 -4
- package/src/node/data-server-connection-handler.ts +10 -13
- package/src/node/index.ts +0 -1
- package/lib/browser/data-service-frontend.d.ts +0 -154
- package/lib/browser/data-service-frontend.d.ts.map +0 -1
- package/lib/browser/data-service-frontend.js +0 -169
- package/lib/browser/data-service-frontend.js.map +0 -1
- package/lib/browser/diagnostics-data-service-frontend.d.ts +0 -35
- package/lib/browser/diagnostics-data-service-frontend.d.ts.map +0 -1
- package/lib/browser/diagnostics-data-service-frontend.js +0 -54
- package/lib/browser/diagnostics-data-service-frontend.js.map +0 -1
- package/lib/browser/references-data-service-frontend.d.ts +0 -45
- package/lib/browser/references-data-service-frontend.d.ts.map +0 -1
- package/lib/browser/references-data-service-frontend.js +0 -55
- package/lib/browser/references-data-service-frontend.js.map +0 -1
- package/lib/node/socket-channel-forwarder.d.ts +0 -34
- package/lib/node/socket-channel-forwarder.d.ts.map +0 -1
- package/lib/node/socket-channel-forwarder.js +0 -63
- package/lib/node/socket-channel-forwarder.js.map +0 -1
- package/src/browser/data-service-frontend.ts +0 -208
- package/src/browser/diagnostics-data-service-frontend.ts +0 -70
- package/src/browser/references-data-service-frontend.ts +0 -70
- package/src/node/socket-channel-forwarder.ts +0 -64
package/lib/browser/index.d.ts
CHANGED
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
export * from './channel-connection';
|
|
10
|
-
export * from './data-
|
|
11
|
-
export * from './
|
|
10
|
+
export * from './channel-data-port';
|
|
11
|
+
export * from './data-session-stop-contribution';
|
|
12
12
|
export * from './host-diagnostics-frontend';
|
|
13
|
-
export * from './references-data-service-frontend';
|
|
14
13
|
export * from './workspace-gate';
|
|
15
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,sBAAsB,CAAC;AACrC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC"}
|
package/lib/browser/index.js
CHANGED
|
@@ -23,9 +23,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
__exportStar(require("./channel-connection"), exports);
|
|
26
|
-
__exportStar(require("./data-
|
|
27
|
-
__exportStar(require("./
|
|
26
|
+
__exportStar(require("./channel-data-port"), exports);
|
|
27
|
+
__exportStar(require("./data-session-stop-contribution"), exports);
|
|
28
28
|
__exportStar(require("./host-diagnostics-frontend"), exports);
|
|
29
|
-
__exportStar(require("./references-data-service-frontend"), exports);
|
|
30
29
|
__exportStar(require("./workspace-gate"), exports);
|
|
31
30
|
//# sourceMappingURL=index.js.map
|
package/lib/browser/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,uDAAqC;AACrC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,uDAAqC;AACrC,sDAAoC;AACpC,mEAAiD;AACjD,8DAA4C;AAC5C,mDAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-gate.js","sourceRoot":"","sources":["../../src/browser/workspace-gate.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF
|
|
1
|
+
{"version":3,"file":"workspace-gate.js","sourceRoot":"","sources":["../../src/browser/workspace-gate.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAIlF;;;;;;;;;GASG;AACH,2BAAkC,gBAAkC;IACjE,MAAM,KAAK,GAAG,gBAAgB,CAAC,WAAW,EAAE,CAAC;IAC7C,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE;QAChC,MAAM,UAAU,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE;YACnE,IAAI,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3C,UAAU,CAAC,OAAO,EAAE,CAAC;gBACrB,OAAO,EAAE,CAAC;YACb,CAAC;QACJ,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
|
-
import type { DataClientProtocol, Project, ProjectsChangedEvent, TransferDiagnostic, TransferDocumentSavedEvent, TransferDocumentUpdatedEvent, TransferElement } from '@hydranium/protocol';
|
|
9
|
+
import type { DataClientProtocol, Project, ProjectsChangedEvent, TransferDiagnostic, TransferDocumentDeletedEvent, TransferDocumentDirtyChangedEvent, TransferDocumentSavedEvent, TransferDocumentsBuiltEvent, TransferDocumentUpdatedEvent, TransferElement } from '@hydranium/protocol';
|
|
10
10
|
import { Emitter, type Event } from '@theia/core';
|
|
11
11
|
/**
|
|
12
12
|
* Default {@link DataClientProtocol} implementation for a Theia frontend:
|
|
@@ -30,11 +30,23 @@ export declare class EmitterDataClient<TTransfer extends TransferElement, TDiagn
|
|
|
30
30
|
protected readonly onDocumentSavedEmitter: Emitter<TransferDocumentSavedEvent<TTransfer, TDiagnostic>>;
|
|
31
31
|
/** Fires for each inbound {@link onDocumentSaved} notification. */
|
|
32
32
|
readonly onDidSaveDocument: Event<TransferDocumentSavedEvent<TTransfer, TDiagnostic>>;
|
|
33
|
+
protected readonly onDocumentDirtyChangedEmitter: Emitter<TransferDocumentDirtyChangedEvent>;
|
|
34
|
+
/** Fires for each inbound {@link onDocumentDirtyChanged} notification. */
|
|
35
|
+
readonly onDidChangeDocumentDirty: Event<TransferDocumentDirtyChangedEvent>;
|
|
36
|
+
protected readonly onDocumentDeletedEmitter: Emitter<TransferDocumentDeletedEvent>;
|
|
37
|
+
/** Fires for each inbound {@link onDocumentDeleted} notification. */
|
|
38
|
+
readonly onDidDeleteDocument: Event<TransferDocumentDeletedEvent>;
|
|
39
|
+
protected readonly onDocumentsBuiltEmitter: Emitter<TransferDocumentsBuiltEvent>;
|
|
40
|
+
/** Fires for each inbound {@link onDocumentsBuilt} notification. */
|
|
41
|
+
readonly onDidBuildDocuments: Event<TransferDocumentsBuiltEvent>;
|
|
33
42
|
protected readonly onProjectsChangedEmitter: Emitter<ProjectsChangedEvent<TProject>>;
|
|
34
43
|
/** Fires for each inbound {@link onProjectsChanged} notification. */
|
|
35
44
|
readonly onDidChangeProjects: Event<ProjectsChangedEvent<TProject>>;
|
|
36
45
|
onDocumentUpdated(event: TransferDocumentUpdatedEvent<TTransfer, TDiagnostic>): void;
|
|
37
46
|
onDocumentSaved(event: TransferDocumentSavedEvent<TTransfer, TDiagnostic>): void;
|
|
47
|
+
onDocumentDirtyChanged(event: TransferDocumentDirtyChangedEvent): void;
|
|
48
|
+
onDocumentDeleted(event: TransferDocumentDeletedEvent): void;
|
|
49
|
+
onDocumentsBuilt(event: TransferDocumentsBuiltEvent): void;
|
|
38
50
|
onProjectsChanged(event: ProjectsChangedEvent<TProject>): void;
|
|
39
51
|
}
|
|
40
52
|
//# sourceMappingURL=emitter-data-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter-data-client.d.ts","sourceRoot":"","sources":["../../src/common/emitter-data-client.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EACT,kBAAkB,EAClB,OAAO,EACP,oBAAoB,EACpB,kBAAkB,EAClB,0BAA0B,EAC1B,4BAA4B,EAC5B,eAAe,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAiB,CAC3B,SAAS,SAAS,eAAe,EACjC,WAAW,SAAS,kBAAkB,GAAG,kBAAkB,EAC3D,QAAQ,SAAS,OAAO,GAAG,OAAO,CACnC,YAAW,kBAAkB,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,wBAAwB,gEAAuE;IAClH,qEAAqE;IACrE,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,4BAA4B,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAuC;IAEhI,SAAS,CAAC,QAAQ,CAAC,sBAAsB,8DAAqE;IAC9G,mEAAmE;IACnE,QAAQ,CAAC,iBAAiB,EAAE,KAAK,CAAC,0BAA0B,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAqC;IAE1H,SAAS,CAAC,QAAQ,CAAC,wBAAwB,0CAAiD;IAC5F,qEAAqE;IACrE,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAuC;IAE1G,iBAAiB,CAAC,KAAK,EAAE,4BAA4B,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"emitter-data-client.d.ts","sourceRoot":"","sources":["../../src/common/emitter-data-client.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EACT,kBAAkB,EAClB,OAAO,EACP,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,iCAAiC,EACjC,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,eAAe,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAiB,CAC3B,SAAS,SAAS,eAAe,EACjC,WAAW,SAAS,kBAAkB,GAAG,kBAAkB,EAC3D,QAAQ,SAAS,OAAO,GAAG,OAAO,CACnC,YAAW,kBAAkB,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,wBAAwB,gEAAuE;IAClH,qEAAqE;IACrE,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,4BAA4B,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAuC;IAEhI,SAAS,CAAC,QAAQ,CAAC,sBAAsB,8DAAqE;IAC9G,mEAAmE;IACnE,QAAQ,CAAC,iBAAiB,EAAE,KAAK,CAAC,0BAA0B,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAqC;IAE1H,SAAS,CAAC,QAAQ,CAAC,6BAA6B,6CAAoD;IACpG,0EAA0E;IAC1E,QAAQ,CAAC,wBAAwB,EAAE,KAAK,CAAC,iCAAiC,CAAC,CAA4C;IAEvH,SAAS,CAAC,QAAQ,CAAC,wBAAwB,wCAA+C;IAC1F,qEAAqE;IACrE,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,4BAA4B,CAAC,CAAuC;IAExG,SAAS,CAAC,QAAQ,CAAC,uBAAuB,uCAA8C;IACxF,oEAAoE;IACpE,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAsC;IAEtG,SAAS,CAAC,QAAQ,CAAC,wBAAwB,0CAAiD;IAC5F,qEAAqE;IACrE,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,CAAuC;IAE1G,iBAAiB,CAAC,KAAK,EAAE,4BAA4B,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,IAAI,CAEnF;IAED,eAAe,CAAC,KAAK,EAAE,0BAA0B,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,IAAI,CAE/E;IAED,sBAAsB,CAAC,KAAK,EAAE,iCAAiC,GAAG,IAAI,CAErE;IAED,iBAAiB,CAAC,KAAK,EAAE,4BAA4B,GAAG,IAAI,CAE3D;IAED,gBAAgB,CAAC,KAAK,EAAE,2BAA2B,GAAG,IAAI,CAEzD;IAED,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,IAAI,CAE7D;CACH"}
|
|
@@ -32,6 +32,15 @@ class EmitterDataClient {
|
|
|
32
32
|
onDocumentSavedEmitter = new core_1.Emitter();
|
|
33
33
|
/** Fires for each inbound {@link onDocumentSaved} notification. */
|
|
34
34
|
onDidSaveDocument = this.onDocumentSavedEmitter.event;
|
|
35
|
+
onDocumentDirtyChangedEmitter = new core_1.Emitter();
|
|
36
|
+
/** Fires for each inbound {@link onDocumentDirtyChanged} notification. */
|
|
37
|
+
onDidChangeDocumentDirty = this.onDocumentDirtyChangedEmitter.event;
|
|
38
|
+
onDocumentDeletedEmitter = new core_1.Emitter();
|
|
39
|
+
/** Fires for each inbound {@link onDocumentDeleted} notification. */
|
|
40
|
+
onDidDeleteDocument = this.onDocumentDeletedEmitter.event;
|
|
41
|
+
onDocumentsBuiltEmitter = new core_1.Emitter();
|
|
42
|
+
/** Fires for each inbound {@link onDocumentsBuilt} notification. */
|
|
43
|
+
onDidBuildDocuments = this.onDocumentsBuiltEmitter.event;
|
|
35
44
|
onProjectsChangedEmitter = new core_1.Emitter();
|
|
36
45
|
/** Fires for each inbound {@link onProjectsChanged} notification. */
|
|
37
46
|
onDidChangeProjects = this.onProjectsChangedEmitter.event;
|
|
@@ -41,6 +50,15 @@ class EmitterDataClient {
|
|
|
41
50
|
onDocumentSaved(event) {
|
|
42
51
|
this.onDocumentSavedEmitter.fire(event);
|
|
43
52
|
}
|
|
53
|
+
onDocumentDirtyChanged(event) {
|
|
54
|
+
this.onDocumentDirtyChangedEmitter.fire(event);
|
|
55
|
+
}
|
|
56
|
+
onDocumentDeleted(event) {
|
|
57
|
+
this.onDocumentDeletedEmitter.fire(event);
|
|
58
|
+
}
|
|
59
|
+
onDocumentsBuilt(event) {
|
|
60
|
+
this.onDocumentsBuiltEmitter.fire(event);
|
|
61
|
+
}
|
|
44
62
|
onProjectsChanged(event) {
|
|
45
63
|
this.onProjectsChangedEmitter.fire(event);
|
|
46
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter-data-client.js","sourceRoot":"","sources":["../../src/common/emitter-data-client.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;
|
|
1
|
+
{"version":3,"file":"emitter-data-client.js","sourceRoot":"","sources":["../../src/common/emitter-data-client.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAclF,sCAAkD;AAElD;;;;;;;;;;;;;;GAcG;AACH;IAKsB,wBAAwB,GAAG,IAAI,cAAO,EAAwD,CAAC;IAClH,qEAAqE;IAC5D,mBAAmB,GAAgE,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC;IAE7G,sBAAsB,GAAG,IAAI,cAAO,EAAsD,CAAC;IAC9G,mEAAmE;IAC1D,iBAAiB,GAA8D,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC;IAEvG,6BAA6B,GAAG,IAAI,cAAO,EAAqC,CAAC;IACpG,0EAA0E;IACjE,wBAAwB,GAA6C,IAAI,CAAC,6BAA6B,CAAC,KAAK,CAAC;IAEpG,wBAAwB,GAAG,IAAI,cAAO,EAAgC,CAAC;IAC1F,qEAAqE;IAC5D,mBAAmB,GAAwC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC;IAErF,uBAAuB,GAAG,IAAI,cAAO,EAA+B,CAAC;IACxF,oEAAoE;IAC3D,mBAAmB,GAAuC,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC;IAEnF,wBAAwB,GAAG,IAAI,cAAO,EAAkC,CAAC;IAC5F,qEAAqE;IAC5D,mBAAmB,GAA0C,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC;IAE1G,iBAAiB,CAAC,KAA2D;QAC1E,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,eAAe,CAAC,KAAyD;QACtE,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,sBAAsB,CAAC,KAAwC;QAC5D,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC;IAED,iBAAiB,CAAC,KAAmC;QAClD,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,gBAAgB,CAAC,KAAkC;QAChD,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,iBAAiB,CAAC,KAAqC;QACpD,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;CACH"}
|
|
@@ -24,11 +24,12 @@ import { ContainerModule, type interfaces } from '@theia/core/shared/inversify';
|
|
|
24
24
|
*
|
|
25
25
|
* **More than one handler is the normal case, not an exotic one.** Theia keys a
|
|
26
26
|
* frontend channel by its service path and refuses a second channel on a path
|
|
27
|
-
* already open, so every frontend abstraction reaching the data head
|
|
28
|
-
* own path and therefore its own handler
|
|
29
|
-
* Theia `AbstractDataServiceFrontend` is exactly that shape. They still forward
|
|
27
|
+
* already open, so every frontend abstraction reaching the data head on its own
|
|
28
|
+
* channel needs its own path and therefore its own handler. They still forward
|
|
30
29
|
* to the SAME data server: the path distinguishes the channel, the shared
|
|
31
|
-
* `portCommand` names the one process behind it.
|
|
30
|
+
* `portCommand` names the one process behind it. Several participants over ONE
|
|
31
|
+
* channel need no second handler — that is what `DataConnection`'s sessions are
|
|
32
|
+
* for, and it is the cheaper arrangement.
|
|
32
33
|
*/
|
|
33
34
|
export declare function createDataServerConnectionContainerModule(...handlerClasses: interfaces.Newable<ConnectionHandler>[]): ContainerModule;
|
|
34
35
|
//# sourceMappingURL=connection-container-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-container-module.d.ts","sourceRoot":"","sources":["../../src/node/connection-container-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAEhF
|
|
1
|
+
{"version":3,"file":"connection-container-module.d.ts","sourceRoot":"","sources":["../../src/node/connection-container-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,yCAAyC,CAAC,GAAG,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,GAAG,eAAe,CAerI"}
|
|
@@ -28,11 +28,12 @@ const inversify_1 = require("@theia/core/shared/inversify");
|
|
|
28
28
|
*
|
|
29
29
|
* **More than one handler is the normal case, not an exotic one.** Theia keys a
|
|
30
30
|
* frontend channel by its service path and refuses a second channel on a path
|
|
31
|
-
* already open, so every frontend abstraction reaching the data head
|
|
32
|
-
* own path and therefore its own handler
|
|
33
|
-
* Theia `AbstractDataServiceFrontend` is exactly that shape. They still forward
|
|
31
|
+
* already open, so every frontend abstraction reaching the data head on its own
|
|
32
|
+
* channel needs its own path and therefore its own handler. They still forward
|
|
34
33
|
* to the SAME data server: the path distinguishes the channel, the shared
|
|
35
|
-
* `portCommand` names the one process behind it.
|
|
34
|
+
* `portCommand` names the one process behind it. Several participants over ONE
|
|
35
|
+
* channel need no second handler — that is what `DataConnection`'s sessions are
|
|
36
|
+
* for, and it is the cheaper arrangement.
|
|
36
37
|
*/
|
|
37
38
|
function createDataServerConnectionContainerModule(...handlerClasses) {
|
|
38
39
|
const frontendScopedConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-container-module.js","sourceRoot":"","sources":["../../src/node/connection-container-module.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF
|
|
1
|
+
{"version":3,"file":"connection-container-module.js","sourceRoot":"","sources":["../../src/node/connection-container-module.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,sCAAgD;AAChD,4GAAuG;AACvG,4DAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,mDAA0D,GAAG,cAAuD;IACjH,MAAM,8BAA8B,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;QAClF,KAAK,MAAM,YAAY,IAAI,cAAc,EAAE,CAAC;YACzC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;YAC/C,mEAAmE;YACnE,mEAAmE;YACnE,oEAAoE;YACpE,IAAI,CAAC,wBAAiB,CAAC;iBACnB,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;iBAC9D,gBAAgB,EAAE,CAAC;QAC1B,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;QAC/B,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
import { AbstractSocketForwardingConnectionHandler } from '@hydranium/client-theia/lib/node';
|
|
10
|
-
import { type Channel, type Disposable } from '@theia/core';
|
|
11
10
|
import type * as net from 'node:net';
|
|
12
11
|
/** Options for {@link DataServerConnectionHandler}. `servicePath` is the Theia
|
|
13
12
|
* service path the browser frontend opens a channel to; `portCommand` is the
|
|
@@ -25,6 +24,8 @@ export interface DataServerConnectionHandlerOptions {
|
|
|
25
24
|
* Defaults to the framework `DATA_SERVER_PORT_COMMAND`; override to match
|
|
26
25
|
* an adopter's established id. */
|
|
27
26
|
readonly portCommand?: string;
|
|
27
|
+
/** Name of the server in this handler's log lines. */
|
|
28
|
+
readonly serverName?: string;
|
|
28
29
|
readonly findPortTimeout?: number;
|
|
29
30
|
readonly findPortAttempts?: number;
|
|
30
31
|
readonly connectTimeoutMs?: number;
|
|
@@ -41,16 +42,15 @@ export interface DataServerConnectionHandlerOptions {
|
|
|
41
42
|
* Bridges a Theia browser-frontend channel to a data-server's TCP socket — the
|
|
42
43
|
* backend half of the data-server head's transport.
|
|
43
44
|
*
|
|
44
|
-
* The port
|
|
45
|
-
* on the cross-head
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* its own forwarder, so the data head carries no GLSP dependency. Sibling of
|
|
49
|
-
* `@hydranium/glsp-client-theia`'s `GlspServerConnectionHandler`, which
|
|
50
|
-
* subclasses the same base with `@eclipse-glsp`'s `SocketConnectionForwarder`.
|
|
45
|
+
* The port discovery, the buffer-and-replay race fix, the connect orchestration
|
|
46
|
+
* and the byte forwarder live on the cross-head
|
|
47
|
+
* {@link AbstractSocketForwardingConnectionHandler} base; this subclass supplies
|
|
48
|
+
* only the data-server defaults (service path / port command / log labels).
|
|
51
49
|
*/
|
|
52
50
|
export declare class DataServerConnectionHandler extends AbstractSocketForwardingConnectionHandler {
|
|
53
51
|
constructor(options?: DataServerConnectionHandlerOptions);
|
|
54
|
-
|
|
52
|
+
/** Logged only: the frontend port reports the connection, and a second
|
|
53
|
+
* notification would duplicate it. */
|
|
54
|
+
protected reportConnectFailure(): void;
|
|
55
55
|
}
|
|
56
56
|
//# sourceMappingURL=data-server-connection-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-server-connection-handler.d.ts","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,yCAAyC,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"data-server-connection-handler.d.ts","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,yCAAyC,EAAE,MAAM,kCAAkC,CAAC;AAG7F,OAAO,KAAK,KAAK,GAAG,MAAM,UAAU,CAAC;AAErC;;;;kBAIkB;AAClB,MAAM,WAAW,kCAAkC;IAChD;;;;yDAIqD;IACrD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;uCAEmC;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,sDAAsD;IACtD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;;;;GAQG;AACH,qBACa,2BAA4B,SAAQ,yCAAyC;IACvF,YAAyB,OAAO,GAAE,kCAAuC,EAWxE;IAED;2CACuC;IACvC,UAAmB,oBAAoB,IAAI,IAAI,CAAG;CACpD"}
|
|
@@ -24,18 +24,14 @@ exports.DataServerConnectionHandler = void 0;
|
|
|
24
24
|
const node_1 = require("@hydranium/client-theia/lib/node");
|
|
25
25
|
const protocol_1 = require("@hydranium/protocol");
|
|
26
26
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
27
|
-
const socket_channel_forwarder_1 = require("./socket-channel-forwarder");
|
|
28
27
|
/**
|
|
29
28
|
* Bridges a Theia browser-frontend channel to a data-server's TCP socket — the
|
|
30
29
|
* backend half of the data-server head's transport.
|
|
31
30
|
*
|
|
32
|
-
* The port
|
|
33
|
-
* on the cross-head
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* its own forwarder, so the data head carries no GLSP dependency. Sibling of
|
|
37
|
-
* `@hydranium/glsp-client-theia`'s `GlspServerConnectionHandler`, which
|
|
38
|
-
* subclasses the same base with `@eclipse-glsp`'s `SocketConnectionForwarder`.
|
|
31
|
+
* The port discovery, the buffer-and-replay race fix, the connect orchestration
|
|
32
|
+
* and the byte forwarder live on the cross-head
|
|
33
|
+
* {@link AbstractSocketForwardingConnectionHandler} base; this subclass supplies
|
|
34
|
+
* only the data-server defaults (service path / port command / log labels).
|
|
39
35
|
*/
|
|
40
36
|
let DataServerConnectionHandler = class DataServerConnectionHandler extends node_1.AbstractSocketForwardingConnectionHandler {
|
|
41
37
|
constructor(options = {}) {
|
|
@@ -43,16 +39,16 @@ let DataServerConnectionHandler = class DataServerConnectionHandler extends node
|
|
|
43
39
|
path: options.servicePath ?? protocol_1.DATA_SERVER_PATH,
|
|
44
40
|
portCommand: options.portCommand ?? protocol_1.DATA_SERVER_PORT_COMMAND,
|
|
45
41
|
logComponent: 'DataServer',
|
|
46
|
-
serverName: '
|
|
42
|
+
serverName: options.serverName ?? 'Data Server',
|
|
47
43
|
findPortTimeout: options.findPortTimeout,
|
|
48
44
|
findPortAttempts: options.findPortAttempts,
|
|
49
45
|
connectTimeoutMs: options.connectTimeoutMs,
|
|
50
46
|
onSocketCreated: options.onSocketCreated
|
|
51
47
|
});
|
|
52
48
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
49
|
+
/** Logged only: the frontend port reports the connection, and a second
|
|
50
|
+
* notification would duplicate it. */
|
|
51
|
+
reportConnectFailure() { }
|
|
56
52
|
};
|
|
57
53
|
exports.DataServerConnectionHandler = DataServerConnectionHandler;
|
|
58
54
|
exports.DataServerConnectionHandler = DataServerConnectionHandler = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-server-connection-handler.js","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAElF,2DAA6F;AAC7F,kDAAiF;
|
|
1
|
+
{"version":3,"file":"data-server-connection-handler.js","sourceRoot":"","sources":["../../src/node/data-server-connection-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAElF,2DAA6F;AAC7F,kDAAiF;AACjF,4DAAqE;AAkCrE;;;;;;;;GAQG;AAEI,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,gDAAyC;IACvF,YAAyB,UAA8C,EAAE;QACtE,KAAK,CAAC;YACH,IAAI,EAAE,OAAO,CAAC,WAAW,IAAI,2BAAgB;YAC7C,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,mCAAwB;YAC5D,YAAY,EAAE,YAAY;YAC1B,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,aAAa;YAC/C,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;YAC1C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;YAC1C,eAAe,EAAE,OAAO,CAAC,eAAe;SAC1C,CAAC,CAAC;IACN,CAAC;IAED;2CACuC;IACpB,oBAAoB,KAAU,CAAC;CACpD,CAAA;;sCAjBY,2BAA2B;IADvC,IAAA,sBAAU,GAAE;IAEG,WAAA,IAAA,qBAAS,GAAE,CAAA;;GADd,2BAA2B,CAiBvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-diagnostics-server.d.ts","sourceRoot":"","sources":["../../src/node/host-diagnostics-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAEJ,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAChC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAc,MAAM,8BAA8B,CAAC;AAE3E;;;;;;GAMG;AACH,qBACa,qBAAsB,YAAW,uBAAuB;IAC5D,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"host-diagnostics-server.d.ts","sourceRoot":"","sources":["../../src/node/host-diagnostics-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAEJ,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAChC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAc,MAAM,8BAA8B,CAAC;AAE3E;;;;;;GAMG;AACH,qBACa,qBAAsB,YAAW,uBAAuB;IAC5D,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAI5D;IAEK,qBAAqB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAI5E;CACH;AAED;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,IAAI,eAAe,CAOpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-diagnostics-server.js","sourceRoot":"","sources":["../../src/node/host-diagnostics-server.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF
|
|
1
|
+
{"version":3,"file":"host-diagnostics-server.js","sourceRoot":"","sources":["../../src/node/host-diagnostics-server.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;AAElF,mDAAuF;AACvF,kDAK6B;AAC7B,sCAAsE;AACtE,4DAA2E;AAE3E;;;;;;GAMG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAC/B,KAAK,CAAC,aAAa,CAAC,IAAuB;QACxC,MAAM,QAAQ,GAAG,IAAA,0BAAmB,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC;QAC/G,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO,QAAQ,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,IAA+B;QACxD,MAAM,QAAQ,GAAG,IAAA,6BAAsB,EAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS,EAAE,cAAc,CAAC,CAAC;QACjG,OAAO,CAAC,IAAI,CAAC,iCAAiC,QAAQ,EAAE,CAAC,CAAC;QAC1D,OAAO,QAAQ,CAAC;IACnB,CAAC;CACH,CAAA;;gCAZY,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CAYjC;AAED;;;;;;;GAOG;AACH;IACG,OAAO,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;QAC/B,IAAI,CAAC,qBAAqB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACxD,IAAI,CAAC,wBAAiB,CAAC;aACnB,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,2BAAoB,CAAC,gCAAqB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC;aAC9H,gBAAgB,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;AACN,CAAC"}
|
package/lib/node/index.d.ts
CHANGED
package/lib/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC"}
|
package/lib/node/index.js
CHANGED
|
@@ -25,5 +25,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
__exportStar(require("./connection-container-module"), exports);
|
|
26
26
|
__exportStar(require("./data-server-connection-handler"), exports);
|
|
27
27
|
__exportStar(require("./host-diagnostics-server"), exports);
|
|
28
|
-
__exportStar(require("./socket-channel-forwarder"), exports);
|
|
29
28
|
//# sourceMappingURL=index.js.map
|
package/lib/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,gEAA8C;AAC9C,mEAAiD;AACjD,4DAA0C
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,gEAA8C;AAC9C,mEAAiD;AACjD,4DAA0C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/data-client-theia",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.193",
|
|
4
4
|
"description": "Theia-coupled client primitives for the hydranium data-server protocol head; companion of @hydranium/data-server. Bridges framework typed errors (e.g. ConflictError) across Theia's RPC boundary so their code + data survive the wire.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hydranium",
|
|
@@ -13,16 +13,23 @@
|
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://github.com/eclipse-emfcloud/hydranium/issues"
|
|
15
15
|
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": {
|
|
18
|
+
"name": "Hydranium Team"
|
|
19
|
+
},
|
|
16
20
|
"repository": {
|
|
17
21
|
"type": "git",
|
|
18
22
|
"url": "https://github.com/eclipse-emfcloud/hydranium.git",
|
|
19
23
|
"directory": "packages/data-client-theia"
|
|
20
24
|
},
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
+
"files": [
|
|
26
|
+
"lib",
|
|
27
|
+
"src",
|
|
28
|
+
"!lib/**/*.tsbuildinfo"
|
|
29
|
+
],
|
|
25
30
|
"sideEffects": false,
|
|
31
|
+
"main": "lib/index.js",
|
|
32
|
+
"types": "lib/index.d.ts",
|
|
26
33
|
"exports": {
|
|
27
34
|
".": {
|
|
28
35
|
"types": "./lib/index.d.ts",
|
|
@@ -53,49 +60,43 @@
|
|
|
53
60
|
"default": "./lib/node/index.js"
|
|
54
61
|
}
|
|
55
62
|
},
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"lib",
|
|
60
|
-
"src",
|
|
61
|
-
"!lib/**/*.tsbuildinfo"
|
|
62
|
-
],
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
},
|
|
63
66
|
"scripts": {
|
|
64
67
|
"build": "tsc -b",
|
|
65
68
|
"clean": "rimraf lib tsconfig.tsbuildinfo",
|
|
66
|
-
"lint": "
|
|
69
|
+
"lint": "oxlint --format stylish --config ../../oxlint.config.cjs src test --max-warnings 0",
|
|
67
70
|
"prepack": "node -e \"const m=require('./package.json'),fs=require('node:fs');const missing=[m.main,...Object.values(m.bin||{})].filter(entry=>entry&&!fs.existsSync(entry));if(missing.length){console.error('prepack '+m.name+': not built ('+missing.join(', ')+' missing). Run the build before packing: a files entry that matches nothing is skipped silently, so the tarball would ship src only.');process.exit(1);}\"",
|
|
68
71
|
"test": "npm run typecheck:test && vitest run",
|
|
69
72
|
"typecheck:test": "tsc --noEmit -p tsconfig.test.json",
|
|
70
73
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
71
74
|
},
|
|
72
75
|
"devDependencies": {
|
|
73
|
-
"@hydranium/client-theia": "1.0.0-next.
|
|
74
|
-
"@hydranium/core": "1.0.0-next.
|
|
75
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
76
|
+
"@hydranium/client-theia": "1.0.0-next.193",
|
|
77
|
+
"@hydranium/core": "1.0.0-next.193",
|
|
78
|
+
"@hydranium/protocol": "1.0.0-next.193",
|
|
76
79
|
"@theia/core": "^1.70.0",
|
|
77
80
|
"@theia/workspace": "^1.70.0",
|
|
78
81
|
"@types/node": "^22.0.0",
|
|
79
82
|
"inversify": "6.2.2",
|
|
80
83
|
"reflect-metadata": "0.2.2",
|
|
81
84
|
"rimraf": "^5.0.0",
|
|
82
|
-
"typescript": "^
|
|
85
|
+
"typescript": "^7.0.2",
|
|
83
86
|
"vscode-jsonrpc": "9.0.1"
|
|
84
87
|
},
|
|
85
88
|
"peerDependencies": {
|
|
86
|
-
"@hydranium/client-theia": "1.0.0-next.
|
|
87
|
-
"@hydranium/core": "1.0.0-next.
|
|
88
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
89
|
+
"@hydranium/client-theia": "1.0.0-next.193",
|
|
90
|
+
"@hydranium/core": "1.0.0-next.193",
|
|
91
|
+
"@hydranium/protocol": "1.0.0-next.193",
|
|
89
92
|
"@theia/core": "^1.70.0",
|
|
90
93
|
"@theia/workspace": "^1.70.0",
|
|
91
94
|
"inversify": "^6.0.0",
|
|
92
|
-
"vscode-jsonrpc": "
|
|
95
|
+
"vscode-jsonrpc": "9.0.1"
|
|
93
96
|
},
|
|
94
97
|
"engines": {
|
|
95
98
|
"node": ">=22.13"
|
|
96
99
|
},
|
|
97
|
-
"
|
|
98
|
-
"access": "public"
|
|
99
|
-
},
|
|
100
|
+
"//peerDependencies": "`vscode-jsonrpc` is EXACT rather than a range, because it is one link of an atomic chain with no independently movable link: `vscode-languageserver-protocol` depends on it at exactly 9.0.1, so any other value an adopter supplies is a SECOND physical copy rather than an upgrade. This wire stack breaks on copy identity rather than on structure — `ParameterStructures.auto` is a singleton compared by `===` in connection.js, so a request type built by one copy and sent over a connection owned by the other throws `Unknown parameter structure auto`. A caret or union range was rejected because npm then resolves a `vscode-jsonrpc@8.2.0` tree SILENTLY, with no diagnostic at all, and the failure surfaces only later at server init. Exact does not fail the install either — npm downgrades an unsatisfiable peer to a warning — but it is a NAMED ERESOLVE warning printing the required version beside the found one, and a hard error for anyone installing with `--strict-peer-deps`. It does NOT prevent a NESTED copy — `@eclipse-glsp/*` carries its own exact `vscode-jsonrpc@8.2.0` dependency and root `overrides` do not ship — so a consumer of the GLSP head must pin the chain in its own manifest, and docs/adopting/requirements.md carries the block to paste.",
|
|
100
101
|
"//prepack": "The publish guard, and it deliberately is NOT a `prepare`: npm runs a workspace `prepare` BEFORE the root `postinstall` that applies patches/vscode-jsonrpc+9.0.1.patch, so building there fails on a cold clone and npm rolls the entire install back. `prepack` runs only when a tarball is made (`npm pack`, `npm publish`) and never on install, so it cannot break the install it has no business touching. It FAILS rather than rebuilds, because the rebuild is exactly the part that ordering defeats. What it defends against: `files` lists `lib`, `lib` is gitignored, and a `files` entry matching nothing is skipped SILENTLY — so `npm publish` from an unbuilt tree emits a tarball of `src` and nothing else, with no error."
|
|
101
102
|
}
|
|
@@ -199,8 +199,8 @@ export interface ChannelConnectionHandle {
|
|
|
199
199
|
/**
|
|
200
200
|
* The current connection. Read it per use rather than caching it: after a
|
|
201
201
|
* reconnect this returns a NEW promise, and a cached one resolves to the
|
|
202
|
-
* dead connection forever. The same reasoning makes
|
|
203
|
-
*
|
|
202
|
+
* dead connection forever. The same reasoning makes `RpcConnection` rebuild
|
|
203
|
+
* its proxy per generation rather than hold one.
|
|
204
204
|
*/
|
|
205
205
|
readonly current: Promise<MessageConnection>;
|
|
206
206
|
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
|
|
10
|
+
import { ChannelLogger, ConnectionReporter, type ConnectionAttempt, type ConnectionTarget } from '@hydranium/client-theia/lib/browser';
|
|
11
|
+
import {
|
|
12
|
+
DATA_SERVER_CONNECT_FAILED,
|
|
13
|
+
DATA_SERVER_NOT_READY,
|
|
14
|
+
renderFrameworkMessage,
|
|
15
|
+
type DataPort,
|
|
16
|
+
type ResolvedMessage,
|
|
17
|
+
type RpcConnectionLifecycle
|
|
18
|
+
} from '@hydranium/protocol';
|
|
19
|
+
import { Emitter, MessageService, nls, type Event } from '@theia/core';
|
|
20
|
+
import { type ServiceConnectionProvider } from '@theia/core/lib/browser';
|
|
21
|
+
import { RemoteConnectionProvider } from '@theia/core/lib/browser/messaging/service-connection-provider';
|
|
22
|
+
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
23
|
+
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
24
|
+
import type { MessageConnection } from 'vscode-jsonrpc';
|
|
25
|
+
import { type ChannelConnectionHandle, openChannelConnection } from './channel-connection';
|
|
26
|
+
import { whenWorkspaceOpen } from './workspace-gate';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A {@link DataPort} over a Theia frontend channel.
|
|
30
|
+
*
|
|
31
|
+
* Subclasses supply {@link servicePath}; everything above the port —
|
|
32
|
+
* `DataConnection`, its sessions, and whatever model a widget drives — is
|
|
33
|
+
* host-neutral and shared with the VS Code and browser shells.
|
|
34
|
+
*
|
|
35
|
+
* Bind one per service path and in singleton scope. Theia keys a frontend
|
|
36
|
+
* channel by its path and refuses a second on a path already open, and the
|
|
37
|
+
* throw escapes the `openChannelConnection` the loser is awaiting, leaving that
|
|
38
|
+
* promise unsettled rather than rejected.
|
|
39
|
+
*/
|
|
40
|
+
@injectable()
|
|
41
|
+
export abstract class ChannelDataPort implements DataPort {
|
|
42
|
+
@inject(RemoteConnectionProvider) protected readonly connectionProvider!: ServiceConnectionProvider;
|
|
43
|
+
@inject(WorkspaceService) protected readonly workspaceService!: WorkspaceService;
|
|
44
|
+
@inject(MessageService) protected readonly messageService!: MessageService;
|
|
45
|
+
@inject(ConnectionReporter) protected readonly connectionReporter!: ConnectionReporter;
|
|
46
|
+
@inject(ChannelLogger) protected readonly logger!: ChannelLogger;
|
|
47
|
+
|
|
48
|
+
/** Frontend service path the backend forwarder for this head is registered under. */
|
|
49
|
+
protected abstract readonly servicePath: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Re-open the channel when the current connection is lost. Default `true` —
|
|
53
|
+
* re-opening is the only thing that recovers a restarted language server,
|
|
54
|
+
* which binds new ephemeral ports. Turn it off for a frontend that tears
|
|
55
|
+
* itself down on transport loss instead.
|
|
56
|
+
*/
|
|
57
|
+
protected readonly reconnectOnConnectionLoss: boolean = true;
|
|
58
|
+
|
|
59
|
+
protected readonly disposeEmitter = new Emitter<void>();
|
|
60
|
+
readonly onDispose: Event<void> = this.disposeEmitter.event;
|
|
61
|
+
|
|
62
|
+
protected handle?: ChannelConnectionHandle;
|
|
63
|
+
|
|
64
|
+
/** How long a connection may take before it is reported as failed; it keeps trying after. */
|
|
65
|
+
protected readonly connectFailureNoticeMs: number = 30_000;
|
|
66
|
+
protected attempt?: ConnectionAttempt;
|
|
67
|
+
protected attemptTimer?: ReturnType<typeof setTimeout>;
|
|
68
|
+
/** Set once {@link connectionLifecycle} reports, which then owns the connection failures. */
|
|
69
|
+
protected reportsConnections = false;
|
|
70
|
+
|
|
71
|
+
/** Reports each connection generation through the {@link ConnectionReporter}. */
|
|
72
|
+
readonly connectionLifecycle: RpcConnectionLifecycle = {
|
|
73
|
+
onConnecting: () => {
|
|
74
|
+
this.reportsConnections = true;
|
|
75
|
+
this.settleAttempt();
|
|
76
|
+
const attempt = this.connectionReporter.connecting(this.connectionTarget);
|
|
77
|
+
this.attempt = attempt;
|
|
78
|
+
this.attemptTimer = setTimeout(() => {
|
|
79
|
+
attempt.failed(this.connectTimeoutMessage());
|
|
80
|
+
// The generation keeps waiting; a follow-up attempt reports it connecting.
|
|
81
|
+
this.attempt = this.connectionReporter.connecting(this.connectionTarget);
|
|
82
|
+
}, this.connectFailureNoticeMs);
|
|
83
|
+
},
|
|
84
|
+
onReady: () => this.settleAttempt(attempt => attempt.connected()),
|
|
85
|
+
onFailed: () => this.settleAttempt(attempt => attempt.failed(this.unreachableMessage()))
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Open the workspace-gated channel and hand back its listening connection.
|
|
90
|
+
*
|
|
91
|
+
* Gated because the backend forwarder discovers the head's port by executing
|
|
92
|
+
* a command the language server answers, and the language server only
|
|
93
|
+
* launches once there is a workspace to launch it for. Asking earlier polls
|
|
94
|
+
* a command nobody has registered.
|
|
95
|
+
*/
|
|
96
|
+
connect(): Promise<MessageConnection> {
|
|
97
|
+
// Read per call rather than cached: `current` is repointed at a fresh
|
|
98
|
+
// promise every time the channel is re-opened, so reading through the
|
|
99
|
+
// handle is what makes a later generation reach the live server.
|
|
100
|
+
if (!this.handle) {
|
|
101
|
+
this.handle = openChannelConnection(this.connectionProvider, this.servicePath, {
|
|
102
|
+
whenReady: whenWorkspaceOpen(this.workspaceService),
|
|
103
|
+
reconnect: this.reconnectOnConnectionLoss
|
|
104
|
+
});
|
|
105
|
+
// A relaunched server binds new ephemeral ports; the handle re-opens
|
|
106
|
+
// and the forwarder rediscovers, but `DataConnection` caches its
|
|
107
|
+
// generation and would go on addressing the dead one. Its signal to
|
|
108
|
+
// drop that generation is this event.
|
|
109
|
+
this.handle.onDidLoseConnection(() => this.disposeEmitter.fire(undefined));
|
|
110
|
+
}
|
|
111
|
+
return this.handle.current;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Surface a transport or write failure as a Theia notification.
|
|
116
|
+
*
|
|
117
|
+
* Swallowing it is the failure this exists to prevent: a dead connection and
|
|
118
|
+
* an empty document are indistinguishable in a widget.
|
|
119
|
+
*
|
|
120
|
+
* `reported` is already a complete sentence with the detail interpolated, so
|
|
121
|
+
* wrapping it in a sentence of the host's own would nest one owner's clause
|
|
122
|
+
* inside another's and leave no translator in control of the whole.
|
|
123
|
+
*/
|
|
124
|
+
reportError(_error: unknown, reported: ResolvedMessage): void {
|
|
125
|
+
const connectionFailure = reported.code === DATA_SERVER_CONNECT_FAILED.code || reported.code === DATA_SERVER_NOT_READY.code;
|
|
126
|
+
const message = renderFrameworkMessage(reported, nls.localization?.translations);
|
|
127
|
+
if (connectionFailure && this.reportsConnections) {
|
|
128
|
+
// The reporter shows the failure without its detail, so it is kept here.
|
|
129
|
+
this.logger.warn(message);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
this.messageService.error(message);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** End the current attempt through `settle`, or cancel it. */
|
|
136
|
+
protected settleAttempt(settle: (attempt: ConnectionAttempt) => void = attempt => attempt.cancelled()): void {
|
|
137
|
+
clearTimeout(this.attemptTimer);
|
|
138
|
+
const attempt = this.attempt;
|
|
139
|
+
this.attempt = undefined;
|
|
140
|
+
if (attempt) {
|
|
141
|
+
settle(attempt);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
protected get connectionTarget(): ConnectionTarget {
|
|
146
|
+
return (this.cachedConnectionTarget ??= {
|
|
147
|
+
connectingMessage: nls.localize('hydranium/data-client-theia/data-server-connecting', 'Connecting to the data server…'),
|
|
148
|
+
connectedMessage: nls.localize('hydranium/data-client-theia/data-server-connected', 'Connected to the data server.')
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/** One object per port: the reporter keys what it has shown on it. */
|
|
152
|
+
protected cachedConnectionTarget?: ConnectionTarget;
|
|
153
|
+
|
|
154
|
+
protected unreachableMessage(): string {
|
|
155
|
+
return nls.localize('hydranium/data-client-theia/data-server-unreachable', 'Could not connect to the data server.');
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
protected connectTimeoutMessage(): string {
|
|
159
|
+
return nls.localize(
|
|
160
|
+
'hydranium/data-client-theia/data-server-timeout',
|
|
161
|
+
'The data server did not answer within {0} seconds.',
|
|
162
|
+
String(Math.round(this.connectFailureNoticeMs / 1000))
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
dispose(): void {
|
|
167
|
+
this.settleAttempt();
|
|
168
|
+
this.handle?.dispose();
|
|
169
|
+
this.handle = undefined;
|
|
170
|
+
this.disposeEmitter.fire(undefined);
|
|
171
|
+
this.disposeEmitter.dispose();
|
|
172
|
+
}
|
|
173
|
+
}
|