@hydranium/protocol 1.0.0-next.39 → 1.0.0-next.390
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 +46 -83
- package/lib/abstract-logger.d.ts +11 -0
- package/lib/abstract-logger.d.ts.map +1 -1
- package/lib/abstract-logger.js +16 -0
- package/lib/abstract-logger.js.map +1 -1
- package/lib/client/data-connection.d.ts +303 -0
- package/lib/client/data-connection.d.ts.map +1 -0
- package/lib/client/data-connection.js +534 -0
- package/lib/client/data-connection.js.map +1 -0
- package/lib/client/data-events.d.ts +11 -2
- package/lib/client/data-events.d.ts.map +1 -1
- package/lib/client/data-events.js +13 -1
- package/lib/client/data-events.js.map +1 -1
- package/lib/client/data-port.d.ts +34 -24
- package/lib/client/data-port.d.ts.map +1 -1
- package/lib/client/data-session.d.ts +762 -89
- package/lib/client/data-session.d.ts.map +1 -1
- package/lib/client/data-session.js +1253 -115
- package/lib/client/data-session.js.map +1 -1
- package/lib/client/index.d.ts +16 -9
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/index.js +16 -9
- package/lib/client/index.js.map +1 -1
- package/lib/client/message-relay.d.ts +6 -4
- package/lib/client/message-relay.d.ts.map +1 -1
- package/lib/client/message-relay.js +4 -4
- package/lib/client/message-relay.js.map +1 -1
- package/lib/client/post-message-transport.d.ts +69 -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 +173 -0
- package/lib/client/rpc-connection.d.ts.map +1 -0
- package/lib/client/rpc-connection.js +225 -0
- package/lib/client/rpc-connection.js.map +1 -0
- package/lib/client/worker-handshake.d.ts +94 -0
- package/lib/client/worker-handshake.d.ts.map +1 -0
- package/lib/client/worker-handshake.js +51 -0
- package/lib/client/worker-handshake.js.map +1 -0
- package/lib/client/working-copy.d.ts +420 -0
- package/lib/client/working-copy.d.ts.map +1 -0
- package/lib/client/working-copy.js +958 -0
- package/lib/client/working-copy.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 +50 -10
- 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 +7 -0
- package/lib/data/data-protocol-methods.js.map +1 -1
- package/lib/data/data-server-protocol.d.ts +160 -50
- package/lib/data/data-server-protocol.d.ts.map +1 -1
- package/lib/data/events.d.ts +75 -31
- package/lib/data/events.d.ts.map +1 -1
- package/lib/data/requests.d.ts +84 -11
- package/lib/data/requests.d.ts.map +1 -1
- package/lib/debouncer.d.ts +7 -4
- package/lib/debouncer.d.ts.map +1 -1
- package/lib/debouncer.js +10 -10
- package/lib/debouncer.js.map +1 -1
- package/lib/errors.d.ts +241 -48
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +395 -60
- package/lib/errors.js.map +1 -1
- package/lib/format-log-arg.d.ts +33 -0
- package/lib/format-log-arg.d.ts.map +1 -0
- package/lib/format-log-arg.js +158 -0
- package/lib/format-log-arg.js.map +1 -0
- package/lib/glsp-edits-settled-actions.d.ts +54 -0
- package/lib/glsp-edits-settled-actions.d.ts.map +1 -0
- package/lib/glsp-edits-settled-actions.js +28 -0
- package/lib/glsp-edits-settled-actions.js.map +1 -0
- 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 +55 -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 +11 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -0
- package/lib/index.js.map +1 -1
- package/lib/latency-collector.d.ts +10 -4
- package/lib/latency-collector.d.ts.map +1 -1
- package/lib/latency-collector.js +2 -0
- package/lib/latency-collector.js.map +1 -1
- package/lib/logger.d.ts +38 -7
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js +42 -4
- package/lib/logger.js.map +1 -1
- package/lib/messages/index.d.ts +4 -2
- package/lib/messages/index.d.ts.map +1 -1
- package/lib/messages/index.js +17 -4
- package/lib/messages/index.js.map +1 -1
- package/lib/messages/primitives.d.ts +59 -4
- package/lib/messages/primitives.d.ts.map +1 -1
- package/lib/messages/primitives.js +97 -4
- package/lib/messages/primitives.js.map +1 -1
- package/lib/model-server.d.ts +58 -11
- 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 +67 -0
- package/lib/model-service/base-version.d.ts.map +1 -0
- package/lib/model-service/base-version.js +44 -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/node/index.d.ts +10 -0
- 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 +63 -35
- package/lib/patch-merge.d.ts.map +1 -1
- package/lib/patch-merge.js +171 -25
- package/lib/patch-merge.js.map +1 -1
- package/lib/pending-work-tracker.d.ts +33 -0
- package/lib/pending-work-tracker.d.ts.map +1 -0
- package/lib/pending-work-tracker.js +48 -0
- package/lib/pending-work-tracker.js.map +1 -0
- package/lib/profile-session.d.ts +24 -8
- package/lib/profile-session.d.ts.map +1 -1
- package/lib/profile-session.js +13 -4
- package/lib/profile-session.js.map +1 -1
- package/lib/profiling.d.ts +15 -2
- package/lib/profiling.d.ts.map +1 -1
- package/lib/profiling.js.map +1 -1
- package/lib/project.d.ts +6 -2
- package/lib/project.d.ts.map +1 -1
- package/lib/project.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 +70 -0
- package/lib/reconcile-write.d.ts.map +1 -0
- package/lib/reconcile-write.js +69 -0
- package/lib/reconcile-write.js.map +1 -0
- package/lib/rpc/bind-rpc-methods.d.ts +6 -2
- package/lib/rpc/bind-rpc-methods.d.ts.map +1 -1
- package/lib/rpc/bind-rpc-methods.js +17 -7
- package/lib/rpc/bind-rpc-methods.js.map +1 -1
- package/lib/rpc/create-rpc-proxy.d.ts +3 -0
- package/lib/rpc/create-rpc-proxy.d.ts.map +1 -1
- package/lib/rpc/create-rpc-proxy.js +6 -1
- 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/save-text-document.d.ts +40 -0
- package/lib/save-text-document.d.ts.map +1 -0
- package/lib/save-text-document.js +34 -0
- package/lib/save-text-document.js.map +1 -0
- package/lib/testing/catalogue-audit.js.map +1 -1
- package/lib/testing/data-doubles.d.ts +36 -11
- package/lib/testing/data-doubles.d.ts.map +1 -1
- package/lib/testing/data-doubles.js +47 -9
- package/lib/testing/data-doubles.js.map +1 -1
- package/lib/testing/fake-clock.d.ts +17 -2
- package/lib/testing/fake-clock.d.ts.map +1 -1
- package/lib/testing/fake-clock.js +61 -46
- package/lib/testing/fake-clock.js.map +1 -1
- package/lib/testing/harness.d.ts +9 -0
- package/lib/testing/harness.d.ts.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 +4 -3
- 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 +2 -0
- package/lib/testing/node/index.d.ts.map +1 -1
- package/lib/testing/node/index.js +3 -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/node/unhandled-rejections.d.ts +20 -0
- package/lib/testing/node/unhandled-rejections.d.ts.map +1 -0
- package/lib/testing/node/unhandled-rejections.js +35 -0
- package/lib/testing/node/unhandled-rejections.js.map +1 -0
- package/lib/testing/transfer-node-builder.d.ts +81 -0
- package/lib/testing/transfer-node-builder.d.ts.map +1 -0
- package/lib/testing/transfer-node-builder.js +47 -0
- package/lib/testing/transfer-node-builder.js.map +1 -0
- package/lib/testing/wait-for.d.ts +9 -3
- package/lib/testing/wait-for.d.ts.map +1 -1
- package/lib/testing/wait-for.js +57 -11
- package/lib/testing/wait-for.js.map +1 -1
- package/lib/tracer.d.ts.map +1 -1
- package/lib/tracer.js +5 -9
- package/lib/tracer.js.map +1 -1
- package/lib/transfer-diagnostic.d.ts +11 -0
- package/lib/transfer-diagnostic.d.ts.map +1 -1
- package/lib/transfer-diagnostic.js +17 -0
- package/lib/transfer-diagnostic.js.map +1 -1
- package/lib/transfer-document.d.ts +108 -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/transfer-element.d.ts +4 -4
- package/lib/types.d.ts +32 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/{model-service/args.js → types.js} +2 -2
- package/lib/types.js.map +1 -0
- package/lib/uri.d.ts.map +1 -1
- package/lib/uri.js.map +1 -1
- package/lib/util.d.ts +8 -2
- package/lib/util.d.ts.map +1 -1
- package/lib/util.js +32 -4
- package/lib/util.js.map +1 -1
- package/package.json +24 -40
- package/src/abstract-logger.ts +18 -0
- package/src/client/data-connection.ts +654 -0
- package/src/client/data-events.ts +15 -1
- package/src/client/data-port.ts +36 -25
- package/src/client/data-session.ts +1606 -137
- package/src/client/index.ts +16 -9
- package/src/client/message-relay.ts +6 -4
- package/src/client/post-message-transport.ts +224 -4
- package/src/client/rpc-connection.ts +302 -0
- package/src/client/worker-handshake.ts +121 -0
- package/src/client/working-copy.ts +1116 -0
- package/src/client-ids.ts +49 -0
- package/src/clock.ts +68 -10
- package/src/console-logger.ts +39 -0
- package/src/data/data-protocol-methods.ts +8 -1
- package/src/data/data-server-protocol.ts +184 -49
- package/src/data/events.ts +77 -31
- package/src/data/requests.ts +90 -11
- package/src/debouncer.ts +11 -11
- package/src/errors.ts +496 -71
- package/src/format-log-arg.ts +176 -0
- package/src/glsp-edits-settled-actions.ts +62 -0
- package/src/glsp-request-model-args.ts +16 -0
- package/src/glsp-save-model-actions.ts +64 -0
- package/src/index.ts +11 -0
- package/src/latency-collector.ts +10 -3
- package/src/logger.ts +44 -8
- package/src/messages/index.ts +12 -2
- package/src/messages/primitives.ts +129 -5
- package/src/model-server.ts +62 -17
- package/src/model-service/base-version.ts +75 -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 +230 -45
- package/src/pending-work-tracker.ts +48 -0
- package/src/profile-session.ts +31 -11
- package/src/profiling.ts +15 -2
- package/src/project.ts +6 -2
- package/src/random-uuid.ts +21 -0
- package/src/reconcile-write.ts +131 -0
- package/src/rpc/README.md +6 -6
- package/src/rpc/bind-rpc-methods.ts +18 -8
- package/src/rpc/create-rpc-proxy.ts +6 -1
- package/src/rpc/index.ts +1 -0
- package/src/rpc/send-by-method-name.ts +140 -0
- package/src/save-text-document.ts +39 -0
- package/src/testing/data-doubles.ts +119 -19
- package/src/testing/fake-clock.ts +76 -48
- package/src/testing/harness.ts +10 -0
- package/src/testing/index.ts +4 -3
- package/src/testing/node/duplex-connection.ts +3 -2
- package/src/testing/node/index.ts +3 -2
- package/src/testing/node/message-port-pair.ts +40 -0
- package/src/testing/node/unhandled-rejections.ts +31 -0
- package/src/testing/transfer-node-builder.ts +107 -0
- package/src/testing/wait-for.ts +61 -13
- package/src/tracer.ts +5 -9
- package/src/transfer-diagnostic.ts +17 -0
- package/src/transfer-document.ts +130 -34
- package/src/transfer-element.ts +4 -4
- package/src/types.ts +30 -0
- package/src/util.ts +33 -6
- 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
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
-
import { type Clock, type Stopwatch,
|
|
10
|
+
import { type Clock, type Stopwatch, SystemClock } from '../clock';
|
|
11
11
|
import { Disposable } from '../util';
|
|
12
12
|
|
|
13
13
|
/** A {@link Clock} whose time only moves when the test calls {@link FakeClock.advance}. */
|
|
@@ -17,9 +17,19 @@ export interface FakeClock extends Clock {
|
|
|
17
17
|
* whose deadline falls within the window — in chronological order, each at
|
|
18
18
|
* its own deadline (so `now()` inside a callback reads the fire instant, not
|
|
19
19
|
* the advance target). Timers scheduled by a callback fire too if they fall
|
|
20
|
-
* within the same window.
|
|
20
|
+
* within the same window. A {@link Clock.raceTimer} over a promise that
|
|
21
|
+
* settles through a chain still pending loses to the timer, so let that
|
|
22
|
+
* chain settle before advancing.
|
|
21
23
|
*/
|
|
22
24
|
advance(ms: number): void;
|
|
25
|
+
/**
|
|
26
|
+
* Move `now()` by `ms`, backwards when negative, leaving stopwatches and
|
|
27
|
+
* timers where they are: the wall-clock step a time sync or a manual change makes,
|
|
28
|
+
* which a duration taken from two `now()` readings gets wrong.
|
|
29
|
+
*/
|
|
30
|
+
jumpWallClock(ms: number): void;
|
|
31
|
+
/** How many {@link Clock.setTimer} timers have neither fired nor been disposed. */
|
|
32
|
+
pendingTimers(): number;
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
interface FakeTimer {
|
|
@@ -35,72 +45,90 @@ interface FakeTimer {
|
|
|
35
45
|
* (`Date.now` for `now()`, `performance.now()` for the stopwatch); the fake
|
|
36
46
|
* collapses them onto ONE virtual time axis, so a single
|
|
37
47
|
* {@link FakeClock.advance} drives `now()`, every live stopwatch's elapsed, and
|
|
38
|
-
* any due timer together.
|
|
48
|
+
* any due timer together; only {@link FakeClock.jumpWallClock} pulls `now()`
|
|
49
|
+
* off that axis.
|
|
39
50
|
*
|
|
40
51
|
* Server-free and DI-free — lives in `@hydranium/protocol/testing` so every
|
|
41
52
|
* head can bind it without pulling in a server package.
|
|
53
|
+
*
|
|
54
|
+
* The clock is a `SystemClock` with its time replaced, so its methods live on
|
|
55
|
+
* its prototype and a spread of it carries none of them. Replace one by
|
|
56
|
+
* assigning it onto the clock, or layer over the clock with `Object.create`.
|
|
42
57
|
*/
|
|
43
58
|
export function makeFakeClock(options: { now?: number } = {}): FakeClock {
|
|
44
|
-
|
|
45
|
-
|
|
59
|
+
return new VirtualClock(options.now ?? 0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* A `SystemClock` whose time, stopwatches and timers read one virtual axis, so
|
|
64
|
+
* the `measure` and `raceTimer` it inherits run on that axis too.
|
|
65
|
+
*/
|
|
66
|
+
class VirtualClock extends SystemClock implements FakeClock {
|
|
67
|
+
protected readonly timers: FakeTimer[] = [];
|
|
68
|
+
/** What {@link jumpWallClock} has added to `now()`. */
|
|
69
|
+
protected wallClockOffset = 0;
|
|
46
70
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
71
|
+
constructor(protected current: number) {
|
|
72
|
+
super();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
override now(): number {
|
|
76
|
+
return this.current + this.wallClockOffset;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
jumpWallClock(ms: number): void {
|
|
80
|
+
this.wallClockOffset += ms;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
override setTimer(callback: () => void, ms: number): Disposable {
|
|
84
|
+
const timer: FakeTimer = { at: this.current + ms, callback, disposed: false, fired: false };
|
|
85
|
+
this.timers.push(timer);
|
|
86
|
+
return Disposable.create(() => {
|
|
87
|
+
timer.disposed = true;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
override stopwatch(): Stopwatch {
|
|
92
|
+
const read = (): number => this.current;
|
|
93
|
+
const start = read();
|
|
94
|
+
let lastLap = start;
|
|
50
95
|
let stopped: number | undefined;
|
|
51
96
|
return {
|
|
52
97
|
get elapsedMs(): number {
|
|
53
|
-
return (stopped ??
|
|
98
|
+
return (stopped ?? read()) - start;
|
|
54
99
|
},
|
|
55
100
|
lap(): number {
|
|
56
|
-
const at = stopped ??
|
|
101
|
+
const at = stopped ?? read();
|
|
57
102
|
const split = at - lastLap;
|
|
58
103
|
lastLap = at;
|
|
59
104
|
return split;
|
|
60
105
|
},
|
|
61
106
|
stop(): number {
|
|
62
|
-
|
|
63
|
-
stopped = current;
|
|
64
|
-
}
|
|
107
|
+
stopped ??= read();
|
|
65
108
|
return stopped - start;
|
|
66
109
|
}
|
|
67
110
|
};
|
|
68
|
-
}
|
|
111
|
+
}
|
|
69
112
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return (result as Promise<T>).then(value => ({ result: value, elapsedMs: stopwatch.elapsedMs }));
|
|
85
|
-
}
|
|
86
|
-
return { result: result as T, elapsedMs: stopwatch.elapsedMs };
|
|
87
|
-
}) as Clock['measure'],
|
|
88
|
-
advance(ms: number): void {
|
|
89
|
-
const target = current + ms;
|
|
90
|
-
// Fire due timers one at a time, re-scanning after each so a callback
|
|
91
|
-
// that schedules a nearer timer still fires within this window.
|
|
92
|
-
for (;;) {
|
|
93
|
-
const next = timers
|
|
94
|
-
.filter(timer => !timer.disposed && !timer.fired && timer.at <= target)
|
|
95
|
-
.sort((left, right) => left.at - right.at)[0];
|
|
96
|
-
if (!next) {
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
current = next.at;
|
|
100
|
-
next.fired = true;
|
|
101
|
-
next.callback();
|
|
113
|
+
pendingTimers(): number {
|
|
114
|
+
return this.timers.filter(timer => !timer.disposed && !timer.fired).length;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
advance(ms: number): void {
|
|
118
|
+
const target = this.current + ms;
|
|
119
|
+
// Fire due timers one at a time, re-scanning after each so a callback
|
|
120
|
+
// that schedules a nearer timer still fires within this window.
|
|
121
|
+
for (;;) {
|
|
122
|
+
const next = this.timers
|
|
123
|
+
.filter(timer => !timer.disposed && !timer.fired && timer.at <= target)
|
|
124
|
+
.sort((left, right) => left.at - right.at)[0];
|
|
125
|
+
if (!next) {
|
|
126
|
+
break;
|
|
102
127
|
}
|
|
103
|
-
current =
|
|
128
|
+
this.current = next.at;
|
|
129
|
+
next.fired = true;
|
|
130
|
+
next.callback();
|
|
104
131
|
}
|
|
105
|
-
|
|
132
|
+
this.current = target;
|
|
133
|
+
}
|
|
106
134
|
}
|
package/src/testing/harness.ts
CHANGED
|
@@ -22,3 +22,13 @@ export interface Harness {
|
|
|
22
22
|
/** Release every resource the harness holds. Idempotent; the uniform teardown hook. */
|
|
23
23
|
dispose(): void;
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* {@link Harness} for a harness whose teardown has to wait, such as one that
|
|
28
|
+
* deletes a directory only once its server reads none of it. Separate rather
|
|
29
|
+
* than a widened `Harness`, whose callers rely on a synchronous `dispose()`.
|
|
30
|
+
*/
|
|
31
|
+
export interface AsyncHarness {
|
|
32
|
+
/** Release every resource the harness holds, resolving once it has. Idempotent. */
|
|
33
|
+
dispose(): Promise<void>;
|
|
34
|
+
}
|
package/src/testing/index.ts
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
// primitives: `makeFakeClock` (deterministic `Clock` double on one virtual time
|
|
12
12
|
// axis), `waitFor` / `tick`, the client-side data-head doubles
|
|
13
13
|
// (`makeFakeDataPort` / `makeCapturingDataClient`), the translation-catalogue
|
|
14
|
-
// audit (`flattenCatalogue` / `findUndeclaredCodes` / `findSharedCodes`),
|
|
15
|
-
// the `Harness` marker
|
|
14
|
+
// audit (`flattenCatalogue` / `findUndeclaredCodes` / `findSharedCodes`), the
|
|
15
|
+
// transfer-node builder (`makeTransferNodeBuilder`), and the `Harness` marker
|
|
16
16
|
// interface every framework harness extends. Kept out of the main barrel so production bundles don't pull
|
|
17
17
|
// the test scaffolding in by default; adopters opt in by importing from
|
|
18
18
|
// `@hydranium/protocol/testing`.
|
|
19
19
|
//
|
|
20
|
-
// Neutrality is gated (`scripts/check-neutral-bundles.
|
|
20
|
+
// Neutrality is gated (`scripts/check-neutral-bundles.mts`), which is why the
|
|
21
21
|
// duplex transports are NOT here: a `PassThrough` pair is in their exported
|
|
22
22
|
// type, so they cannot be made portable and live at `./testing/node` instead.
|
|
23
23
|
// The same rule the package surface uses — the portable name is the short one.
|
|
@@ -26,4 +26,5 @@ export * from './catalogue-audit';
|
|
|
26
26
|
export * from './data-doubles';
|
|
27
27
|
export * from './fake-clock';
|
|
28
28
|
export * from './harness';
|
|
29
|
+
export * from './transfer-node-builder';
|
|
29
30
|
export * from './wait-for';
|
|
@@ -32,8 +32,9 @@ export function makeDuplexConnectionPair(): DuplexConnectionPair {
|
|
|
32
32
|
const pair = makeDuplexStreamPair();
|
|
33
33
|
const { clientToServer, serverToClient } = pair;
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
const
|
|
35
|
+
// `console`, so a protocol fault on either end shows in the test's output.
|
|
36
|
+
const left = createMessageConnection(new StreamMessageReader(serverToClient), new StreamMessageWriter(clientToServer), console);
|
|
37
|
+
const right = createMessageConnection(new StreamMessageReader(clientToServer), new StreamMessageWriter(serverToClient), console);
|
|
37
38
|
|
|
38
39
|
left.listen();
|
|
39
40
|
right.listen();
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
10
|
// Subpath barrel for `@hydranium/protocol/testing/node` — the test transports
|
|
11
|
-
// that need a Node runtime
|
|
12
|
-
// `MessageConnection` bridge over it.
|
|
11
|
+
// that need a Node runtime, and the capture of `process`'s unhandled rejections.
|
|
13
12
|
//
|
|
14
13
|
// Separate from `./testing` because a `PassThrough` is in `DuplexStreamPair`'s
|
|
15
14
|
// exported type and `StreamMessageReader` comes from `vscode-jsonrpc/node`, so
|
|
@@ -20,3 +19,5 @@
|
|
|
20
19
|
|
|
21
20
|
export * from './duplex-connection';
|
|
22
21
|
export * from './duplex-stream';
|
|
22
|
+
export * from './message-port-pair';
|
|
23
|
+
export * from './unhandled-rejections';
|
|
@@ -0,0 +1,40 @@
|
|
|
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 { MessageChannel } from 'node:worker_threads';
|
|
11
|
+
import type { TransferredMessagePort } from '../../client/post-message-transport';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The two ends of a `worker_threads` `MessageChannel`, typed as the transferred
|
|
15
|
+
* browser ports `createMessagePortTransport` takes. Node's port clones and keeps
|
|
16
|
+
* order as a browser's does, which is what lets a headless test stand in for a
|
|
17
|
+
* worker.
|
|
18
|
+
*
|
|
19
|
+
* `dispose` closes both ports. Node reports that as a close and a browser port
|
|
20
|
+
* reports nothing, so a test that asserts on a close does so before teardown.
|
|
21
|
+
*/
|
|
22
|
+
export interface MessagePortPair {
|
|
23
|
+
readonly port1: TransferredMessagePort;
|
|
24
|
+
readonly port2: TransferredMessagePort;
|
|
25
|
+
dispose(): void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function makeMessagePortPair(): MessagePortPair {
|
|
29
|
+
const channel = new MessageChannel();
|
|
30
|
+
return {
|
|
31
|
+
// Node's port satisfies the structural type at runtime; the cast records
|
|
32
|
+
// one platform's port standing in for the other's.
|
|
33
|
+
port1: channel.port1 as unknown as TransferredMessagePort,
|
|
34
|
+
port2: channel.port2 as unknown as TransferredMessagePort,
|
|
35
|
+
dispose(): void {
|
|
36
|
+
channel.port1.close();
|
|
37
|
+
channel.port2.close();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
/**
|
|
11
|
+
* Run a Node-only assertion while collecting process-level unhandled rejection
|
|
12
|
+
* events. The callback owns the event-loop drain and can therefore choose the
|
|
13
|
+
* right observation window for the operation under test.
|
|
14
|
+
*
|
|
15
|
+
* Inside the window a rejection reaches only the array: while any listener is
|
|
16
|
+
* registered, Node hands none to its default handler and Vitest reports none as
|
|
17
|
+
* an error. A callback that never asserts on the array therefore hides every
|
|
18
|
+
* rejection it provokes.
|
|
19
|
+
*/
|
|
20
|
+
export async function captureUnhandledRejections<T>(callback: (rejections: unknown[]) => Promise<T>): Promise<T> {
|
|
21
|
+
const rejections: unknown[] = [];
|
|
22
|
+
const listener = (reason: unknown): void => {
|
|
23
|
+
rejections.push(reason);
|
|
24
|
+
};
|
|
25
|
+
process.on('unhandledRejection', listener);
|
|
26
|
+
try {
|
|
27
|
+
return await callback(rejections);
|
|
28
|
+
} finally {
|
|
29
|
+
process.off('unhandledRejection', listener);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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 type { TransferElement } from '../transfer-element';
|
|
11
|
+
import type { ConcreteTypeName, SingleTypeName } from '../types';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The per-type constant the generated transfer model emits under each type's
|
|
15
|
+
* name, as Langium does for the AST. Its `$type` literal picks the interface
|
|
16
|
+
* out of the builder's type map.
|
|
17
|
+
*/
|
|
18
|
+
export interface TransferTypeConstant<TType extends string = string> {
|
|
19
|
+
readonly $type: TType;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* What {@link makeTransferNodeBuilder} reads from a reflection: each type's
|
|
24
|
+
* grammar properties and their defaults. The generated
|
|
25
|
+
* `<LanguageId>TransferReflection` satisfies it without importing it, and
|
|
26
|
+
* keeps the literal type of its `types` so the builder can tell which fields
|
|
27
|
+
* the grammar defaults.
|
|
28
|
+
*/
|
|
29
|
+
export interface TransferReflection {
|
|
30
|
+
getTypeMetaData(type: string): { readonly properties: Readonly<Record<string, { readonly defaultValue?: unknown }>> };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The properties of `TType` that `TReflection`'s literal `types` gives a `defaultValue`; none for a reflection typed only as the interface. */
|
|
34
|
+
type DefaultedKeys<TReflection, TType> = TReflection extends { readonly types: infer Types }
|
|
35
|
+
? TType extends keyof Types
|
|
36
|
+
? Types[TType] extends { readonly properties: infer Properties }
|
|
37
|
+
? { [K in keyof Properties]: Properties[K] extends { readonly defaultValue: unknown } ? K : never }[keyof Properties]
|
|
38
|
+
: never
|
|
39
|
+
: never
|
|
40
|
+
: never;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Init payload of a {@link TransferNodeBuilder}: every field of `T` as its
|
|
44
|
+
* interface declares it, except that the fields named by `TDefaulted`, which
|
|
45
|
+
* the grammar defaults, are optional. `$type` comes from the constant.
|
|
46
|
+
*/
|
|
47
|
+
export type TransferNodeInit<T extends TransferElement, TDefaulted extends PropertyKey = never> = Omit<T, '$type' | TDefaulted> &
|
|
48
|
+
Partial<Pick<T, Extract<TDefaulted, keyof T>>>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Transfer-node factory bound to a grammar's type map, the transfer twin of
|
|
52
|
+
* core's `AstNodeBuilder`. `TMap` is the generated `<LanguageId>TransferTypes`,
|
|
53
|
+
* `TReflection` the type of the generated reflection.
|
|
54
|
+
*/
|
|
55
|
+
export interface TransferNodeBuilder<TMap, TReflection extends TransferReflection = TransferReflection> {
|
|
56
|
+
/** A complete node: the grammar's defaults, then `init`. */
|
|
57
|
+
<TType extends ConcreteTypeName<TMap>>(
|
|
58
|
+
typeConstant: TransferTypeConstant<TType> & SingleTypeName<TType>,
|
|
59
|
+
init: TransferNodeInit<Extract<TMap[TType], TransferElement>, DefaultedKeys<TReflection, TType>>
|
|
60
|
+
): Extract<TMap[TType], TransferElement>;
|
|
61
|
+
/**
|
|
62
|
+
* A node holding only `init`, with no defaults filled, typed as the
|
|
63
|
+
* incomplete node it is.
|
|
64
|
+
*/
|
|
65
|
+
partial<TType extends ConcreteTypeName<TMap>>(
|
|
66
|
+
typeConstant: TransferTypeConstant<TType> & SingleTypeName<TType>,
|
|
67
|
+
init?: Partial<Omit<Extract<TMap[TType], TransferElement>, '$type'>>
|
|
68
|
+
): Partial<Extract<TMap[TType], TransferElement>> & TransferTypeConstant<TType>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Bind a {@link TransferNodeBuilder} to a grammar's reflection, so a test names
|
|
73
|
+
* only the fields it cares about and a containment field the grammar gains
|
|
74
|
+
* later needs no change at the call site.
|
|
75
|
+
*
|
|
76
|
+
* Defaults come from the reflection's grammar metadata alone, so a derived
|
|
77
|
+
* field the overlay adds is never defaulted, and stays required. An array
|
|
78
|
+
* default is a fresh `[]` per node. An init field named as `undefined` keeps
|
|
79
|
+
* its default, since the init type cannot refuse `undefined` for an optional
|
|
80
|
+
* field and a plain assign would leave the node typed complete without it.
|
|
81
|
+
*
|
|
82
|
+
* The constant's `$type` is written after `init`, because the init type keeps
|
|
83
|
+
* out only a `$type` written in the call: a spread of another node passes the
|
|
84
|
+
* check and would otherwise hand back a node typed as one type and tagged as
|
|
85
|
+
* another.
|
|
86
|
+
*/
|
|
87
|
+
export function makeTransferNodeBuilder<TMap, TReflection extends TransferReflection = TransferReflection>(
|
|
88
|
+
reflection: TReflection
|
|
89
|
+
): TransferNodeBuilder<TMap, TReflection> {
|
|
90
|
+
const build = (typeConstant: TransferTypeConstant, init: object): object => {
|
|
91
|
+
const node: Record<string, unknown> = { $type: typeConstant.$type };
|
|
92
|
+
for (const [name, property] of Object.entries(reflection.getTypeMetaData(typeConstant.$type).properties)) {
|
|
93
|
+
if (property.defaultValue !== undefined) {
|
|
94
|
+
node[name] = Array.isArray(property.defaultValue) ? [...property.defaultValue] : property.defaultValue;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
for (const [name, value] of Object.entries(init)) {
|
|
98
|
+
if (value !== undefined || !Object.hasOwn(node, name)) {
|
|
99
|
+
node[name] = value;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
node.$type = typeConstant.$type;
|
|
103
|
+
return node;
|
|
104
|
+
};
|
|
105
|
+
const partial = (typeConstant: TransferTypeConstant, init: object = {}): object => ({ ...init, $type: typeConstant.$type });
|
|
106
|
+
return Object.assign(build, { partial }) as TransferNodeBuilder<TMap, TReflection>;
|
|
107
|
+
}
|
package/src/testing/wait-for.ts
CHANGED
|
@@ -33,13 +33,19 @@ export interface WaitForOptions {
|
|
|
33
33
|
readonly timeoutMs?: number;
|
|
34
34
|
/** Poll the predicate every this-many milliseconds. Default 5. */
|
|
35
35
|
readonly intervalMs?: number;
|
|
36
|
-
/**
|
|
37
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Error message on timeout, and when the predicate throws. A function is
|
|
38
|
+
* called only then, so it can report the state the wait ended on; when it
|
|
39
|
+
* throws, the default text is used, with its throw as the error's `cause`
|
|
40
|
+
* unless the predicate threw. Default a generic phrasing.
|
|
41
|
+
*/
|
|
42
|
+
readonly message?: string | (() => string);
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
/**
|
|
41
46
|
* Resolve once `predicate()` returns true, polling at `intervalMs`; reject with
|
|
42
|
-
* `message` once `timeoutMs` elapses
|
|
47
|
+
* `message` once `timeoutMs` elapses, or at once when the predicate throws, with
|
|
48
|
+
* the throw as the error's `cause`. The **non-racy** alternative to a fixed
|
|
43
49
|
* sleep for awaiting an asynchronous side effect that lands on an observable
|
|
44
50
|
* value.
|
|
45
51
|
*
|
|
@@ -56,20 +62,62 @@ export interface WaitForOptions {
|
|
|
56
62
|
export function waitFor(predicate: () => boolean, options: WaitForOptions = {}): Promise<void> {
|
|
57
63
|
const timeoutMs = options.timeoutMs ?? 2000;
|
|
58
64
|
const intervalMs = options.intervalMs ?? 5;
|
|
59
|
-
const
|
|
60
|
-
if (predicate()) {
|
|
61
|
-
return Promise.resolve();
|
|
62
|
-
}
|
|
65
|
+
const defaultMessage = `Timed out after ${timeoutMs}ms waiting for a condition`;
|
|
63
66
|
return new Promise<void>((resolve, reject) => {
|
|
64
|
-
|
|
67
|
+
// A throw from the predicate or the message function would leave the
|
|
68
|
+
// promise unsettled from the poll's or the deadline's timer, or escape
|
|
69
|
+
// `waitFor` itself on the first check; it rejects instead, with the
|
|
70
|
+
// predicate's throw, else the message function's, as cause. True once
|
|
71
|
+
// the promise is settled.
|
|
72
|
+
const settle = (timedOut: boolean): boolean => {
|
|
73
|
+
let met = false;
|
|
74
|
+
let threw = false;
|
|
75
|
+
let cause: unknown;
|
|
76
|
+
try {
|
|
77
|
+
met = predicate();
|
|
78
|
+
} catch (error: unknown) {
|
|
79
|
+
threw = true;
|
|
80
|
+
cause = error;
|
|
81
|
+
}
|
|
82
|
+
if (met) {
|
|
83
|
+
resolve();
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
if (!timedOut && !threw) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
let message = defaultMessage;
|
|
90
|
+
try {
|
|
91
|
+
if (typeof options.message === 'function') {
|
|
92
|
+
message = options.message();
|
|
93
|
+
} else if (options.message !== undefined) {
|
|
94
|
+
message = options.message;
|
|
95
|
+
}
|
|
96
|
+
} catch (error: unknown) {
|
|
97
|
+
if (!threw) {
|
|
98
|
+
threw = true;
|
|
99
|
+
cause = error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
reject(new Error(message, threw ? { cause } : undefined));
|
|
103
|
+
return true;
|
|
104
|
+
};
|
|
105
|
+
if (settle(false)) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const stop = (): void => {
|
|
65
109
|
clearInterval(poll);
|
|
66
|
-
|
|
110
|
+
clearTimeout(deadline);
|
|
111
|
+
};
|
|
112
|
+
// A stalled loop can run the deadline after the condition came true but
|
|
113
|
+
// before the next poll saw it, so the deadline checks once more.
|
|
114
|
+
const deadline = setTimeout(() => {
|
|
115
|
+
settle(true);
|
|
116
|
+
stop();
|
|
67
117
|
}, timeoutMs);
|
|
68
118
|
const poll = setInterval(() => {
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
clearTimeout(deadline);
|
|
72
|
-
resolve();
|
|
119
|
+
if (settle(false)) {
|
|
120
|
+
stop();
|
|
73
121
|
}
|
|
74
122
|
}, intervalMs);
|
|
75
123
|
});
|
package/src/tracer.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { Format, Logger, type LogThreshold } from './logger';
|
|
|
12
12
|
import { NoopLogger } from './noop-logger';
|
|
13
13
|
import { DefaultProfileSession, type ProfileSession } from './profile-session';
|
|
14
14
|
import { Disposable } from './util';
|
|
15
|
+
import { describeErrorWithStack } from './messages/primitives';
|
|
15
16
|
|
|
16
17
|
/** Module-global so nested timers don't reuse ids. */
|
|
17
18
|
let nextTimerId = 0;
|
|
@@ -181,15 +182,10 @@ export class DefaultTracer implements Tracer {
|
|
|
181
182
|
const suffix = this.timingSuffix(status, elapsed, options);
|
|
182
183
|
this.logger[logLevel](`${label} [#${id} ${status}, ${Format.elapsed(elapsed)}${currentExtras()}${suffix}]`);
|
|
183
184
|
if (status === 'failed') {
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
189
|
-
this.logger.warn(`${label} [#${id}] failed: ${detail}`);
|
|
190
|
-
if (error instanceof Error && error.stack) {
|
|
191
|
-
this.logger.debug(error.stack);
|
|
192
|
-
}
|
|
185
|
+
// Reporting the failure is the caller's, who receives it: a line at
|
|
186
|
+
// warn here would exist only while `logLevel` is enabled.
|
|
187
|
+
const detail = describeErrorWithStack(error);
|
|
188
|
+
this.logger.debug(`${label} [#${id}] failed: ${detail}`);
|
|
193
189
|
}
|
|
194
190
|
};
|
|
195
191
|
let result: T;
|
|
@@ -91,6 +91,18 @@ export namespace TransferDiagnostic {
|
|
|
91
91
|
return diagnostic.type === 'parsing-error';
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Whether `diagnostic` is a lexer or parser error, the condition a session
|
|
96
|
+
* refuses a model write over with `DocumentSyntaxError`. A hint only: the
|
|
97
|
+
* server decides on the parse itself, and the diagnostics can lag it or miss
|
|
98
|
+
* an error, as when Langium has no position for a parser error or the
|
|
99
|
+
* validation skipped its built-in checks. A blank document takes the write,
|
|
100
|
+
* since it has no text to lose.
|
|
101
|
+
*/
|
|
102
|
+
export function isSyntaxError(diagnostic: TransferDiagnostic): boolean {
|
|
103
|
+
return diagnostic.type === 'lexing-error' || diagnostic.type === 'parsing-error';
|
|
104
|
+
}
|
|
105
|
+
|
|
94
106
|
/**
|
|
95
107
|
* The diagnostic as a renderable message, for a surface that translates.
|
|
96
108
|
* `undefined` when it carries no framework identity — a syntactic error, an
|
|
@@ -129,4 +141,9 @@ export namespace TransferDiagnostic {
|
|
|
129
141
|
export function hasParseErrors(diagnostics: TransferDiagnostic[]): boolean {
|
|
130
142
|
return diagnostics.some(isParseError);
|
|
131
143
|
}
|
|
144
|
+
|
|
145
|
+
/** Whether any of `diagnostics` is a syntax error, with the limits {@link isSyntaxError} names. */
|
|
146
|
+
export function hasSyntaxErrors(diagnostics: TransferDiagnostic[]): boolean {
|
|
147
|
+
return diagnostics.some(isSyntaxError);
|
|
148
|
+
}
|
|
132
149
|
}
|