@hydranium/protocol 1.0.0-next.357 → 1.0.0-next.359
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client/data-connection.d.ts +1 -0
- package/lib/client/data-connection.d.ts.map +1 -1
- package/lib/client/data-connection.js +1 -0
- package/lib/client/data-connection.js.map +1 -1
- package/lib/client/data-events.d.ts +1 -0
- package/lib/client/data-events.d.ts.map +1 -1
- package/lib/client/data-events.js +1 -0
- package/lib/client/data-events.js.map +1 -1
- package/lib/client/data-session.d.ts +7 -0
- package/lib/client/data-session.d.ts.map +1 -1
- package/lib/client/data-session.js +7 -0
- package/lib/client/data-session.js.map +1 -1
- package/lib/client/message-relay.d.ts +2 -0
- package/lib/client/message-relay.d.ts.map +1 -1
- package/lib/client/message-relay.js.map +1 -1
- package/lib/client/post-message-transport.d.ts +5 -0
- package/lib/client/post-message-transport.d.ts.map +1 -1
- package/lib/client/post-message-transport.js.map +1 -1
- package/lib/client/rpc-connection.d.ts +16 -0
- package/lib/client/rpc-connection.d.ts.map +1 -1
- package/lib/client/rpc-connection.js +12 -1
- package/lib/client/rpc-connection.js.map +1 -1
- package/lib/client/worker-handshake.d.ts +4 -0
- package/lib/client/worker-handshake.d.ts.map +1 -1
- package/lib/client/worker-handshake.js.map +1 -1
- package/lib/data/data-server-protocol.d.ts +2 -1
- package/lib/data/data-server-protocol.d.ts.map +1 -1
- package/lib/data/events.d.ts +14 -19
- package/lib/data/events.d.ts.map +1 -1
- package/lib/data/requests.d.ts +5 -0
- package/lib/data/requests.d.ts.map +1 -1
- package/lib/debouncer.d.ts +4 -1
- package/lib/debouncer.d.ts.map +1 -1
- package/lib/debouncer.js +4 -1
- package/lib/debouncer.js.map +1 -1
- package/lib/errors.d.ts +5 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -0
- package/lib/errors.js.map +1 -1
- package/lib/glsp-edits-settled-actions.d.ts +2 -0
- package/lib/glsp-edits-settled-actions.d.ts.map +1 -1
- package/lib/glsp-edits-settled-actions.js.map +1 -1
- package/lib/glsp-save-model-actions.d.ts +5 -0
- package/lib/glsp-save-model-actions.d.ts.map +1 -1
- package/lib/glsp-save-model-actions.js.map +1 -1
- package/lib/latency-collector.d.ts +2 -0
- 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/pending-work-tracker.d.ts +1 -0
- package/lib/pending-work-tracker.d.ts.map +1 -1
- package/lib/pending-work-tracker.js +1 -0
- package/lib/pending-work-tracker.js.map +1 -1
- package/lib/profile-session.d.ts +11 -1
- package/lib/profile-session.d.ts.map +1 -1
- package/lib/profile-session.js +10 -1
- 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/reconcile-write.d.ts +3 -0
- package/lib/reconcile-write.d.ts.map +1 -1
- package/lib/reconcile-write.js.map +1 -1
- package/lib/transfer-document.d.ts +2 -1
- package/lib/transfer-document.d.ts.map +1 -1
- package/lib/transfer-document.js.map +1 -1
- package/package.json +1 -1
- package/src/client/data-connection.ts +1 -0
- package/src/client/data-events.ts +1 -0
- package/src/client/data-session.ts +7 -0
- package/src/client/message-relay.ts +2 -0
- package/src/client/post-message-transport.ts +5 -0
- package/src/client/rpc-connection.ts +22 -1
- package/src/client/worker-handshake.ts +4 -0
- package/src/data/data-server-protocol.ts +2 -1
- package/src/data/events.ts +14 -19
- package/src/data/requests.ts +5 -0
- package/src/debouncer.ts +4 -1
- package/src/errors.ts +5 -0
- package/src/glsp-edits-settled-actions.ts +2 -0
- package/src/glsp-save-model-actions.ts +5 -0
- package/src/latency-collector.ts +2 -0
- package/src/pending-work-tracker.ts +1 -0
- package/src/profile-session.ts +11 -1
- package/src/profiling.ts +15 -2
- package/src/reconcile-write.ts +3 -0
- package/src/transfer-document.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-session.d.ts","sourceRoot":"","sources":["../src/profile-session.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAU,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7D,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC3B,2DAA2D;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,cAAc;IAC5B;;;;;;;OAOG;IACH,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvD,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAErC;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAEtC,8EAA8E;IAC9E,OAAO,IAAI,SAAS,aAAa,EAAE,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,cAAc;
|
|
1
|
+
{"version":3,"file":"profile-session.d.ts","sourceRoot":"","sources":["../src/profile-session.ts"],"names":[],"mappings":"AAAA;;;;;;;k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,CAAC;IAC/C;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,EAAE,CAAM;IACnD,iGAAiG;IACjG,SAAS,CAAC,QAAQ,CAAC,OAAO,wBAA+B;IAEzD,YACsB,MAAM,EAAE,MAAM,EACjC,KAAK,EAAE,KAAK,EACO,UAAU,EAAE,MAAM,EAGvC;IAED,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvD,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IA2BrC;;;OAGG;IACH,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAcnD;IAED,OAAO,IAAI,SAAS,aAAa,EAAE,CAQlC;IAED,MAAM,CAAC,QAAQ,GAAE,YAAsB,GAAG,IAAI,CAgB7C;CACH"}
|
package/lib/profile-session.js
CHANGED
|
@@ -20,7 +20,13 @@ class DefaultProfileSession {
|
|
|
20
20
|
identifier;
|
|
21
21
|
/** Single monotonic timeline for the whole session; per-scope readings are deltas off it. */
|
|
22
22
|
sessionStopwatch;
|
|
23
|
+
/**
|
|
24
|
+
* The scopes in flight, innermost last. They must end innermost first:
|
|
25
|
+
* {@link closeFrame} pops the top frame whichever scope ends, so
|
|
26
|
+
* overlapping async scopes misattribute their time.
|
|
27
|
+
*/
|
|
23
28
|
stack = [];
|
|
29
|
+
/** Self-time in milliseconds per id, one sample per closed scope, which {@link records} sums. */
|
|
24
30
|
entries = new Map();
|
|
25
31
|
constructor(logger, clock, identifier) {
|
|
26
32
|
this.logger = logger;
|
|
@@ -50,7 +56,10 @@ class DefaultProfileSession {
|
|
|
50
56
|
this.closeFrame(frame);
|
|
51
57
|
return result;
|
|
52
58
|
}
|
|
53
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Pop the top frame, which is `frame` when scopes end innermost first,
|
|
61
|
+
* charge its full duration to the new top, and record its self-time.
|
|
62
|
+
*/
|
|
54
63
|
closeFrame(frame) {
|
|
55
64
|
this.stack.pop();
|
|
56
65
|
const duration = this.sessionStopwatch.elapsedMs - frame.start;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-session.js","sourceRoot":"","sources":["../src/profile-session.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAGlF,qCAA6D;
|
|
1
|
+
{"version":3,"file":"profile-session.js","sourceRoot":"","sources":["../src/profile-session.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAGlF,qCAA6D;AAoE7D;;;;GAIG;AACH;IAayB,MAAM;IAEN,UAAU;IAdhC,6FAA6F;IAC1E,gBAAgB,CAAY;IAC/C;;;;OAIG;IACgB,KAAK,GAAwB,EAAE,CAAC;IACnD,iGAAiG;IAC9E,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;IAEzD,YACsB,MAAc,EACjC,KAAY,EACO,UAAkB;sBAFlB,MAAM;0BAEN,UAAU;QAE7B,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;IAC7C,CAAC;IAID,KAAK,CAAI,EAAU,EAAE,EAAwB;QAC1C,MAAM,KAAK,GAAsB,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;QAC5F,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,MAAsB,CAAC;QAC3B,IAAI,CAAC;YACF,MAAM,GAAG,EAAE,EAAE,CAAC;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACd,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACvB,MAAM,KAAK,CAAC;QACf,CAAC;QACD,IAAI,MAAM,YAAY,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QACtI,CAAC;QACD,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC5E,MAAM,aAAa,GAAG,OAAO,GAAG,WAAW,CAAC;QAC5C,IAAI,aAAa,IAAI,GAAG,EAAE,CAAC;YACxB,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,aAAa,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1E,IAAI,CAAC,YAAY,IAAI,CAAC,UAAU,mBAAmB,GAAG,KAAK,eAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QAC/F,CAAC;IACJ,CAAC;CACH"}
|
package/lib/profiling.d.ts
CHANGED
|
@@ -8,15 +8,23 @@
|
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
/** Which dimensions to capture, and the two sampling knobs. All off by default. */
|
|
10
10
|
export interface ProfileCaptureOptions {
|
|
11
|
+
/** Sample the CPU at {@link cpuIntervalMicros} into a `server-cpu` artefact. */
|
|
11
12
|
cpu?: boolean;
|
|
13
|
+
/** Sample allocations at {@link allocationIntervalBytes} into a `server-alloc` artefact. */
|
|
12
14
|
allocation?: boolean;
|
|
15
|
+
/** Record every GC pause, summed by kind in `server-summary` rather than as its own artefact. */
|
|
13
16
|
gc?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Sample event-loop delay, summarised as mean, p50, p99 and max in
|
|
19
|
+
* `server-summary` rather than as its own artefact. Absent there when the
|
|
20
|
+
* sampler recorded nothing.
|
|
21
|
+
*/
|
|
14
22
|
eventLoopDelay?: boolean;
|
|
15
23
|
/** Also drop a retained `.heapsnapshot` at stop (for the memory analyzer). */
|
|
16
24
|
heapSnapshot?: boolean;
|
|
17
|
-
/** CPU sampling interval in µs (implementation default
|
|
25
|
+
/** CPU sampling interval in µs (implementation default `DEFAULT_CPU_INTERVAL_MICROS`). */
|
|
18
26
|
cpuIntervalMicros?: number;
|
|
19
|
-
/** Allocation sampling interval in bytes (implementation default
|
|
27
|
+
/** Allocation sampling interval in bytes (implementation default `DEFAULT_ALLOCATION_INTERVAL_BYTES`). */
|
|
20
28
|
allocationIntervalBytes?: number;
|
|
21
29
|
}
|
|
22
30
|
export declare const PROFILING_SCHEMA_VERSION = 1;
|
|
@@ -39,12 +47,17 @@ export interface ProfilingArtifact {
|
|
|
39
47
|
}
|
|
40
48
|
/** What a skill reads to know what to expect from a run (browser entries only in `app` mode, etc.). */
|
|
41
49
|
export interface ProfilingEnvironment {
|
|
50
|
+
/** `harness` for a headless run, `app` for one that drove the real app. */
|
|
42
51
|
mode: 'harness' | 'app';
|
|
43
52
|
/** Whether a cgroup memory controller is present (running in a pod) vs local. */
|
|
44
53
|
container: boolean;
|
|
54
|
+
/** The commit the run reflects, which a finding's `file:line` is read against. Absent when the caller named none. */
|
|
45
55
|
commit?: string;
|
|
56
|
+
/** The workspace under test as the caller named it. Absent when it named none. */
|
|
46
57
|
workspace?: string;
|
|
58
|
+
/** The `process.version` of the process that wrote the manifest, which for an e2e run is the test runner, not the server. */
|
|
47
59
|
node: string;
|
|
60
|
+
/** Captured windows in capture order, each with its duration in milliseconds. */
|
|
48
61
|
windows: {
|
|
49
62
|
label: string;
|
|
50
63
|
ms: number;
|
package/lib/profiling.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiling.d.ts","sourceRoot":"","sources":["../src/profiling.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAUlF,mFAAmF;AACnF,MAAM,WAAW,qBAAqB;IACnC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,C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C,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6HAA6H;IAC7H,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC3C;AAED,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAC/B;;;;;OAKG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,WAAW,EAAE,oBAAoB,CAAC;IAClC;;;;;OAKG;IACH,SAAS,EAAE,iBAAiB,EAAE,CAAC;CACjC"}
|
package/lib/profiling.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiling.js","sourceRoot":"","sources":["../src/profiling.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;
|
|
1
|
+
{"version":3,"file":"profiling.js","sourceRoot":"","sources":["../src/profiling.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAgClF;;;;;;GAMG;AAEU,QAAA,wBAAwB,GAAG,CAAC,CAAC"}
|
package/lib/reconcile-write.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export interface ReconcileWriteHooks<TModel> {
|
|
|
30
30
|
refetch(): Promise<VersionedModel<TModel> | undefined>;
|
|
31
31
|
/** The last in-sync model the user's intent is measured against. */
|
|
32
32
|
readonly base: TModel;
|
|
33
|
+
/** Asked for each conflict while writes remain. Its refetch callback runs {@link refetch} only when called. */
|
|
33
34
|
readonly conflictResolver: ConflictResolver;
|
|
34
35
|
/** Writes, the first included, after which a still-conflicting edit is dropped; 3 when absent. */
|
|
35
36
|
readonly maxWrites?: number;
|
|
@@ -54,7 +55,9 @@ export type ReconcileWriteOutcome =
|
|
|
54
55
|
* {@link ReconcileWriteHooks.onUnavailable} ran.
|
|
55
56
|
*/
|
|
56
57
|
readonly status: 'merged' | 'already-applied' | 'unchanged' | 'conflict' | 'dropped' | 'unavailable';
|
|
58
|
+
/** The last conflict a write raised, which on `merged` is the one before the write that landed. */
|
|
57
59
|
readonly conflict: ConflictError;
|
|
60
|
+
/** Writes made, the first included. `dropped` is reported once they reach {@link ReconcileWriteHooks.maxWrites}. */
|
|
58
61
|
readonly writes: number;
|
|
59
62
|
};
|
|
60
63
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile-write.d.ts","sourceRoot":"","sources":["../src/reconcile-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,aAAa,EAAmB,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAItD,6FAA6F;AAC7F,MAAM,WAAW,cAAc,CAAC,MAAM;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;CACrC;AAED,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB,CAAC,MAAM;IACxC;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE;;;;OAIG;IACH,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC;IACvD,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,kGAAkG;IAClG,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,gFAAgF;IAChF,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,QA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O,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC;IACvD,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+GAA+G;IAC/G,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,kGAAkG;IAClG,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,gFAAgF;IAChF,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB;AAC9B,8BAA8B;AAC5B;IAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GAChC;IACG;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,iBAAiB,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,CAAC;IACrG,mGAAmG;IACnG,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,oHAAoH;IACpH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEP;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,MAAM,SAAS,MAAM,EACvD,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAClC,OAAO,CAAC,qBAAqB,CAAC,CAmChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile-write.js","sourceRoot":"","sources":["../src/reconcile-write.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,qCAA+D;AAI/D,MAAM,kBAAkB,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"reconcile-write.js","sourceRoot":"","sources":["../src/reconcile-write.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,qCAA+D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S;YACZ,KAAK,iBAAiB;gBACnB,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;YAC1D,KAAK,OAAO;gBACT,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;YACpD,KAAK,UAAU;gBACZ,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;YACnD,KAAK,aAAa;gBACf,MAAM,KAAK,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAC7C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QACzD,CAAC;IACJ,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,KAAK,UAAU,iBAAiB,CAC7B,KAAkC,EAClC,KAAa,EACb,WAAwB;IAExB,IAAI,CAAC;QACF,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACxC,OAAO,SAAS,CAAC;IACpB,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACrB,IAAI,CAAC,IAAA,wBAAe,EAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,GAAG,CAAC;QACb,CAAC;QACD,OAAO,GAAG,CAAC;IACd,CAAC;AACJ,CAAC"}
|
|
@@ -59,6 +59,7 @@ export interface TextState {
|
|
|
59
59
|
* see {@link TransferElement}).
|
|
60
60
|
*/
|
|
61
61
|
export interface TransferDocument<TTransfer extends TransferElement, TDiagnostic = TransferDiagnostic> {
|
|
62
|
+
/** Need not be spelled as the request named it. */
|
|
62
63
|
uri: string;
|
|
63
64
|
/**
|
|
64
65
|
* Absent when the document does not exist: the server answers an unknown
|
|
@@ -103,7 +104,7 @@ export type TransferCreatedDocument<TTransfer extends TransferElement, TDiagnost
|
|
|
103
104
|
};
|
|
104
105
|
/** What a watch answers, once it is in place. */
|
|
105
106
|
export interface TransferWatchedDocument {
|
|
106
|
-
/** The key the watch's events name the document by, which
|
|
107
|
+
/** The key the watch's events name the document by, which need not be the spelling the watch was asked with. */
|
|
107
108
|
readonly uri: string;
|
|
108
109
|
/** Whether a document exists there; one the server fails to load counts, only a missing one does not. */
|
|
109
110
|
readonly exists: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer-document.d.ts","sourceRoot":"","sources":["../src/transfer-document.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAkB,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEnG,0EAA0E;AAC1E,MAAM,WAAW,qBAAqB,CAAC,KAAK,SAAS,eAAe,EAAE,WAAW,GAAG,kBAAkB;IACnG,IAAI,EAAE,KAAK,CAAC;IACZ,qFAAqF;IACrF,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAC5B;;;;OAIG;IACH,OAAO,EAAE,YAAY,CAAC;IACtB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;CACf;AAED,kEAAkE;AAClE,MAAM,WAAW,SAAS;IACvB;;;;OAIG;IACH,OAAO,EAAE,WAAW,CAAC;IACrB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB,CAAC,SAAS,SAAS,eAAe,EAAE,WAAW,GAAG,kBAAkB;IAClG,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,KAAK,CAAC,EAAE,qBAAqB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACtD,6DAA6D;IAC7D,IAAI,CAAC,EAAE,SAAS,CAAC;CAC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C"}
|
package/package.json
CHANGED
|
@@ -143,6 +143,7 @@ export class DataConnection<
|
|
|
143
143
|
TServer extends DataServerProtocol<TTransfer, DiagnosticOf<TServer>> = DataServerProtocol<TTransfer>,
|
|
144
144
|
TClient extends object = DataClientProtocol<TTransfer>
|
|
145
145
|
> extends RpcConnection<TServer, TClient> {
|
|
146
|
+
/** Backs {@link liveSessions}, and is what {@link createSession} checks a new id against. */
|
|
146
147
|
protected readonly sessions = new Set<DataSession<TTransfer, TServer>>();
|
|
147
148
|
protected readonly sessionFactory: DataSessionFactory<TTransfer, TServer>;
|
|
148
149
|
protected readonly createSessionEmitter = new Emitter<DataSession<TTransfer, TServer>>();
|
|
@@ -416,7 +416,9 @@ export class DataSession<
|
|
|
416
416
|
protected readonly resumeToken: string = randomUuid();
|
|
417
417
|
/** The proxy the session is registered on; another one means the connection was replaced. */
|
|
418
418
|
protected registeredOn?: RpcProxy<TServer>;
|
|
419
|
+
/** The registration on {@link registeredOn}, which {@link connected} awaits. Replaced when the proxy changes. */
|
|
419
420
|
protected registration?: Promise<void>;
|
|
421
|
+
/** Set by {@link dispose} or {@link detach}, whichever comes first, after which {@link assertLive} throws. */
|
|
420
422
|
protected disposed = false;
|
|
421
423
|
/**
|
|
422
424
|
* Disposed through {@link detach} rather than {@link dispose}, so nothing may
|
|
@@ -1552,6 +1554,11 @@ export class DataSession<
|
|
|
1552
1554
|
await this.clock.raceTimer(Promise.all(pending.map(tracker => tracker.whenSettled())), this.settleBeforeCloseMs);
|
|
1553
1555
|
}
|
|
1554
1556
|
|
|
1557
|
+
/**
|
|
1558
|
+
* Throw a `SessionClosedError` once the session has ended. {@link connected}
|
|
1559
|
+
* runs it again after each of its waits, since a session disposed during
|
|
1560
|
+
* one would otherwise register or send after the close.
|
|
1561
|
+
*/
|
|
1555
1562
|
protected assertLive(): void {
|
|
1556
1563
|
if (this.disposed) {
|
|
1557
1564
|
throw new SessionClosedError(this.clientId);
|
|
@@ -41,7 +41,9 @@ export const RELAY_REPLAY_FAILED = defineMessage(
|
|
|
41
41
|
* only who owns the framing, which is why this tier never needs to know.
|
|
42
42
|
*/
|
|
43
43
|
export interface RelayTransport {
|
|
44
|
+
/** Its close or error fires {@link MessageRelay.onClose}. */
|
|
44
45
|
readonly reader: MessageReader;
|
|
46
|
+
/** A write that rejects is not retried, and whether its message arrived is unknown. */
|
|
45
47
|
readonly writer: MessageWriter;
|
|
46
48
|
/** Release the transport. Called when the relay is disposed. */
|
|
47
49
|
dispose?(): void;
|
|
@@ -75,7 +75,12 @@ export interface PostMessageChannel {
|
|
|
75
75
|
* the same copy of `vscode-jsonrpc`.
|
|
76
76
|
*/
|
|
77
77
|
export interface PostMessageTransport {
|
|
78
|
+
/** Closes only when the channel's `onClose` fires. */
|
|
78
79
|
readonly reader: MessageReader;
|
|
80
|
+
/**
|
|
81
|
+
* A write resolves once the channel's `post` returns, not once the message
|
|
82
|
+
* arrives, and rejects when `post` throws.
|
|
83
|
+
*/
|
|
79
84
|
readonly writer: MessageWriter;
|
|
80
85
|
/**
|
|
81
86
|
* Release the channel subscriptions. A {@link createMessagePortTransport}
|
|
@@ -79,7 +79,17 @@ export interface ResolvedRpcConnectionOptions<TClient extends object> {
|
|
|
79
79
|
* and {@link RpcConnection.awaitReady}, so an override has to name it too.
|
|
80
80
|
*/
|
|
81
81
|
export interface RpcConnectionGeneration<TServer extends object> {
|
|
82
|
+
/**
|
|
83
|
+
* The port's connection. {@link RpcConnection.currentGeneration} reports a
|
|
84
|
+
* rejection to the port. An opened one is disposed by
|
|
85
|
+
* {@link RpcConnection.dropGeneration}, and stays with the port when the
|
|
86
|
+
* generation fails its readiness check.
|
|
87
|
+
*/
|
|
82
88
|
readonly connection: Promise<MessageConnection>;
|
|
89
|
+
/**
|
|
90
|
+
* The proxy over {@link connection}, whose calls queue until it opens. Dead
|
|
91
|
+
* once {@link RpcConnection.dropGeneration} disposes {@link connection}.
|
|
92
|
+
*/
|
|
83
93
|
readonly server: RpcProxy<TServer>;
|
|
84
94
|
/** Set on first use; the shared readiness gate for this generation. */
|
|
85
95
|
ready?: Promise<void>;
|
|
@@ -104,12 +114,17 @@ export interface RpcConnectionGeneration<TServer extends object> {
|
|
|
104
114
|
* call the document methods; nothing at this layer does.
|
|
105
115
|
*/
|
|
106
116
|
export class RpcConnection<TServer extends ReadyServer, TClient extends object> {
|
|
117
|
+
/** The wire prefix of every generation's proxy, fixed for the connection's life. */
|
|
107
118
|
protected readonly methodNamespace: string;
|
|
119
|
+
/** The only methods of {@link localTarget} bound for the server to call, on each new generation. */
|
|
108
120
|
protected readonly clientMethods: readonly (keyof TClient & string)[];
|
|
121
|
+
/** The caller's hooks composed with the port's, so both hear each transition. */
|
|
109
122
|
protected readonly lifecycle: RpcConnectionLifecycle;
|
|
110
123
|
/** The current generation, or `undefined` before the first request / after a teardown. */
|
|
111
124
|
protected generation?: RpcConnectionGeneration<TServer>;
|
|
125
|
+
/** Set by {@link dispose}, after which {@link assertLive} throws. */
|
|
112
126
|
protected disposed = false;
|
|
127
|
+
/** Drops the generation when the port disposes. Released by {@link dispose}. */
|
|
113
128
|
protected readonly portDisposeListener: { dispose(): void };
|
|
114
129
|
|
|
115
130
|
constructor(
|
|
@@ -222,8 +237,10 @@ export class RpcConnection<TServer extends ReadyServer, TClient extends object>
|
|
|
222
237
|
|
|
223
238
|
/** Await the connection and the server's startup gate for one generation. */
|
|
224
239
|
protected async awaitReady(generation: RpcConnectionGeneration<TServer>): Promise<void> {
|
|
240
|
+
let opened = false;
|
|
225
241
|
try {
|
|
226
242
|
await generation.connection;
|
|
243
|
+
opened = true;
|
|
227
244
|
// Dropped meanwhile: writing the request would hit a closed transport.
|
|
228
245
|
if (this.generation !== generation) {
|
|
229
246
|
return;
|
|
@@ -244,7 +261,10 @@ export class RpcConnection<TServer extends ReadyServer, TClient extends object>
|
|
|
244
261
|
if (this.generation === generation) {
|
|
245
262
|
this.generation = undefined;
|
|
246
263
|
}
|
|
247
|
-
|
|
264
|
+
// A connection that never opened is already reported as a failed connect.
|
|
265
|
+
if (opened) {
|
|
266
|
+
this.port.reportError(error, resolve(DATA_SERVER_NOT_READY, { detail: describeError(error) }));
|
|
267
|
+
}
|
|
248
268
|
throw error;
|
|
249
269
|
}
|
|
250
270
|
}
|
|
@@ -273,6 +293,7 @@ export class RpcConnection<TServer extends ReadyServer, TClient extends object>
|
|
|
273
293
|
generation.connection.then(connection => connection.dispose()).catch(() => undefined);
|
|
274
294
|
}
|
|
275
295
|
|
|
296
|
+
/** Throw once disposed, a plain `Error` naming the class rather than a protocol error. */
|
|
276
297
|
protected assertLive(): void {
|
|
277
298
|
if (this.disposed) {
|
|
278
299
|
throw new Error(`${this.constructor.name} is disposed`);
|
|
@@ -63,6 +63,7 @@ export function isWorkerBootstrapMessage(value: unknown): value is WorkerBootstr
|
|
|
63
63
|
export const WORKER_READY_MESSAGE_TYPE = 'hydranium/ready';
|
|
64
64
|
|
|
65
65
|
export interface WorkerReadyMessage {
|
|
66
|
+
/** The only field {@link isWorkerReadyMessage} checks, so {@link workspace} is taken on trust. */
|
|
66
67
|
readonly type: typeof WORKER_READY_MESSAGE_TYPE;
|
|
67
68
|
/** The files the heads came up on, when the worker's host named a root to read them under. */
|
|
68
69
|
readonly workspace?: WorkerWorkspace;
|
|
@@ -74,6 +75,7 @@ export interface WorkerReadyMessage {
|
|
|
74
75
|
* the seed, an editor opened on the seed overwrites the restored document.
|
|
75
76
|
*/
|
|
76
77
|
export interface WorkerWorkspace {
|
|
78
|
+
/** The root the worker's host was given. */
|
|
77
79
|
readonly rootUri: string;
|
|
78
80
|
/** Every file's content, keyed by its path relative to {@link rootUri}. */
|
|
79
81
|
readonly files: Readonly<Record<string, string>>;
|
|
@@ -98,9 +100,11 @@ export const WORKER_ERROR_MESSAGE_TYPE = 'hydranium/worker-error';
|
|
|
98
100
|
export const WORKER_BOOTSTRAP_PHASE = 'bootstrap';
|
|
99
101
|
|
|
100
102
|
export interface WorkerErrorMessage {
|
|
103
|
+
/** The page raises this type too, on its own error event, when the `Worker` fires `error`. */
|
|
101
104
|
readonly type: typeof WORKER_ERROR_MESSAGE_TYPE;
|
|
102
105
|
/** What the worker was doing, {@link WORKER_BOOTSTRAP_PHASE} for a failed bootstrap. */
|
|
103
106
|
readonly phase: string;
|
|
107
|
+
/** The failure described for a log. Never branch on it. */
|
|
104
108
|
readonly message: string;
|
|
105
109
|
}
|
|
106
110
|
|
|
@@ -84,7 +84,8 @@ export interface DocumentServerProtocol<TTransfer extends TransferElement, TDiag
|
|
|
84
84
|
* `created`. The answer is read after the create, so it can already hold
|
|
85
85
|
* another client's write or an integrity repair; a write based on
|
|
86
86
|
* `created.version` then conflicts. It reaches disk with the first save.
|
|
87
|
-
* Fails when the file exists
|
|
87
|
+
* Fails when the file exists, any client has the URI open, or a lost
|
|
88
|
+
* client's unsaved text is held for it, and with a
|
|
88
89
|
* `SessionClosedError` code when `args.clientId` is not a session
|
|
89
90
|
* registered on this connection.
|
|
90
91
|
*/
|
package/src/data/events.ts
CHANGED
|
@@ -44,14 +44,12 @@ export type TransferDocumentUpdateReason = 'changed' | 'rebuilt' | 'saved';
|
|
|
44
44
|
/**
|
|
45
45
|
* Delivered on the data-server when a document's content (or existence)
|
|
46
46
|
* changed. Subscribers receive this via `DocumentServerProtocol.watchModelDocument`.
|
|
47
|
-
*
|
|
48
|
-
* The `document` field carries the latest built state — diagnostics + root
|
|
49
|
-
* are coherent with each other at the time the event fired.
|
|
50
47
|
*/
|
|
51
48
|
export interface TransferDocumentUpdatedEvent<
|
|
52
49
|
TTransfer extends TransferElement,
|
|
53
50
|
TDiagnostic extends TransferDiagnostic = TransferDiagnostic
|
|
54
51
|
> {
|
|
52
|
+
/** The latest built state: diagnostics and root are coherent with each other at the time the event fired. */
|
|
55
53
|
document: TransferDocument<TTransfer, TDiagnostic>;
|
|
56
54
|
/**
|
|
57
55
|
* The client whose write this event echoes: the author of the version on a
|
|
@@ -61,6 +59,7 @@ export interface TransferDocumentUpdatedEvent<
|
|
|
61
59
|
* instead.
|
|
62
60
|
*/
|
|
63
61
|
sourceClientId: string;
|
|
62
|
+
/** See {@link TransferDocumentUpdateReason} for which reasons the framework sends. */
|
|
64
63
|
reason: TransferDocumentUpdateReason;
|
|
65
64
|
/**
|
|
66
65
|
* The position of this event among the update and deletion events the
|
|
@@ -77,29 +76,25 @@ export type TransferDocumentUpdatedListener<
|
|
|
77
76
|
> = (event: TransferDocumentUpdatedEvent<TTransfer, TDiagnostic>) => void;
|
|
78
77
|
|
|
79
78
|
/**
|
|
80
|
-
* Delivered on the data-server when a document was
|
|
81
|
-
*
|
|
82
|
-
* from {@link TransferDocumentUpdatedEvent}: subscribers that only
|
|
83
|
-
* persistence (external sync, editor "saved" indicators,
|
|
84
|
-
* clear) listen for this event family instead of filtering an
|
|
85
|
-
* stream for `reason: 'saved'`.
|
|
86
|
-
*
|
|
87
|
-
* The `document` field carries the post-save built state — same shape
|
|
88
|
-
* the synchronous `saveModelDocument` RPC response returns, delivered
|
|
89
|
-
* to subscribers (`DataClientProtocol.onDocumentSaved`) so non-caller
|
|
90
|
-
* clients see the persistence event too.
|
|
79
|
+
* Delivered on the data-server when a subscribed document was saved to disk,
|
|
80
|
+
* whichever client saved it, an editor's save through the LSP head included.
|
|
81
|
+
* Distinct from {@link TransferDocumentUpdatedEvent}: subscribers that only
|
|
82
|
+
* care about persistence (external sync, editor "saved" indicators,
|
|
83
|
+
* dirty-flag clear) listen for this event family instead of filtering an
|
|
84
|
+
* update stream for `reason: 'saved'`.
|
|
91
85
|
*/
|
|
92
86
|
export interface TransferDocumentSavedEvent<
|
|
93
87
|
TTransfer extends TransferElement,
|
|
94
88
|
TDiagnostic extends TransferDiagnostic = TransferDiagnostic
|
|
95
89
|
> {
|
|
90
|
+
/** The latest built state, taken after the save. */
|
|
96
91
|
document: TransferDocument<TTransfer, TDiagnostic>;
|
|
97
92
|
/**
|
|
98
|
-
* The client whose
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
93
|
+
* The client whose save produced this, also when another client wrote the
|
|
94
|
+
* persisted text: the caller of `saveModelDocument` or
|
|
95
|
+
* `persistModelDocument`, or `LANGUAGE_CLIENT_ID` for an editor's save
|
|
96
|
+
* through the LSP head. Every subscriber receives the event, the saving
|
|
97
|
+
* client included, so compare against your own id to drop the echo.
|
|
103
98
|
*/
|
|
104
99
|
sourceClientId: string;
|
|
105
100
|
}
|
package/src/data/requests.ts
CHANGED
|
@@ -114,6 +114,10 @@ export interface CreateModelDocumentArgs {
|
|
|
114
114
|
export interface TransferUpdateDocumentsArgs<TTransfer> {
|
|
115
115
|
/** The id of a live session registered on this connection. */
|
|
116
116
|
clientId: string;
|
|
117
|
+
/**
|
|
118
|
+
* One entry per document: a set naming one twice, by any spellings that
|
|
119
|
+
* share its canonical URI, is refused.
|
|
120
|
+
*/
|
|
117
121
|
updates: Omit<TransferUpdateDocumentArgs<TTransfer>, 'clientId'>[];
|
|
118
122
|
}
|
|
119
123
|
|
|
@@ -130,6 +134,7 @@ export interface TransferUpdateDocumentsArgs<TTransfer> {
|
|
|
130
134
|
* `clientId`).
|
|
131
135
|
*/
|
|
132
136
|
export interface WatchModelDocumentArgs {
|
|
137
|
+
/** Any spelling that the document URI policy maps to the document. */
|
|
133
138
|
uri: string;
|
|
134
139
|
/** Stable identifier for the watching client. */
|
|
135
140
|
clientId: string;
|
package/src/debouncer.ts
CHANGED
|
@@ -50,7 +50,9 @@ export interface DebouncerOptions {
|
|
|
50
50
|
* than a breaking change.
|
|
51
51
|
*/
|
|
52
52
|
export class Debouncer implements Disposable {
|
|
53
|
+
/** {@link DebouncerOptions.delayMs}, read at each {@link schedule}. An armed timer keeps the delay it was armed with. */
|
|
53
54
|
protected readonly delay: ObservableValue<number>;
|
|
55
|
+
/** {@link DebouncerOptions.maxWaitMs}, fixed at construction unlike {@link delay}. */
|
|
54
56
|
protected readonly maxWaitMs?: number;
|
|
55
57
|
protected timer?: Disposable;
|
|
56
58
|
/** Running since the first {@link schedule} of the current pending window; drives {@link DebouncerOptions.maxWaitMs}. */
|
|
@@ -87,7 +89,7 @@ export class Debouncer implements Disposable {
|
|
|
87
89
|
this.timer = this.clock.setTimer(() => this.fire(), wait);
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
/**
|
|
92
|
+
/** Run {@link fn} now if a fire is pending, clearing the window first, and do nothing otherwise. */
|
|
91
93
|
flush(): void {
|
|
92
94
|
if (this.timer !== undefined) {
|
|
93
95
|
this.fire();
|
|
@@ -106,6 +108,7 @@ export class Debouncer implements Disposable {
|
|
|
106
108
|
this.cancel();
|
|
107
109
|
}
|
|
108
110
|
|
|
111
|
+
/** Clears the window before it runs {@link fn}, so a {@link schedule} from inside `fn` opens a new one. */
|
|
109
112
|
protected fire(): void {
|
|
110
113
|
this.timer?.dispose();
|
|
111
114
|
this.timer = undefined;
|
package/src/errors.ts
CHANGED
|
@@ -82,6 +82,10 @@ export const CONFLICT_ERROR_CODE = HYDRANIUM_ERROR_CODES.conflict;
|
|
|
82
82
|
|
|
83
83
|
/** Structured payload carried in {@link ConflictError.data}. */
|
|
84
84
|
export interface ConflictErrorData extends HydraniumMessageData {
|
|
85
|
+
/**
|
|
86
|
+
* The document whose version moved. A write of several documents names
|
|
87
|
+
* the first stale one in request order, and others may be stale too.
|
|
88
|
+
*/
|
|
85
89
|
readonly uri: string;
|
|
86
90
|
/** The base version the caller authored against. */
|
|
87
91
|
readonly baseVersion: ModelVersion;
|
|
@@ -144,6 +148,7 @@ export class ConflictError extends ResponseError<ConflictErrorData> {
|
|
|
144
148
|
Object.setPrototypeOf(this, ConflictError.prototype);
|
|
145
149
|
}
|
|
146
150
|
|
|
151
|
+
/** The document whose version moved, see {@link ConflictErrorData.uri}. */
|
|
147
152
|
get uri(): string {
|
|
148
153
|
return this.data!.uri;
|
|
149
154
|
}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* `RejectAction`, which ends the wait too.
|
|
24
24
|
*/
|
|
25
25
|
export interface RequestEditsSettledAction {
|
|
26
|
+
/** Answered only by a server that advertises this kind. The framework's dispatcher sends none to a server that does not. */
|
|
26
27
|
kind: typeof RequestEditsSettledAction.KIND;
|
|
27
28
|
/** The id the response echoes as its `responseId`. Empty until the dispatcher assigns one. */
|
|
28
29
|
requestId: string;
|
|
@@ -46,6 +47,7 @@ export namespace RequestEditsSettledAction {
|
|
|
46
47
|
|
|
47
48
|
/** The server's answer to a {@link RequestEditsSettledAction}. */
|
|
48
49
|
export interface EditsSettledAction {
|
|
50
|
+
/** No client handler takes this kind: the dispatcher settles the request by {@link responseId} instead. */
|
|
49
51
|
kind: typeof EditsSettledAction.KIND;
|
|
50
52
|
/** The `requestId` of the request this answers. The server's dispatcher sets it. */
|
|
51
53
|
responseId: string;
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
* whether a save failed.
|
|
25
25
|
*/
|
|
26
26
|
export interface RequestSaveModelAction {
|
|
27
|
+
/**
|
|
28
|
+
* Answered only by a server that advertises this kind. The framework's
|
|
29
|
+
* Theia saveable sends GLSP's `SaveModelAction` to one that does not.
|
|
30
|
+
*/
|
|
27
31
|
kind: typeof RequestSaveModelAction.KIND;
|
|
28
32
|
/** The id the response echoes as its `responseId`. Empty until the dispatcher assigns one. */
|
|
29
33
|
requestId: string;
|
|
@@ -45,6 +49,7 @@ export namespace RequestSaveModelAction {
|
|
|
45
49
|
|
|
46
50
|
/** The server's answer to a {@link RequestSaveModelAction} that saved. */
|
|
47
51
|
export interface ModelSavedAction {
|
|
52
|
+
/** No client handler takes this kind: the dispatcher settles the save by {@link responseId} instead. */
|
|
48
53
|
kind: typeof ModelSavedAction.KIND;
|
|
49
54
|
/** The `requestId` of the save this answers. The server's dispatcher sets it. */
|
|
50
55
|
responseId: string;
|
package/src/latency-collector.ts
CHANGED
|
@@ -124,7 +124,9 @@ function percentile(sortedAscending: readonly number[], percent: number): number
|
|
|
124
124
|
* deterministic on a fake clock.
|
|
125
125
|
*/
|
|
126
126
|
export class LatencyCollector {
|
|
127
|
+
/** One tally per method name. Emptied by {@link reset}. */
|
|
127
128
|
protected readonly durations = new Map<string, MethodLatencyTally>();
|
|
129
|
+
/** Restarted by {@link reset}. Its reading is the report's `windowMs`. */
|
|
128
130
|
protected window: Stopwatch;
|
|
129
131
|
|
|
130
132
|
constructor(
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* races {@link whenSettled} against its own bound.
|
|
15
15
|
*/
|
|
16
16
|
export class PendingWorkTracker {
|
|
17
|
+
/** The tracked work. {@link track} removes each entry once it settles. */
|
|
17
18
|
protected readonly pending = new Set<Promise<unknown>>();
|
|
18
19
|
|
|
19
20
|
/** Watch `work` until it settles, and hand it back. */
|
package/src/profile-session.ts
CHANGED
|
@@ -68,6 +68,7 @@ export interface ProfileSession {
|
|
|
68
68
|
* {@link DefaultProfileSession.closeFrame}, so a subclass has to name it too.
|
|
69
69
|
*/
|
|
70
70
|
export interface ProfileScopeFrame {
|
|
71
|
+
/** The {@link ProfileSession.scope} id, under which frames sharing it aggregate into one record. */
|
|
71
72
|
readonly id: string;
|
|
72
73
|
/** Session-stopwatch reading when this scope began. */
|
|
73
74
|
readonly start: number;
|
|
@@ -83,7 +84,13 @@ export interface ProfileScopeFrame {
|
|
|
83
84
|
export class DefaultProfileSession implements ProfileSession {
|
|
84
85
|
/** Single monotonic timeline for the whole session; per-scope readings are deltas off it. */
|
|
85
86
|
protected readonly sessionStopwatch: Stopwatch;
|
|
87
|
+
/**
|
|
88
|
+
* The scopes in flight, innermost last. They must end innermost first:
|
|
89
|
+
* {@link closeFrame} pops the top frame whichever scope ends, so
|
|
90
|
+
* overlapping async scopes misattribute their time.
|
|
91
|
+
*/
|
|
86
92
|
protected readonly stack: ProfileScopeFrame[] = [];
|
|
93
|
+
/** Self-time in milliseconds per id, one sample per closed scope, which {@link records} sums. */
|
|
87
94
|
protected readonly entries = new Map<string, number[]>();
|
|
88
95
|
|
|
89
96
|
constructor(
|
|
@@ -122,7 +129,10 @@ export class DefaultProfileSession implements ProfileSession {
|
|
|
122
129
|
return result;
|
|
123
130
|
}
|
|
124
131
|
|
|
125
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* Pop the top frame, which is `frame` when scopes end innermost first,
|
|
134
|
+
* charge its full duration to the new top, and record its self-time.
|
|
135
|
+
*/
|
|
126
136
|
protected closeFrame(frame: ProfileScopeFrame): void {
|
|
127
137
|
this.stack.pop();
|
|
128
138
|
const duration = this.sessionStopwatch.elapsedMs - frame.start;
|