@hydranium/protocol 1.0.0-next.23 → 1.0.0-next.232
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 +40 -3
- package/lib/abstract-logger.d.ts +5 -0
- package/lib/abstract-logger.d.ts.map +1 -1
- package/lib/abstract-logger.js +7 -0
- package/lib/abstract-logger.js.map +1 -1
- package/lib/client/data-connection.d.ts +236 -0
- package/lib/client/data-connection.d.ts.map +1 -0
- package/lib/client/data-connection.js +404 -0
- package/lib/client/data-connection.js.map +1 -0
- package/lib/client/data-events.d.ts +13 -1
- package/lib/client/data-events.d.ts.map +1 -1
- package/lib/client/data-events.js +21 -0
- package/lib/client/data-events.js.map +1 -1
- package/lib/client/data-port.d.ts +27 -22
- package/lib/client/data-port.d.ts.map +1 -1
- package/lib/client/data-session.d.ts +473 -81
- package/lib/client/data-session.d.ts.map +1 -1
- package/lib/client/data-session.js +743 -108
- package/lib/client/data-session.js.map +1 -1
- package/lib/client/index.d.ts +14 -9
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/index.js +14 -9
- package/lib/client/index.js.map +1 -1
- package/lib/client/message-relay.d.ts +9 -3
- package/lib/client/message-relay.d.ts.map +1 -1
- package/lib/client/message-relay.js +11 -5
- package/lib/client/message-relay.js.map +1 -1
- package/lib/client/post-message-transport.d.ts +64 -3
- package/lib/client/post-message-transport.d.ts.map +1 -1
- package/lib/client/post-message-transport.js +175 -1
- package/lib/client/post-message-transport.js.map +1 -1
- package/lib/client/rpc-connection.d.ts +157 -0
- package/lib/client/rpc-connection.d.ts.map +1 -0
- package/lib/client/rpc-connection.js +214 -0
- package/lib/client/rpc-connection.js.map +1 -0
- package/lib/client-ids.d.ts +45 -0
- package/lib/client-ids.d.ts.map +1 -0
- package/lib/client-ids.js +48 -0
- package/lib/client-ids.js.map +1 -0
- package/lib/clock.d.ts +38 -0
- package/lib/clock.d.ts.map +1 -1
- package/lib/clock.js +36 -1
- package/lib/clock.js.map +1 -1
- package/lib/console-logger.d.ts +23 -0
- package/lib/console-logger.d.ts.map +1 -0
- package/lib/console-logger.js +39 -0
- package/lib/console-logger.js.map +1 -0
- package/lib/data/data-protocol-methods.d.ts +4 -4
- package/lib/data/data-protocol-methods.d.ts.map +1 -1
- package/lib/data/data-protocol-methods.js +12 -1
- package/lib/data/data-protocol-methods.js.map +1 -1
- package/lib/data/data-server-protocol.d.ts +132 -41
- package/lib/data/data-server-protocol.d.ts.map +1 -1
- package/lib/data/events.d.ts +117 -21
- package/lib/data/events.d.ts.map +1 -1
- package/lib/data/requests.d.ts +69 -11
- package/lib/data/requests.d.ts.map +1 -1
- package/lib/debouncer.d.ts.map +1 -1
- package/lib/debouncer.js.map +1 -1
- package/lib/errors.d.ts +187 -29
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +270 -29
- package/lib/errors.js.map +1 -1
- package/lib/glsp-request-model-args.d.ts +16 -0
- package/lib/glsp-request-model-args.d.ts.map +1 -0
- package/lib/glsp-request-model-args.js +19 -0
- package/lib/glsp-request-model-args.js.map +1 -0
- package/lib/glsp-save-model-actions.d.ts +50 -0
- package/lib/glsp-save-model-actions.d.ts.map +1 -0
- package/lib/glsp-save-model-actions.js +28 -0
- package/lib/glsp-save-model-actions.js.map +1 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -1
- package/lib/latency-collector.d.ts +8 -4
- package/lib/latency-collector.d.ts.map +1 -1
- package/lib/latency-collector.js.map +1 -1
- package/lib/logger.d.ts +22 -1
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js +31 -3
- package/lib/logger.js.map +1 -1
- package/lib/messages/index.d.ts +30 -0
- package/lib/messages/index.d.ts.map +1 -0
- package/lib/messages/index.js +62 -0
- package/lib/messages/index.js.map +1 -0
- package/lib/messages/primitives.d.ts +188 -0
- package/lib/messages/primitives.d.ts.map +1 -0
- package/lib/messages/primitives.js +161 -0
- package/lib/messages/primitives.js.map +1 -0
- package/lib/model-server.d.ts +60 -13
- package/lib/model-server.d.ts.map +1 -1
- package/lib/model-server.js +4 -2
- package/lib/model-server.js.map +1 -1
- package/lib/model-service/base-version.d.ts +64 -0
- package/lib/model-service/base-version.d.ts.map +1 -0
- package/lib/model-service/base-version.js +43 -0
- package/lib/model-service/base-version.js.map +1 -0
- package/lib/model-service/index.d.ts +1 -1
- package/lib/model-service/index.d.ts.map +1 -1
- package/lib/model-service/index.js +4 -5
- package/lib/model-service/index.js.map +1 -1
- package/lib/model-service/reference-candidate.d.ts +5 -3
- package/lib/model-service/reference-candidate.d.ts.map +1 -1
- package/lib/{model-service/args.js → node/index.d.ts} +2 -3
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +29 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/process-memory.d.ts +66 -0
- package/lib/node/process-memory.d.ts.map +1 -0
- package/lib/node/process-memory.js +291 -0
- package/lib/node/process-memory.js.map +1 -0
- package/lib/noop-logger.d.ts.map +1 -1
- package/lib/noop-logger.js.map +1 -1
- package/lib/observable-value.js.map +1 -1
- package/lib/patch-merge.d.ts +35 -32
- package/lib/patch-merge.d.ts.map +1 -1
- package/lib/patch-merge.js +67 -23
- package/lib/patch-merge.js.map +1 -1
- package/lib/profile-session.d.ts +8 -4
- package/lib/profile-session.d.ts.map +1 -1
- package/lib/profile-session.js.map +1 -1
- package/lib/random-uuid.d.ts +14 -0
- package/lib/random-uuid.d.ts.map +1 -0
- package/lib/random-uuid.js +24 -0
- package/lib/random-uuid.js.map +1 -0
- package/lib/reconcile-write.d.ts +65 -0
- package/lib/reconcile-write.d.ts.map +1 -0
- package/lib/reconcile-write.js +67 -0
- package/lib/reconcile-write.js.map +1 -0
- package/lib/rpc/bind-rpc-methods.d.ts +33 -3
- package/lib/rpc/bind-rpc-methods.d.ts.map +1 -1
- package/lib/rpc/bind-rpc-methods.js +32 -3
- package/lib/rpc/bind-rpc-methods.js.map +1 -1
- package/lib/rpc/create-rpc-proxy.d.ts +10 -0
- package/lib/rpc/create-rpc-proxy.d.ts.map +1 -1
- package/lib/rpc/create-rpc-proxy.js +12 -2
- package/lib/rpc/create-rpc-proxy.js.map +1 -1
- package/lib/rpc/index.d.ts +1 -0
- package/lib/rpc/index.d.ts.map +1 -1
- package/lib/rpc/index.js +1 -0
- package/lib/rpc/index.js.map +1 -1
- package/lib/rpc/send-by-method-name.d.ts +76 -0
- package/lib/rpc/send-by-method-name.d.ts.map +1 -0
- package/lib/rpc/send-by-method-name.js +120 -0
- package/lib/rpc/send-by-method-name.js.map +1 -0
- package/lib/rpc/wire-prefix.js.map +1 -1
- package/lib/testing/catalogue-audit.d.ts +80 -0
- package/lib/testing/catalogue-audit.d.ts.map +1 -0
- package/lib/testing/catalogue-audit.js +94 -0
- package/lib/testing/catalogue-audit.js.map +1 -0
- package/lib/testing/data-doubles.d.ts +42 -15
- package/lib/testing/data-doubles.d.ts.map +1 -1
- package/lib/testing/data-doubles.js +58 -10
- package/lib/testing/data-doubles.js.map +1 -1
- package/lib/testing/fake-clock.d.ts +9 -1
- package/lib/testing/fake-clock.d.ts.map +1 -1
- package/lib/testing/fake-clock.js +54 -45
- package/lib/testing/fake-clock.js.map +1 -1
- package/lib/testing/index.d.ts +1 -0
- package/lib/testing/index.d.ts.map +1 -1
- package/lib/testing/index.js +5 -2
- package/lib/testing/index.js.map +1 -1
- package/lib/testing/node/duplex-connection.d.ts.map +1 -1
- package/lib/testing/node/duplex-connection.js +3 -2
- package/lib/testing/node/duplex-connection.js.map +1 -1
- package/lib/testing/node/duplex-stream.js.map +1 -1
- package/lib/testing/node/index.d.ts +1 -0
- package/lib/testing/node/index.d.ts.map +1 -1
- package/lib/testing/node/index.js +2 -2
- package/lib/testing/node/index.js.map +1 -1
- package/lib/testing/node/message-port-pair.d.ts +25 -0
- package/lib/testing/node/message-port-pair.d.ts.map +1 -0
- package/lib/testing/node/message-port-pair.js +26 -0
- package/lib/testing/node/message-port-pair.js.map +1 -0
- package/lib/testing/wait-for.js.map +1 -1
- package/lib/tracer.d.ts.map +1 -1
- package/lib/tracer.js.map +1 -1
- package/lib/transfer-diagnostic.d.ts +33 -0
- package/lib/transfer-diagnostic.d.ts.map +1 -1
- package/lib/transfer-diagnostic.js +23 -0
- package/lib/transfer-diagnostic.js.map +1 -1
- package/lib/transfer-document.d.ts +70 -32
- package/lib/transfer-document.d.ts.map +1 -1
- package/lib/transfer-document.js +17 -9
- package/lib/transfer-document.js.map +1 -1
- package/lib/uri.d.ts.map +1 -1
- package/lib/uri.js.map +1 -1
- package/lib/util.d.ts +8 -0
- package/lib/util.d.ts.map +1 -1
- package/lib/util.js +32 -0
- package/lib/util.js.map +1 -1
- package/package.json +29 -37
- package/src/abstract-logger.ts +8 -0
- package/src/client/data-connection.ts +502 -0
- package/src/client/data-events.ts +33 -1
- package/src/client/data-port.ts +29 -23
- package/src/client/data-session.ts +951 -126
- package/src/client/index.ts +14 -9
- package/src/client/message-relay.ts +29 -7
- package/src/client/post-message-transport.ts +219 -4
- package/src/client/rpc-connection.ts +281 -0
- package/src/client-ids.ts +49 -0
- package/src/clock.ts +56 -0
- package/src/console-logger.ts +39 -0
- package/src/data/data-protocol-methods.ts +13 -4
- package/src/data/data-server-protocol.ts +157 -41
- package/src/data/events.ts +123 -21
- package/src/data/requests.ts +74 -11
- package/src/errors.ts +322 -36
- package/src/glsp-request-model-args.ts +16 -0
- package/src/glsp-save-model-actions.ts +59 -0
- package/src/index.ts +10 -0
- package/src/latency-collector.ts +8 -3
- package/src/logger.ts +28 -2
- package/src/messages/index.ts +37 -0
- package/src/messages/primitives.ts +271 -0
- package/src/model-server.ts +63 -18
- package/src/model-service/base-version.ts +72 -0
- package/src/model-service/index.ts +4 -5
- package/src/model-service/reference-candidate.ts +5 -3
- package/src/node/index.ts +14 -0
- package/src/node/process-memory.ts +299 -0
- package/src/patch-merge.ts +97 -42
- package/src/profile-session.ts +9 -4
- package/src/random-uuid.ts +21 -0
- package/src/reconcile-write.ts +124 -0
- package/src/rpc/README.md +4 -5
- package/src/rpc/bind-rpc-methods.ts +59 -4
- package/src/rpc/create-rpc-proxy.ts +20 -2
- package/src/rpc/index.ts +1 -0
- package/src/rpc/send-by-method-name.ts +140 -0
- package/src/testing/catalogue-audit.ts +111 -0
- package/src/testing/data-doubles.ts +145 -25
- package/src/testing/fake-clock.ts +62 -47
- package/src/testing/index.ts +5 -2
- package/src/testing/node/duplex-connection.ts +3 -2
- package/src/testing/node/index.ts +2 -2
- package/src/testing/node/message-port-pair.ts +40 -0
- package/src/transfer-diagnostic.ts +40 -0
- package/src/transfer-document.ts +87 -34
- package/src/util.ts +33 -0
- package/lib/model-service/args.d.ts +0 -64
- package/lib/model-service/args.d.ts.map +0 -1
- package/lib/model-service/args.js.map +0 -1
- package/src/model-service/args.ts +0 -67
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
11
11
|
exports.defaultIsNotification = defaultIsNotification;
|
|
12
12
|
exports.createRpcProxy = createRpcProxy;
|
|
13
13
|
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
|
|
14
|
+
const errors_1 = require("../errors");
|
|
14
15
|
const bind_rpc_methods_1 = require("./bind-rpc-methods");
|
|
15
16
|
const wire_prefix_1 = require("./wire-prefix");
|
|
16
17
|
/**
|
|
@@ -61,6 +62,9 @@ function assertSingleArg(wireName, args) {
|
|
|
61
62
|
* params, results and errors, and a second layer here would double every
|
|
62
63
|
* traced line.
|
|
63
64
|
*
|
|
65
|
+
* A rejection whose code names one of the framework's typed errors is rethrown
|
|
66
|
+
* as that class, through {@link reviveProtocolError}.
|
|
67
|
+
*
|
|
64
68
|
* Accepts either a ready connection or a `Promise<MessageConnection>` —
|
|
65
69
|
* proxy methods called before the promise resolves queue until it does,
|
|
66
70
|
* then dispatch, so adopters can wire the proxy before its underlying
|
|
@@ -92,7 +96,12 @@ function createRpcProxy(connection, options = {}) {
|
|
|
92
96
|
// connection; see `localTarget` for why no `Disposable` is surfaced.
|
|
93
97
|
const { localTarget, localMethods } = options;
|
|
94
98
|
if (localTarget && localMethods && localMethods.length > 0) {
|
|
95
|
-
const binding = (0, bind_rpc_methods_1.bindRpcMethods)(connection, localTarget, localMethods, {
|
|
99
|
+
const binding = (0, bind_rpc_methods_1.bindRpcMethods)(connection, localTarget, localMethods, {
|
|
100
|
+
methodNamespace,
|
|
101
|
+
isNotification,
|
|
102
|
+
latency: options.latency,
|
|
103
|
+
renderErrorMessage: options.renderErrorMessage
|
|
104
|
+
});
|
|
96
105
|
resolvedConnection.then(conn => conn.onClose(() => binding.dispose())).catch(() => undefined);
|
|
97
106
|
}
|
|
98
107
|
const onDidOpenConnectionEmitter = new vscode_jsonrpc_1.Emitter();
|
|
@@ -145,7 +154,8 @@ function createRpcProxy(connection, options = {}) {
|
|
|
145
154
|
const capturedError = new Error(`RPC request '${wireName}' failed`);
|
|
146
155
|
return resolvedConnection
|
|
147
156
|
.then(connection => connection.sendRequest(wireName, args[0]))
|
|
148
|
-
.catch((
|
|
157
|
+
.catch((rejection) => {
|
|
158
|
+
const err = (0, errors_1.reviveProtocolError)(rejection);
|
|
149
159
|
if (err instanceof Error && capturedError.stack) {
|
|
150
160
|
err.stack = `${err.stack ?? err.message}\nCaused by request from:\n${capturedError.stack}`;
|
|
151
161
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-rpc-proxy.js","sourceRoot":"","sources":["../../src/rpc/create-rpc-proxy.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF
|
|
1
|
+
{"version":3,"file":"create-rpc-proxy.js","sourceRoot":"","sources":["../../src/rpc/create-rpc-proxy.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;AAElF,mDAA6E;AAC7E,sCAAgD;AAChD,yDAAgF;AAChF,+CAA2D;AAyI3D;;;;;;;;;;;;;;;GAeG;AACH,+BAAsC,UAAkB;IACrD,OAAO,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC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CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;gBACrH,CAAC,CAAC;YACL,CAAC;YACD,OAAO,CAAC,GAAG,IAAe,EAAoB,EAAE;gBAC7C,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;gBAChC,qEAAqE;gBACrE,qEAAqE;gBACrE,sEAAsE;gBACtE,kEAAkE;gBAClE,4DAA4D;gBAC5D,MAAM,aAAa,GAAG,IAAI,KAAK,CAAC,gBAAgB,QAAQ,UAAU,CAAC,CAAC;gBACpE,OAAO,kBAAkB;qBACrB,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;qBAC7D,KAAK,CAAC,CAAC,SAAkB,EAAE,EAAE;oBAC3B,MAAM,GAAG,GAAG,IAAA,4BAAmB,EAAC,SAAS,CAAC,CAAC;oBAC3C,IAAI,GAAG,YAAY,KAAK,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;wBAC/C,GAAG,CAAC,KAAK,GAAG,GAAG,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,8BAA8B,aAAa,CAAC,KAAK,EAAE,CAAC;oBAC9F,CAAC;oBACD,MAAM,GAAG,CAAC;gBACb,CAAC,CAAC,CAAC;YACT,CAAC,CAAC;QACL,CAAC;KACH,CAAgB,CAAC;AACrB,CAAC"}
|
package/lib/rpc/index.d.ts
CHANGED
|
@@ -8,5 +8,6 @@
|
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
export * from './bind-rpc-methods';
|
|
10
10
|
export * from './create-rpc-proxy';
|
|
11
|
+
export * from './send-by-method-name';
|
|
11
12
|
export * from './wire-prefix';
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/rpc/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rpc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAMlF,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rpc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAMlF,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC"}
|
package/lib/rpc/index.js
CHANGED
|
@@ -27,5 +27,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
27
27
|
// specialised composition.
|
|
28
28
|
__exportStar(require("./bind-rpc-methods"), exports);
|
|
29
29
|
__exportStar(require("./create-rpc-proxy"), exports);
|
|
30
|
+
__exportStar(require("./send-by-method-name"), exports);
|
|
30
31
|
__exportStar(require("./wire-prefix"), exports);
|
|
31
32
|
//# sourceMappingURL=index.js.map
|
package/lib/rpc/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rpc/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,kEAAkE;AAClE,+DAA+D;AAC/D,2BAA2B;AAE3B,qDAAmC;AACnC,qDAAmC;AACnC,gDAA8B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rpc/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,kEAAkE;AAClE,+DAA+D;AAC/D,2BAA2B;AAE3B,qDAAmC;AACnC,qDAAmC;AACnC,wDAAsC;AACtC,gDAA8B"}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
* `connection` with `sendRequest` and `sendNotification` sending a typed message
|
|
11
|
+
* by its method name, so it survives a message type built by another copy of
|
|
12
|
+
* `vscode-jsonrpc`. Wrap a connection wherever it is handed to code that sends
|
|
13
|
+
* another copy's typed messages, GLSP's clients and launchers in particular.
|
|
14
|
+
*
|
|
15
|
+
* **Why an install holds several copies.** Upstream pins exactly:
|
|
16
|
+
* - `@eclipse-glsp/*` 2.x pin `vscode-jsonrpc` `8.2.0`, and npm can nest a copy
|
|
17
|
+
* under each GLSP package, so GLSP's packages can split from each other: a
|
|
18
|
+
* connection one of them creates rejects the typed messages another builds.
|
|
19
|
+
* GLSP's upgrade to 9.x, which could let it share the framework's copy, is
|
|
20
|
+
* open as https://github.com/eclipse-glsp/glsp/issues/1720.
|
|
21
|
+
* - `vscode-languageserver@10.0.1` pins `vscode-languageserver-protocol`
|
|
22
|
+
* `3.18.1`, which pins `vscode-jsonrpc` `9.0.0`.
|
|
23
|
+
* - Theia brings protocol `3.17.5` and with it `vscode-jsonrpc` 8.
|
|
24
|
+
*
|
|
25
|
+
* npm hoists one version per name and nests the rest. `overrides` are read from
|
|
26
|
+
* the root manifest alone and never ship with a package, so the framework cannot
|
|
27
|
+
* collapse an adopter's tree.
|
|
28
|
+
*
|
|
29
|
+
* **What breaks across copies.**
|
|
30
|
+
* - Sending: a connection compares a typed message's parameter structure with
|
|
31
|
+
* its own copy's `ParameterStructures.auto` singleton by identity, so a
|
|
32
|
+
* `RequestType` or `NotificationType` built by another copy throws
|
|
33
|
+
* `Unknown parameter structure auto`. GLSP sends typed messages, in
|
|
34
|
+
* `BaseJsonrpcGLSPClient` and in `JsonrpcClientProxy.process`.
|
|
35
|
+
* `vscode-languageserver`'s connection resends by method name already, which
|
|
36
|
+
* is why LSP sends are unaffected.
|
|
37
|
+
* - Types: `ParameterStructures` has a private member, so TypeScript treats each
|
|
38
|
+
* copy's `MessageConnection` as a different type.
|
|
39
|
+
* - Errors: a connection keeps a thrown `ResponseError`'s code and data only
|
|
40
|
+
* when the error is an instance of its own copy's class, and sends a returned
|
|
41
|
+
* one of another copy as a successful result.
|
|
42
|
+
*
|
|
43
|
+
* **What is copy-safe.** Receiving a typed message from another copy, since the
|
|
44
|
+
* receive path compares only against its own `byName` and `byPosition`. With
|
|
45
|
+
* sends by method name, the LSP, data and GLSP heads run over a tree whose GLSP
|
|
46
|
+
* packages keep `vscode-jsonrpc` `8.2.0`.
|
|
47
|
+
*
|
|
48
|
+
* **How it works.** A `Proxy` whose `sendRequest` and `sendNotification` pass the
|
|
49
|
+
* typed message's `method` string; every other member is the connection's own.
|
|
50
|
+
* The parameters go out as the typed send packs them: the first
|
|
51
|
+
* `numberOfParams`, missing ones `null`, and a request's cancellation token
|
|
52
|
+
* from the position after them. Sent by method name, a single parameter goes by
|
|
53
|
+
* name when it is an object and by position otherwise, which matches `auto` and
|
|
54
|
+
* `byName` with an object, as `vscode-languageserver-protocol`'s types use it. A
|
|
55
|
+
* `byPosition` object or a `byName` non-object throws rather than going out in
|
|
56
|
+
* another shape, the packing read from the type's `toString()` since it cannot
|
|
57
|
+
* be compared by identity. So wrapping narrows what a connection accepts: its
|
|
58
|
+
* own copy sends such a type unwrapped. The result is typed as whichever copy's
|
|
59
|
+
* connection its context expects, or as `connection`'s own type without one.
|
|
60
|
+
* That type is the caller's assertion: it holds for the members both copies
|
|
61
|
+
* share, since the sends go by name and the receives are copy-safe.
|
|
62
|
+
*
|
|
63
|
+
* **Where it stops.** Errors: a rejection it produces is still its own copy's
|
|
64
|
+
* `ResponseError`, so recognise errors with `isResponseError`, and build a
|
|
65
|
+
* connection whose errors must keep their code from the framework's copy.
|
|
66
|
+
*
|
|
67
|
+
* See https://github.com/eclipse-emfcloud/hydranium/issues/279.
|
|
68
|
+
*/
|
|
69
|
+
export declare function sendByMethodName<In extends {
|
|
70
|
+
sendRequest<R>(method: string, ...params: unknown[]): Promise<R>;
|
|
71
|
+
sendNotification(method: string, ...params: unknown[]): Promise<void>;
|
|
72
|
+
}, Out extends {
|
|
73
|
+
sendRequest<R>(method: string, ...params: unknown[]): Promise<R>;
|
|
74
|
+
sendNotification(method: string, ...params: unknown[]): Promise<void>;
|
|
75
|
+
} = In>(connection: In): Out;
|
|
76
|
+
//# sourceMappingURL=send-by-method-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-by-method-name.d.ts","sourceRoot":"","sources":["../../src/rpc/send-by-method-name.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,wBAAgB,gBAAgB,CAC7B,EAAE,SAAS;IACR,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACjE,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE,EACD,GAAG,SAAS;IACT,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACjE,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE,GAAG,EAAE,EACP,UAAU,EAAE,EAAE,GAAG,GAAG,CAsBrB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the MIT License which is available in the project root.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.sendByMethodName = sendByMethodName;
|
|
12
|
+
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
|
|
13
|
+
/**
|
|
14
|
+
* `connection` with `sendRequest` and `sendNotification` sending a typed message
|
|
15
|
+
* by its method name, so it survives a message type built by another copy of
|
|
16
|
+
* `vscode-jsonrpc`. Wrap a connection wherever it is handed to code that sends
|
|
17
|
+
* another copy's typed messages, GLSP's clients and launchers in particular.
|
|
18
|
+
*
|
|
19
|
+
* **Why an install holds several copies.** Upstream pins exactly:
|
|
20
|
+
* - `@eclipse-glsp/*` 2.x pin `vscode-jsonrpc` `8.2.0`, and npm can nest a copy
|
|
21
|
+
* under each GLSP package, so GLSP's packages can split from each other: a
|
|
22
|
+
* connection one of them creates rejects the typed messages another builds.
|
|
23
|
+
* GLSP's upgrade to 9.x, which could let it share the framework's copy, is
|
|
24
|
+
* open as https://github.com/eclipse-glsp/glsp/issues/1720.
|
|
25
|
+
* - `vscode-languageserver@10.0.1` pins `vscode-languageserver-protocol`
|
|
26
|
+
* `3.18.1`, which pins `vscode-jsonrpc` `9.0.0`.
|
|
27
|
+
* - Theia brings protocol `3.17.5` and with it `vscode-jsonrpc` 8.
|
|
28
|
+
*
|
|
29
|
+
* npm hoists one version per name and nests the rest. `overrides` are read from
|
|
30
|
+
* the root manifest alone and never ship with a package, so the framework cannot
|
|
31
|
+
* collapse an adopter's tree.
|
|
32
|
+
*
|
|
33
|
+
* **What breaks across copies.**
|
|
34
|
+
* - Sending: a connection compares a typed message's parameter structure with
|
|
35
|
+
* its own copy's `ParameterStructures.auto` singleton by identity, so a
|
|
36
|
+
* `RequestType` or `NotificationType` built by another copy throws
|
|
37
|
+
* `Unknown parameter structure auto`. GLSP sends typed messages, in
|
|
38
|
+
* `BaseJsonrpcGLSPClient` and in `JsonrpcClientProxy.process`.
|
|
39
|
+
* `vscode-languageserver`'s connection resends by method name already, which
|
|
40
|
+
* is why LSP sends are unaffected.
|
|
41
|
+
* - Types: `ParameterStructures` has a private member, so TypeScript treats each
|
|
42
|
+
* copy's `MessageConnection` as a different type.
|
|
43
|
+
* - Errors: a connection keeps a thrown `ResponseError`'s code and data only
|
|
44
|
+
* when the error is an instance of its own copy's class, and sends a returned
|
|
45
|
+
* one of another copy as a successful result.
|
|
46
|
+
*
|
|
47
|
+
* **What is copy-safe.** Receiving a typed message from another copy, since the
|
|
48
|
+
* receive path compares only against its own `byName` and `byPosition`. With
|
|
49
|
+
* sends by method name, the LSP, data and GLSP heads run over a tree whose GLSP
|
|
50
|
+
* packages keep `vscode-jsonrpc` `8.2.0`.
|
|
51
|
+
*
|
|
52
|
+
* **How it works.** A `Proxy` whose `sendRequest` and `sendNotification` pass the
|
|
53
|
+
* typed message's `method` string; every other member is the connection's own.
|
|
54
|
+
* The parameters go out as the typed send packs them: the first
|
|
55
|
+
* `numberOfParams`, missing ones `null`, and a request's cancellation token
|
|
56
|
+
* from the position after them. Sent by method name, a single parameter goes by
|
|
57
|
+
* name when it is an object and by position otherwise, which matches `auto` and
|
|
58
|
+
* `byName` with an object, as `vscode-languageserver-protocol`'s types use it. A
|
|
59
|
+
* `byPosition` object or a `byName` non-object throws rather than going out in
|
|
60
|
+
* another shape, the packing read from the type's `toString()` since it cannot
|
|
61
|
+
* be compared by identity. So wrapping narrows what a connection accepts: its
|
|
62
|
+
* own copy sends such a type unwrapped. The result is typed as whichever copy's
|
|
63
|
+
* connection its context expects, or as `connection`'s own type without one.
|
|
64
|
+
* That type is the caller's assertion: it holds for the members both copies
|
|
65
|
+
* share, since the sends go by name and the receives are copy-safe.
|
|
66
|
+
*
|
|
67
|
+
* **Where it stops.** Errors: a rejection it produces is still its own copy's
|
|
68
|
+
* `ResponseError`, so recognise errors with `isResponseError`, and build a
|
|
69
|
+
* connection whose errors must keep their code from the framework's copy.
|
|
70
|
+
*
|
|
71
|
+
* See https://github.com/eclipse-emfcloud/hydranium/issues/279.
|
|
72
|
+
*/
|
|
73
|
+
function sendByMethodName(connection) {
|
|
74
|
+
const sendRequest = (type, ...params) => typeof type === 'string'
|
|
75
|
+
? connection.sendRequest(type, ...params)
|
|
76
|
+
: connection.sendRequest(type.method, ...argsOf(type, params, true));
|
|
77
|
+
const sendNotification = (type, ...params) => typeof type === 'string'
|
|
78
|
+
? connection.sendNotification(type, ...params)
|
|
79
|
+
: connection.sendNotification(type.method, ...argsOf(type, params, false));
|
|
80
|
+
const wrapped = new Proxy(connection, {
|
|
81
|
+
get(target, property, receiver) {
|
|
82
|
+
if (property === 'sendRequest') {
|
|
83
|
+
return sendRequest;
|
|
84
|
+
}
|
|
85
|
+
if (property === 'sendNotification') {
|
|
86
|
+
return sendNotification;
|
|
87
|
+
}
|
|
88
|
+
return Reflect.get(target, property, receiver);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
// Typed as the connection its context expects, which the doc above justifies.
|
|
92
|
+
return wrapped;
|
|
93
|
+
}
|
|
94
|
+
/** Whether `vscode-jsonrpc` sends `param` by name under `auto`. */
|
|
95
|
+
function isNamedParam(param) {
|
|
96
|
+
return param !== undefined && param !== null && !Array.isArray(param) && typeof param === 'object';
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The arguments that send `type` by method name with the typed send's params:
|
|
100
|
+
* the first `numberOfParams` of `params`, missing ones `null`, then a request's
|
|
101
|
+
* cancellation token, which the typed send takes from that position. A request
|
|
102
|
+
* always ends in a token, `CancellationToken.None` when it has none, since a
|
|
103
|
+
* send by method name takes a token-shaped last argument for its token. Throws
|
|
104
|
+
* for the one-parameter packing a send by method name cannot express.
|
|
105
|
+
*/
|
|
106
|
+
function argsOf(type, params, isRequest) {
|
|
107
|
+
const args = Array.from({ length: type.numberOfParams }, (_, i) => (i < params.length ? params[i] : null));
|
|
108
|
+
if (type.numberOfParams === 1) {
|
|
109
|
+
const packing = String(type.parameterStructures);
|
|
110
|
+
if ((packing === 'byPosition' && isNamedParam(args[0])) || (packing === 'byName' && !isNamedParam(args[0]))) {
|
|
111
|
+
throw new Error(`sendByMethodName cannot send '${type.method}' ${packing}: by method name, a single object goes by name and anything else by position.`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (!isRequest) {
|
|
115
|
+
return args;
|
|
116
|
+
}
|
|
117
|
+
const token = params[type.numberOfParams];
|
|
118
|
+
return [...args, vscode_jsonrpc_1.CancellationToken.is(token) ? token : vscode_jsonrpc_1.CancellationToken.None];
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=send-by-method-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-by-method-name.js","sourceRoot":"","sources":["../../src/rpc/send-by-method-name.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,mDAAmD;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,0BASE,UAAc;IACb,MAAM,WAAW,GAAG,CAAC,IAA2B,EAAE,GAAG,MAAiB,EAAE,EAAE,CACvE,OAAO,IAAI,KAAK,QAAQ;QACrB,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC;QACzC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IAC3E,MAAM,gBAAgB,GAAG,CAAC,IAA2B,EAAE,GAAG,MAAiB,EAAE,EAAE,CAC5E,OAAO,IAAI,KAAK,QAAQ;QACrB,CAAC,CAAC,UAAU,C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,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACjD,IAAI,CAAC,OAAO,KAAK,YAAY,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3G,MAAM,IAAI,KAAK,CACZ,iCAAiC,IAAI,CAAC,MAAM,KAAK,OAAO,+EAA+E,CACzI,CAAC;QACL,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,SAAS,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,IAAI,EAAE,kCAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,kCAAiB,CAAC,IAAI,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire-prefix.js","sourceRoot":"","sources":["../../src/rpc/wire-prefix.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF
|
|
1
|
+
{"version":3,"file":"wire-prefix.js","sourceRoot":"","sources":["../../src/rpc/wire-prefix.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,oCAA2C,eAAuB,EAAE,MAAc;IAC/E,IAAI,eAAe,KAAK,EAAE,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3D,OAAO;IACV,CAAC;IACD,MAAM,IAAI,SAAS,CAChB,GAAG,MAAM,sBAAsB,eAAe,qCAAqC;QAChF,qFAAqF;QACrF,yDAAyD,eAAe,cAAc;QACtF,6CAA6C,eAAe,gBAAgB;QAC5E,gBAAgB,eAAe,2CAA2C,CAC/E,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, 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
|
+
* Audit a translation catalogue against the codes that actually exist.
|
|
11
|
+
*
|
|
12
|
+
* **The one failure mode a catalogue has, and the only one nothing else
|
|
13
|
+
* catches.** A key naming no declared code falls back to the English — which is
|
|
14
|
+
* byte-identical to a deliberate omission, so a typo is invisible at runtime and
|
|
15
|
+
* indistinguishable from the partial-catalogue behaviour every adopter relies
|
|
16
|
+
* on. Nothing on the render path can tell them apart, `theia nls-extract`
|
|
17
|
+
* reports what the SOURCE declares rather than whether a catalogue matches it,
|
|
18
|
+
* and the framework's own gates see only the framework's own files.
|
|
19
|
+
*
|
|
20
|
+
* Shipped as test support rather than as a runtime check on purpose: an
|
|
21
|
+
* orphaned key is an authoring mistake, and failing a server boot over one would
|
|
22
|
+
* take a running product down for a cosmetic defect.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Flatten a nested catalogue into the `/`-joined keys a message code is spelled
|
|
26
|
+
* with, dropping `_`-prefixed keys as notes to a human reader.
|
|
27
|
+
*
|
|
28
|
+
* Nesting is a HOST convention, not the framework's: Theia flattens a nested
|
|
29
|
+
* catalogue by joining keys with `/`, which is the separator a code already
|
|
30
|
+
* uses, so an adopter on that host writes the file nested and one handed
|
|
31
|
+
* straight to a `DefaultMessageRenderer` writes it flat. Both end up here.
|
|
32
|
+
*
|
|
33
|
+
* `_`-prefixed keys are dropped by PREFIX rather than by matching one literal
|
|
34
|
+
* name, so a second note added to a file cannot silently become a catalogue
|
|
35
|
+
* entry. A code is three `/`-separated segments, so no real entry can begin
|
|
36
|
+
* with `_`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function flattenCatalogue(catalogue: Record<string, unknown>, prefix?: string): Record<string, string>;
|
|
39
|
+
/** Options for {@link findUndeclaredCodes}. */
|
|
40
|
+
export interface CatalogueAuditOptions {
|
|
41
|
+
/**
|
|
42
|
+
* Key prefixes to skip, for entries whose codes are NOT declared through a
|
|
43
|
+
* `defineMessage` barrel.
|
|
44
|
+
*
|
|
45
|
+
* The real case is a host's own mechanism: Theia's `nls.localize` takes its
|
|
46
|
+
* key as an inline literal at the call site, so those keys exist only in
|
|
47
|
+
* source text and no barrel can enumerate them. Keep this as narrow as the
|
|
48
|
+
* host layer actually is — exempting a namespace is exempting every typo in
|
|
49
|
+
* it, which is what this function exists to find.
|
|
50
|
+
*/
|
|
51
|
+
readonly exemptPrefixes?: readonly string[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Every catalogue key that names no code any of `barrels` declares.
|
|
55
|
+
*
|
|
56
|
+
* Barrels are taken as opaque objects and read with {@link collectMessages},
|
|
57
|
+
* which is what lets a caller pass a `import * as messages` namespace directly:
|
|
58
|
+
* a barrel's value type is a union of its declarations AND its functions, and
|
|
59
|
+
* filtering that union will not narrow to a `MessageDefinition`.
|
|
60
|
+
*
|
|
61
|
+
* Returns the offending keys rather than a boolean, so a failing assertion names
|
|
62
|
+
* WHICH key is wrong — a count says only that something is.
|
|
63
|
+
*/
|
|
64
|
+
export declare function findUndeclaredCodes(catalogueKeys: readonly string[], barrels: readonly object[], options?: CatalogueAuditOptions): string[];
|
|
65
|
+
/**
|
|
66
|
+
* Keys present in more than one catalogue — the shape a split catalogue rots
|
|
67
|
+
* into.
|
|
68
|
+
*
|
|
69
|
+
* Exactly one side renders a given message, so two catalogues holding one code
|
|
70
|
+
* are two authorities over one sentence and they diverge on the first reword.
|
|
71
|
+
* Nothing at runtime notices: both sides render, and whichever ran last wins on
|
|
72
|
+
* its own surface.
|
|
73
|
+
*
|
|
74
|
+
* Takes the key sets rather than a boolean answer for the same reason as
|
|
75
|
+
* {@link findUndeclaredCodes}, and reports NOTHING when a set is empty — an
|
|
76
|
+
* empty catalogue shares no key with anything, so a caller must assert
|
|
77
|
+
* non-emptiness separately or a failed read passes this vacuously.
|
|
78
|
+
*/
|
|
79
|
+
export declare function findSharedCodes(first: readonly string[], second: readonly string[]): string[];
|
|
80
|
+
//# sourceMappingURL=catalogue-audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogue-audit.d.ts","sourceRoot":"","sources":["../../src/testing/catalogue-audit.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,SAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAcxG;AAED,+CAA+C;AAC/C,MAAM,WAAW,qBAAqB;IACnC;;;;;;;;;OASG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAChC,aAAa,EAAE,SAAS,MAAM,EAAE,EAChC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,GAAE,qBAA0B,GACnC,MAAM,EAAE,CAIV;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAG7F"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the MIT License which is available in the project root.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.flattenCatalogue = flattenCatalogue;
|
|
12
|
+
exports.findUndeclaredCodes = findUndeclaredCodes;
|
|
13
|
+
exports.findSharedCodes = findSharedCodes;
|
|
14
|
+
const primitives_1 = require("../messages/primitives");
|
|
15
|
+
/**
|
|
16
|
+
* Audit a translation catalogue against the codes that actually exist.
|
|
17
|
+
*
|
|
18
|
+
* **The one failure mode a catalogue has, and the only one nothing else
|
|
19
|
+
* catches.** A key naming no declared code falls back to the English — which is
|
|
20
|
+
* byte-identical to a deliberate omission, so a typo is invisible at runtime and
|
|
21
|
+
* indistinguishable from the partial-catalogue behaviour every adopter relies
|
|
22
|
+
* on. Nothing on the render path can tell them apart, `theia nls-extract`
|
|
23
|
+
* reports what the SOURCE declares rather than whether a catalogue matches it,
|
|
24
|
+
* and the framework's own gates see only the framework's own files.
|
|
25
|
+
*
|
|
26
|
+
* Shipped as test support rather than as a runtime check on purpose: an
|
|
27
|
+
* orphaned key is an authoring mistake, and failing a server boot over one would
|
|
28
|
+
* take a running product down for a cosmetic defect.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Flatten a nested catalogue into the `/`-joined keys a message code is spelled
|
|
32
|
+
* with, dropping `_`-prefixed keys as notes to a human reader.
|
|
33
|
+
*
|
|
34
|
+
* Nesting is a HOST convention, not the framework's: Theia flattens a nested
|
|
35
|
+
* catalogue by joining keys with `/`, which is the separator a code already
|
|
36
|
+
* uses, so an adopter on that host writes the file nested and one handed
|
|
37
|
+
* straight to a `DefaultMessageRenderer` writes it flat. Both end up here.
|
|
38
|
+
*
|
|
39
|
+
* `_`-prefixed keys are dropped by PREFIX rather than by matching one literal
|
|
40
|
+
* name, so a second note added to a file cannot silently become a catalogue
|
|
41
|
+
* entry. A code is three `/`-separated segments, so no real entry can begin
|
|
42
|
+
* with `_`.
|
|
43
|
+
*/
|
|
44
|
+
function flattenCatalogue(catalogue, prefix = '') {
|
|
45
|
+
const flat = {};
|
|
46
|
+
for (const [key, value] of Object.entries(catalogue)) {
|
|
47
|
+
if (key.startsWith('_')) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const joined = prefix ? `${prefix}/${key}` : key;
|
|
51
|
+
if (typeof value === 'string') {
|
|
52
|
+
flat[joined] = value;
|
|
53
|
+
}
|
|
54
|
+
else if (typeof value === 'object' && value !== null) {
|
|
55
|
+
Object.assign(flat, flattenCatalogue(value, joined));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return flat;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Every catalogue key that names no code any of `barrels` declares.
|
|
62
|
+
*
|
|
63
|
+
* Barrels are taken as opaque objects and read with {@link collectMessages},
|
|
64
|
+
* which is what lets a caller pass a `import * as messages` namespace directly:
|
|
65
|
+
* a barrel's value type is a union of its declarations AND its functions, and
|
|
66
|
+
* filtering that union will not narrow to a `MessageDefinition`.
|
|
67
|
+
*
|
|
68
|
+
* Returns the offending keys rather than a boolean, so a failing assertion names
|
|
69
|
+
* WHICH key is wrong — a count says only that something is.
|
|
70
|
+
*/
|
|
71
|
+
function findUndeclaredCodes(catalogueKeys, barrels, options = {}) {
|
|
72
|
+
const declared = new Set(barrels.flatMap(barrel => (0, primitives_1.collectMessages)(barrel).map(message => message.code)));
|
|
73
|
+
const exempt = options.exemptPrefixes ?? [];
|
|
74
|
+
return catalogueKeys.filter(key => !exempt.some(prefix => key.startsWith(prefix)) && !declared.has(key));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Keys present in more than one catalogue — the shape a split catalogue rots
|
|
78
|
+
* into.
|
|
79
|
+
*
|
|
80
|
+
* Exactly one side renders a given message, so two catalogues holding one code
|
|
81
|
+
* are two authorities over one sentence and they diverge on the first reword.
|
|
82
|
+
* Nothing at runtime notices: both sides render, and whichever ran last wins on
|
|
83
|
+
* its own surface.
|
|
84
|
+
*
|
|
85
|
+
* Takes the key sets rather than a boolean answer for the same reason as
|
|
86
|
+
* {@link findUndeclaredCodes}, and reports NOTHING when a set is empty — an
|
|
87
|
+
* empty catalogue shares no key with anything, so a caller must assert
|
|
88
|
+
* non-emptiness separately or a failed read passes this vacuously.
|
|
89
|
+
*/
|
|
90
|
+
function findSharedCodes(first, second) {
|
|
91
|
+
const other = new Set(second);
|
|
92
|
+
return first.filter(key => other.has(key));
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=catalogue-audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogue-audit.js","sourceRoot":"","sources":["../../src/testing/catalogue-audit.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;AAElF,uDAAyD;AAEzD;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;GAaG;AACH,0BAAiC,SAAkC,EAAE,MAAM,GAAG,EAAE;IAC7E,MAAM,IAAI,GAA2B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACpD,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,SAAS;QACZ,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;QACxB,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACtD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,KAAgC,EAAE,MAAM,CAAC,CAAC,CAAC;QACnF,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACf,CAAC;AAiBD;;;;;;;;;;GAUG;AACH,6BACG,aAAgC,EAChC,OAA0B,EAC1B,OAAO,GAA0B,EAAE;IAEnC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,IAAA,4BAAe,EAAC,MAAM,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1G,MAAM,MAAM,GAAG,OAAO,CAAC,cAAc,IAAI,EAAE,CAAC;IAC5C,OAAO,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5G,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,yBAAgC,KAAwB,EAAE,MAAyB;IAChF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -32,7 +32,10 @@
|
|
|
32
32
|
import { type MessageConnection } from 'vscode-jsonrpc';
|
|
33
33
|
import type { DataPort } from '../client/data-port';
|
|
34
34
|
import type { DataClientProtocol } from '../data/data-server-protocol';
|
|
35
|
-
import type { ProjectsChangedEvent, TransferDocumentSavedEvent, TransferDocumentUpdatedEvent } from '../data/events';
|
|
35
|
+
import type { ProjectsChangedEvent, TransferDocumentDeletedEvent, TransferDocumentDirtyChangedEvent, TransferDocumentSavedEvent, TransferDocumentsBuiltEvent, TransferDocumentUpdatedEvent } from '../data/events';
|
|
36
|
+
import type { Logger } from '../logger';
|
|
37
|
+
import type { ResolvedMessage } from '../messages/primitives';
|
|
38
|
+
import type { RpcProxyLifecycle } from '../rpc/create-rpc-proxy';
|
|
36
39
|
import type { Project } from '../project';
|
|
37
40
|
import type { TransferDiagnostic } from '../transfer-diagnostic';
|
|
38
41
|
import type { TransferElement } from '../transfer-element';
|
|
@@ -48,13 +51,8 @@ export interface FakeDataPortOptions {
|
|
|
48
51
|
* which the consumer surfaces through {@link FakeDataPort.reported}.
|
|
49
52
|
*/
|
|
50
53
|
connect(): MessageConnection | Promise<MessageConnection>;
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
* three sentinels the framework reserves (`'language-client'`, `'unknown'`,
|
|
54
|
-
* `'revert-on-close'`); override it when a test needs two distinguishable
|
|
55
|
-
* clients on one server.
|
|
56
|
-
*/
|
|
57
|
-
clientId?: string;
|
|
54
|
+
/** The port's {@link DataPort.logger}. */
|
|
55
|
+
logger?: Logger;
|
|
58
56
|
}
|
|
59
57
|
/** A {@link DataPort} that records what passed through it. */
|
|
60
58
|
export interface FakeDataPort extends DataPort {
|
|
@@ -69,12 +67,13 @@ export interface FakeDataPort extends DataPort {
|
|
|
69
67
|
/**
|
|
70
68
|
* Every {@link DataPort.reportError} call, in order. Read from outside: this
|
|
71
69
|
* is the only place a transport failure surfaces, so a test for the failure
|
|
72
|
-
* path asserts
|
|
73
|
-
*
|
|
70
|
+
* path asserts here rather than on a rejection the consumer may legitimately
|
|
71
|
+
* swallow. Prefer asserting on `message.code`, which is stable, over
|
|
72
|
+
* `message.text`, which is the English default and may be reworded.
|
|
74
73
|
*/
|
|
75
74
|
readonly reported: readonly {
|
|
76
75
|
readonly error: unknown;
|
|
77
|
-
readonly
|
|
76
|
+
readonly message: ResolvedMessage;
|
|
78
77
|
}[];
|
|
79
78
|
/**
|
|
80
79
|
* Fire {@link DataPort.onDispose} — the host tearing the transport down, a
|
|
@@ -93,21 +92,43 @@ export interface FakeDataPort extends DataPort {
|
|
|
93
92
|
* connection with no server behind it, a different one per generation.
|
|
94
93
|
*/
|
|
95
94
|
export declare function makeFakeDataPort(options: FakeDataPortOptions): FakeDataPort;
|
|
95
|
+
type UpperLetter = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';
|
|
96
|
+
/**
|
|
97
|
+
* A notification name `TClient` adds to {@link DataClientProtocol}. Limited to
|
|
98
|
+
* `on` plus a letter A–Z, the names the proxy sends as notifications; any other
|
|
99
|
+
* name would be bound as a request. The {@link RpcProxyLifecycle} names are
|
|
100
|
+
* excluded too: the proxy returns its own events for them and sends nothing.
|
|
101
|
+
*/
|
|
102
|
+
export type AdditionalClientMethod<TClient> = Exclude<keyof TClient, keyof DataClientProtocol<TransferElement> | keyof RpcProxyLifecycle> & `on${UpperLetter}${string}`;
|
|
96
103
|
/** A {@link DataClientProtocol} plus the arrays it records into. */
|
|
97
|
-
export interface CapturingDataClient<TTransfer extends TransferElement, TDiagnostic extends TransferDiagnostic = TransferDiagnostic, TProject extends Project = Project> {
|
|
104
|
+
export interface CapturingDataClient<TTransfer extends TransferElement, TDiagnostic extends TransferDiagnostic = TransferDiagnostic, TProject extends Project = Project, TClient extends DataClientProtocol<TTransfer, TDiagnostic, TProject> = DataClientProtocol<TTransfer, TDiagnostic, TProject>> {
|
|
98
105
|
/** The client to hand to a `DataSession` or bind as an RPC `localTarget`. */
|
|
99
|
-
readonly client:
|
|
106
|
+
readonly client: TClient;
|
|
100
107
|
/** Every `onDocumentUpdated` event, in arrival order. */
|
|
101
108
|
readonly updates: TransferDocumentUpdatedEvent<TTransfer, TDiagnostic>[];
|
|
102
109
|
/** Every `onDocumentSaved` event, in arrival order. */
|
|
103
110
|
readonly saves: TransferDocumentSavedEvent<TTransfer, TDiagnostic>[];
|
|
111
|
+
/** Every `onDocumentDirtyChanged` event, in arrival order. */
|
|
112
|
+
readonly dirtyChanges: TransferDocumentDirtyChangedEvent[];
|
|
113
|
+
/** Every `onDocumentDeleted` event, in arrival order. */
|
|
114
|
+
readonly deletions: TransferDocumentDeletedEvent[];
|
|
115
|
+
/** Every `onDocumentsBuilt` event, in arrival order. */
|
|
116
|
+
readonly builds: TransferDocumentsBuiltEvent[];
|
|
104
117
|
/** Every `onProjectsChanged` event, in arrival order. */
|
|
105
118
|
readonly projectsChanges: ProjectsChangedEvent<TProject>[];
|
|
119
|
+
/**
|
|
120
|
+
* Every event of each additional client method, keyed by method, in arrival
|
|
121
|
+
* order. A method of `TClient` left out of `additionalClientMethods` has no
|
|
122
|
+
* entry.
|
|
123
|
+
*/
|
|
124
|
+
readonly additionalNotifications: {
|
|
125
|
+
readonly [K in AdditionalClientMethod<TClient>]: TClient[K] extends (event: infer TEvent) => void ? TEvent[] : never;
|
|
126
|
+
};
|
|
106
127
|
}
|
|
107
128
|
/**
|
|
108
129
|
* A {@link DataClientProtocol} that records every notification it receives.
|
|
109
130
|
*
|
|
110
|
-
* Recording
|
|
131
|
+
* Recording EVERY channel even when a suite reads one is deliberate: an
|
|
111
132
|
* event delivered on the wrong channel is a real defect of the data head, and a
|
|
112
133
|
* double that drops the other two turns it into silence on the one being
|
|
113
134
|
* watched.
|
|
@@ -116,6 +137,12 @@ export interface CapturingDataClient<TTransfer extends TransferElement, TDiagnos
|
|
|
116
137
|
* the corresponding array stays empty — that is what makes an override usable
|
|
117
138
|
* as a barrier (rejecting, counting differently, throwing) rather than only as
|
|
118
139
|
* a spy.
|
|
140
|
+
*
|
|
141
|
+
* `additionalClientMethods` names the notifications `TClient` adds to
|
|
142
|
+
* {@link DataClientProtocol}. Each is recorded and overridable the same way;
|
|
143
|
+
* one left out is not on the client at all, and overriding it throws, since
|
|
144
|
+
* nothing would call the override.
|
|
119
145
|
*/
|
|
120
|
-
export declare function makeCapturingDataClient<TTransfer extends TransferElement, TDiagnostic extends TransferDiagnostic = TransferDiagnostic, TProject extends Project = Project>
|
|
146
|
+
export declare function makeCapturingDataClient<TTransfer extends TransferElement, TDiagnostic extends TransferDiagnostic = TransferDiagnostic, TProject extends Project = Project, TClient extends DataClientProtocol<TTransfer, TDiagnostic, TProject> = DataClientProtocol<TTransfer, TDiagnostic, TProject>>(overrides?: Partial<TClient>, additionalClientMethods?: readonly AdditionalClientMethod<TClient>[]): CapturingDataClient<TTransfer, TDiagnostic, TProject, TClient>;
|
|
147
|
+
export {};
|
|
121
148
|
//# sourceMappingURL=data-doubles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-doubles.d.ts","sourceRoot":"","sources":["../../src/testing/data-doubles.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAW,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"data-doubles.d.ts","sourceRoot":"","sources":["../../src/testing/data-doubles.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAW,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EACT,oBAAoB,EACpB,4BAA4B,EAC5B,iCAAiC,EACjC,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,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