@hydranium/core 1.0.0-next.117 → 1.0.0-next.123
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/documents/ast-document-manager.d.ts +8 -44
- package/lib/documents/ast-document-manager.d.ts.map +1 -1
- package/lib/documents/ast-document-manager.js +22 -41
- package/lib/documents/ast-document-manager.js.map +1 -1
- package/lib/documents/client-session-errors.d.ts +4 -33
- package/lib/documents/client-session-errors.d.ts.map +1 -1
- package/lib/documents/client-session-errors.js +4 -46
- package/lib/documents/client-session-errors.js.map +1 -1
- package/lib/documents/client-session-registry.d.ts +40 -20
- package/lib/documents/client-session-registry.d.ts.map +1 -1
- package/lib/documents/client-session-registry.js +33 -20
- package/lib/documents/client-session-registry.js.map +1 -1
- package/lib/documents/file-system-task-queue.d.ts +49 -0
- package/lib/documents/file-system-task-queue.d.ts.map +1 -0
- package/lib/documents/file-system-task-queue.js +34 -0
- package/lib/documents/file-system-task-queue.js.map +1 -0
- package/lib/documents/hydranium-text-documents.d.ts +138 -13
- package/lib/documents/hydranium-text-documents.d.ts.map +1 -1
- package/lib/documents/hydranium-text-documents.js +283 -40
- package/lib/documents/hydranium-text-documents.js.map +1 -1
- package/lib/documents/index.d.ts +1 -0
- package/lib/documents/index.d.ts.map +1 -1
- package/lib/documents/index.js +1 -0
- package/lib/documents/index.js.map +1 -1
- package/lib/langium/document-builder/document-builder.d.ts +15 -2
- package/lib/langium/document-builder/document-builder.d.ts.map +1 -1
- package/lib/langium/document-builder/document-builder.js +15 -2
- package/lib/langium/document-builder/document-builder.js.map +1 -1
- package/lib/langium/integrity/integrity-service.d.ts +3 -2
- package/lib/langium/integrity/integrity-service.d.ts.map +1 -1
- package/lib/langium/integrity/integrity-service.js +9 -6
- package/lib/langium/integrity/integrity-service.js.map +1 -1
- package/lib/langium/language-module.d.ts +2 -2
- package/lib/langium/language-module.js +2 -2
- package/lib/langium/language-module.js.map +1 -1
- package/lib/langium/model-service/client-session.d.ts +203 -24
- package/lib/langium/model-service/client-session.d.ts.map +1 -1
- package/lib/langium/model-service/client-session.js +233 -29
- package/lib/langium/model-service/client-session.js.map +1 -1
- package/lib/langium/model-service/model-service.d.ts +62 -217
- package/lib/langium/model-service/model-service.d.ts.map +1 -1
- package/lib/langium/model-service/model-service.js +54 -357
- package/lib/langium/model-service/model-service.js.map +1 -1
- package/lib/langium/module.d.ts +11 -1
- package/lib/langium/module.d.ts.map +1 -1
- package/lib/langium/module.js +5 -1
- package/lib/langium/module.js.map +1 -1
- package/lib/langium/update-rewrite/update-rewrite.d.ts +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.js +10 -2
- package/lib/langium/workspace/in-memory-file-system-provider.js.map +1 -1
- package/lib/langium/workspace/write-lock-scope.d.ts +1 -1
- package/lib/langium/workspace/write-lock-scope.js +1 -1
- package/lib/lsp/hydranium-document-update-handler.d.ts +69 -67
- package/lib/lsp/hydranium-document-update-handler.d.ts.map +1 -1
- package/lib/lsp/hydranium-document-update-handler.js +111 -89
- package/lib/lsp/hydranium-document-update-handler.js.map +1 -1
- package/lib/lsp/shared-module.d.ts +4 -8
- package/lib/lsp/shared-module.d.ts.map +1 -1
- package/lib/lsp/shared-module.js.map +1 -1
- package/lib/lsp/start-language-server.d.ts +3 -4
- package/lib/lsp/start-language-server.d.ts.map +1 -1
- package/lib/lsp/start-language-server.js +3 -4
- package/lib/lsp/start-language-server.js.map +1 -1
- package/lib/testing/make-test-services.d.ts +16 -4
- package/lib/testing/make-test-services.d.ts.map +1 -1
- package/lib/testing/make-test-services.js +6 -2
- package/lib/testing/make-test-services.js.map +1 -1
- package/lib/testing/node/lsp-server-connection.d.ts +1 -1
- package/lib/testing/node/scratch-workspace.js +1 -1
- package/lib/testing/run-update-pipeline.d.ts +4 -4
- package/lib/testing/run-update-pipeline.d.ts.map +1 -1
- package/lib/testing/stub-ast-document-manager.d.ts +5 -5
- package/lib/testing/stub-ast-document-manager.d.ts.map +1 -1
- package/lib/testing/stub-ast-document-manager.js +6 -8
- package/lib/testing/stub-ast-document-manager.js.map +1 -1
- package/lib/testing/stub-hydranium-text-documents.d.ts +10 -5
- package/lib/testing/stub-hydranium-text-documents.d.ts.map +1 -1
- package/lib/testing/stub-hydranium-text-documents.js +16 -9
- package/lib/testing/stub-hydranium-text-documents.js.map +1 -1
- package/lib/testing/stub-model-service.d.ts +2 -2
- package/lib/testing/stub-model-service.js +2 -2
- package/package.json +5 -5
- package/src/documents/ast-document-manager.ts +27 -78
- package/src/documents/client-session-errors.ts +11 -43
- package/src/documents/client-session-registry.ts +54 -28
- package/src/documents/file-system-task-queue.ts +68 -0
- package/src/documents/hydranium-text-documents.ts +348 -44
- package/src/documents/index.ts +1 -0
- package/src/langium/document-builder/document-builder.ts +16 -2
- package/src/langium/integrity/integrity-service.ts +9 -6
- package/src/langium/language-module.ts +4 -4
- package/src/langium/model-service/client-session.ts +363 -39
- package/src/langium/model-service/model-service.ts +91 -420
- package/src/langium/module.ts +14 -2
- package/src/langium/update-rewrite/update-rewrite.ts +1 -1
- package/src/langium/workspace/in-memory-file-system-provider.ts +11 -2
- package/src/langium/workspace/write-lock-scope.ts +1 -1
- package/src/lsp/hydranium-document-update-handler.ts +138 -92
- package/src/lsp/shared-module.ts +4 -8
- package/src/lsp/start-language-server.ts +3 -4
- package/src/testing/make-test-services.ts +25 -6
- package/src/testing/node/lsp-server-connection.ts +1 -1
- package/src/testing/node/scratch-workspace.ts +1 -1
- package/src/testing/run-update-pipeline.ts +4 -4
- package/src/testing/stub-ast-document-manager.ts +10 -24
- package/src/testing/stub-hydranium-text-documents.ts +29 -16
- package/src/testing/stub-model-service.ts +2 -2
|
@@ -22,11 +22,11 @@ export const RESERVED_CLIENT_IDS = [...FRAMEWORK_CLIENT_IDS, INTEGRITY_CLIENT_ID
|
|
|
22
22
|
* sessions — the open facts every head shares, composed by
|
|
23
23
|
* `HydraniumTextDocuments`.
|
|
24
24
|
*
|
|
25
|
-
* Opens are recorded for every client id, registered or not.
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
25
|
+
* Opens are recorded for every client id, registered or not. The language
|
|
26
|
+
* client opens under its reserved id without a session, over the LSP
|
|
27
|
+
* connection, and its opens are tracked exactly as a session's are; only the
|
|
28
|
+
* session table ignores it. Requiring registration before an open would refuse
|
|
29
|
+
* the editor.
|
|
30
30
|
*
|
|
31
31
|
* One open per `(client, uri)`, with no reference count: a repeat open changes
|
|
32
32
|
* nothing, and one close ends it.
|
|
@@ -38,10 +38,16 @@ export const RESERVED_CLIENT_IDS = [...FRAMEWORK_CLIENT_IDS, INTEGRITY_CLIENT_ID
|
|
|
38
38
|
export class ClientSessionRegistry {
|
|
39
39
|
sessions = new Map();
|
|
40
40
|
clientsByUri = new Map();
|
|
41
|
-
/** Each client's opens, with the options it opened them with. */
|
|
42
41
|
opensByClient = new Map();
|
|
43
42
|
reservedIds = new Set(RESERVED_CLIENT_IDS);
|
|
44
43
|
sessionClosedEmitter = new Emitter();
|
|
44
|
+
/**
|
|
45
|
+
* The documents whose last open closed with a lost connection and whose
|
|
46
|
+
* revert is deferred, each with the timer that runs it. Any open of such a
|
|
47
|
+
* document cancels its timer; the store decides whether the opener keeps the
|
|
48
|
+
* unsaved text.
|
|
49
|
+
*/
|
|
50
|
+
pendingReverts = new Map();
|
|
45
51
|
/** Fires once a session has been removed from the table, after all its opens closed. */
|
|
46
52
|
get onDidCloseSession() {
|
|
47
53
|
return this.sessionClosedEmitter.event;
|
|
@@ -84,7 +90,7 @@ export class ClientSessionRegistry {
|
|
|
84
90
|
this.sessionClosedEmitter.fire(Object.freeze({ clientId }));
|
|
85
91
|
}
|
|
86
92
|
/**
|
|
87
|
-
* Record that `clientId` opened `uri
|
|
93
|
+
* Record that `clientId` opened `uri`. Returns `false` when
|
|
88
94
|
* it already had it open, in which case nothing changes.
|
|
89
95
|
*
|
|
90
96
|
* Throws {@link SessionClosedError} for a session that is closing.
|
|
@@ -98,10 +104,10 @@ export class ClientSessionRegistry {
|
|
|
98
104
|
return false;
|
|
99
105
|
}
|
|
100
106
|
if (!opens) {
|
|
101
|
-
opens = new
|
|
107
|
+
opens = new Set();
|
|
102
108
|
this.opensByClient.set(clientId, opens);
|
|
103
109
|
}
|
|
104
|
-
opens.
|
|
110
|
+
opens.add(uri);
|
|
105
111
|
let clients = this.clientsByUri.get(uri);
|
|
106
112
|
if (!clients) {
|
|
107
113
|
clients = new Set();
|
|
@@ -140,25 +146,28 @@ export class ClientSessionRegistry {
|
|
|
140
146
|
}
|
|
141
147
|
/** The URIs `clientId` has open, in the order it opened them. */
|
|
142
148
|
opensOf(clientId) {
|
|
143
|
-
return [...(this.opensByClient.get(clientId)
|
|
149
|
+
return [...(this.opensByClient.get(clientId) ?? [])];
|
|
144
150
|
}
|
|
145
151
|
/** Every document open in at least one client, with the clients that have it open. */
|
|
146
152
|
openDocuments() {
|
|
147
153
|
return [...this.clientsByUri].map(([uri, clients]) => ({ uri, clients: [...clients] }));
|
|
148
154
|
}
|
|
149
|
-
/**
|
|
150
|
-
|
|
151
|
-
|
|
155
|
+
/** Record `timer` as the deferred revert of `uri`. */
|
|
156
|
+
deferRevert(uri, timer) {
|
|
157
|
+
this.pendingReverts.set(uri, timer);
|
|
152
158
|
}
|
|
153
|
-
/**
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
+
/** Whether the revert of `uri` is deferred. */
|
|
160
|
+
isRevertPending(uri) {
|
|
161
|
+
return this.pendingReverts.has(uri);
|
|
162
|
+
}
|
|
163
|
+
/** Cancel the deferred revert of `uri`, if one is pending. */
|
|
164
|
+
cancelRevert(uri) {
|
|
165
|
+
this.pendingReverts.get(uri)?.dispose();
|
|
166
|
+
this.pendingReverts.delete(uri);
|
|
159
167
|
}
|
|
160
168
|
/**
|
|
161
|
-
* Forget every session and
|
|
169
|
+
* Forget every session, open and deferred revert without announcing
|
|
170
|
+
* anything, for a test double that resets between tests. Subscriptions
|
|
162
171
|
* stay, so a listener registered before the clear hears the sessions that
|
|
163
172
|
* end after it.
|
|
164
173
|
*/
|
|
@@ -166,6 +175,10 @@ export class ClientSessionRegistry {
|
|
|
166
175
|
this.sessions.clear();
|
|
167
176
|
this.clientsByUri.clear();
|
|
168
177
|
this.opensByClient.clear();
|
|
178
|
+
for (const timer of this.pendingReverts.values()) {
|
|
179
|
+
timer.dispose();
|
|
180
|
+
}
|
|
181
|
+
this.pendingReverts.clear();
|
|
169
182
|
}
|
|
170
183
|
}
|
|
171
184
|
//# sourceMappingURL=client-session-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-session-registry.js","sourceRoot":"","sources":["../../src/documents/client-session-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAqB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"client-session-registry.js","sourceRoot":"","sources":["../../src/documents/client-session-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAqB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAmB,OAAO,EAAc,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAqCxF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAsB,CAAC,GAAG,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;AAErG;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,qBAAqB;IACZ,QAAQ,GAAG,IAAI,GAAG,EAA8B,CAAC;IACjD,YAAY,GAAG,IAAI,GAAG,EAA6B,CAAC;IACpD,aAAa,GAAG,IAAI,GAAG,EAA6B,CA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F,CAAC;IAED,sDAAsD;IACtD,WAAW,CAAC,GAAiB,EAAE,KAAiB;QAC7C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,+CAA+C;IAC/C,eAAe,CAAC,GAAiB;QAC9B,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;IAED,8DAA8D;IAC9D,YAAY,CAAC,GAAiB;QAC3B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC;QACxC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACH,KAAK;QACF,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;QAC1B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC;YAChD,KAAK,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC;QACD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;CACH"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
import { type CanonicalUri } from '@hydranium/protocol';
|
|
10
|
+
import { type ServerSharedServices } from '../langium/module.js';
|
|
11
|
+
import { type DocumentUriPolicy } from '../langium/workspace/document-uri-policy.js';
|
|
12
|
+
/**
|
|
13
|
+
* One queue of file-system tasks per file, shared by every server-side reader
|
|
14
|
+
* and writer of a file whose accesses must not interleave with its saves.
|
|
15
|
+
*
|
|
16
|
+
* Two writes of one file that bypass the queue can land in either order, and
|
|
17
|
+
* the older text then stays on disk. Tasks of different files run in
|
|
18
|
+
* parallel.
|
|
19
|
+
*/
|
|
20
|
+
export interface FileSystemTaskQueue {
|
|
21
|
+
/**
|
|
22
|
+
* Run `task` once every task already enqueued for `uri` has settled, and
|
|
23
|
+
* before any enqueued after it. `uri` is keyed by its canonical identity, so
|
|
24
|
+
* every spelling of one file shares a queue. A task that has nothing to do
|
|
25
|
+
* still resolves once the tasks before it have settled.
|
|
26
|
+
*
|
|
27
|
+
* A task must not await a build, nor a save, another task or an open of a
|
|
28
|
+
* document no client has open, all of the same file: a build's integrity
|
|
29
|
+
* repair enqueues its own write and the build waits for it, and such an
|
|
30
|
+
* open reads the file here, so a task waiting on either never resolves,
|
|
31
|
+
* which wedges the file's queue for good.
|
|
32
|
+
*/
|
|
33
|
+
enqueue<T>(uri: string, task: () => Promise<T>): Promise<T>;
|
|
34
|
+
}
|
|
35
|
+
export declare class DefaultFileSystemTaskQueue implements FileSystemTaskQueue {
|
|
36
|
+
/**
|
|
37
|
+
* Per canonical URI, the settling of the last task enqueued for it; the next
|
|
38
|
+
* task chains behind it. An entry leaves once its file's queue is idle. Kept
|
|
39
|
+
* outside the workspace lock, whose `write` cancels the write before it: a
|
|
40
|
+
* save cancelled that way reports success for text it never wrote.
|
|
41
|
+
*/
|
|
42
|
+
protected readonly queues: Map<CanonicalUri, Promise<void>>;
|
|
43
|
+
protected readonly uriPolicy: DocumentUriPolicy;
|
|
44
|
+
constructor(services: {
|
|
45
|
+
readonly workspace: Pick<ServerSharedServices['workspace'], 'DocumentUriPolicy'>;
|
|
46
|
+
});
|
|
47
|
+
enqueue<T>(uri: string, task: () => Promise<T>): Promise<T>;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=file-system-task-queue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-task-queue.d.ts","sourceRoot":"","sources":["../../src/documents/file-system-task-queue.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAErF;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IACjC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC9D;AAED,qBAAa,0BAA2B,YAAW,mBAAmB;IACnE;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,CAAC,MAAM,mCAA0C;IAEnE,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;gBAEpC,QAAQ,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,mBAAmB,CAAC,CAAA;KAAE;IAI1G,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAe7D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
export class DefaultFileSystemTaskQueue {
|
|
10
|
+
/**
|
|
11
|
+
* Per canonical URI, the settling of the last task enqueued for it; the next
|
|
12
|
+
* task chains behind it. An entry leaves once its file's queue is idle. Kept
|
|
13
|
+
* outside the workspace lock, whose `write` cancels the write before it: a
|
|
14
|
+
* save cancelled that way reports success for text it never wrote.
|
|
15
|
+
*/
|
|
16
|
+
queues = new Map();
|
|
17
|
+
uriPolicy;
|
|
18
|
+
constructor(services) {
|
|
19
|
+
this.uriPolicy = services.workspace.DocumentUriPolicy;
|
|
20
|
+
}
|
|
21
|
+
enqueue(uri, task) {
|
|
22
|
+
const key = this.uriPolicy.canonicalUri(uri);
|
|
23
|
+
const result = (this.queues.get(key) ?? Promise.resolve()).then(task);
|
|
24
|
+
const settled = result.then(() => undefined, () => undefined);
|
|
25
|
+
this.queues.set(key, settled);
|
|
26
|
+
void settled.then(() => {
|
|
27
|
+
if (this.queues.get(key) === settled) {
|
|
28
|
+
this.queues.delete(key);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=file-system-task-queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-task-queue.js","sourceRoot":"","sources":["../../src/documents/file-system-task-queue.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AA8BlF,MAAM,OAAO,0BAA0B;IACpC;;;;;OAKG;IACgB,MAAM,GAAG,IAAI,GAAG,EAA+B,CAAC;IAEhD,SAAS,CAAoB;IAEhD,YAAY,QAA8F;QACvG,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,iBAAiB,CAAC;IACzD,CAAC;IAED,OAAO,CAAI,GAAW,EAAE,IAAsB;QAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtE,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CACxB,GAAG,EAAE,CAAC,SAAS,EACf,GAAG,EAAE,CAAC,SAAS,CACjB,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC9B,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE;YACpB,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC;gBACpC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IACjB,CAAC;CACH"}
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
* SPDX-License-Identifier: MIT
|
|
9
9
|
********************************************************************************/
|
|
10
10
|
import { NormalizedTextDocuments } from '@hydranium/langium/lsp';
|
|
11
|
-
import {
|
|
11
|
+
import { URI } from '@hydranium/langium';
|
|
12
12
|
import { type ServerSharedServices } from '../langium/module.js';
|
|
13
|
-
import { type ApplyWorkspaceEditResult, type CancellationToken, type Connection, type DidChangeTextDocumentParams, type DidCloseTextDocumentParams, type DidOpenTextDocumentParams, type DidSaveTextDocumentParams, type Disposable,
|
|
13
|
+
import { type ApplyWorkspaceEditResult, type CancellationToken, type Connection, type DidChangeTextDocumentParams, type DidCloseTextDocumentParams, type DidOpenTextDocumentParams, type DidSaveTextDocumentParams, type Disposable, Emitter, type Event, type HandlerResult, type RequestHandler, type TextDocumentChangeEvent, type TextDocumentWillSaveEvent, type TextDocumentsConfiguration, type TextEdit, type WillSaveTextDocumentParams } from 'vscode-languageserver';
|
|
14
14
|
import { type DocumentUri, TextDocument, type TextDocumentContentChangeEvent } from 'vscode-languageserver-textdocument';
|
|
15
|
-
import { type CanonicalUri, type LanguageClientUri, type Tracer } from '@hydranium/protocol';
|
|
15
|
+
import { type CanonicalUri, type LanguageClientUri, type Stopwatch, type Tracer } from '@hydranium/protocol';
|
|
16
16
|
import { type LogNameOptions } from '../langium/diagnostics/logger.js';
|
|
17
|
-
import { type ClientSessionClosedEvent, ClientSessionRegistry, type
|
|
17
|
+
import { type ClientSessionClosedEvent, ClientSessionRegistry, type SessionEndCause } from './client-session-registry.js';
|
|
18
18
|
import { LanguageClientTextShadow } from './language-client-text-shadow.js';
|
|
19
19
|
export interface ClientTextDocumentChangeEvent<T> extends TextDocumentChangeEvent<T> {
|
|
20
20
|
clientId: string;
|
|
@@ -30,6 +30,30 @@ export interface HydraniumTextDocumentsOptions<T extends TextDocument = TextDocu
|
|
|
30
30
|
* Adopters with a custom text-document type (rare) pass their factory.
|
|
31
31
|
*/
|
|
32
32
|
readonly configuration?: TextDocumentsConfiguration<T>;
|
|
33
|
+
/**
|
|
34
|
+
* How long a document whose last open closed because its client's
|
|
35
|
+
* connection was lost keeps its text before it reverts to disk. An open by
|
|
36
|
+
* a client lost from the document, within this time of its own loss,
|
|
37
|
+
* cancels the revert, so a client that registers again under its id after
|
|
38
|
+
* a dropped connection finds its unsaved edits. Any other open releases the
|
|
39
|
+
* document first and then opens it as a first open does, from the text the
|
|
40
|
+
* opener supplies (an editor's own) or else from the file. Meanwhile the
|
|
41
|
+
* document counts as open for the integrity service, which therefore writes
|
|
42
|
+
* none of its unsaved text to disk. A close the client makes itself, or
|
|
43
|
+
* ending its session, reverts at once whatever this is.
|
|
44
|
+
*
|
|
45
|
+
* Defaults to 10 s. `0` reverts such a document at once as well, released
|
|
46
|
+
* in the close itself rather than on a timer.
|
|
47
|
+
*/
|
|
48
|
+
readonly revertGraceMs?: number;
|
|
49
|
+
}
|
|
50
|
+
/** Delivered by {@link HydraniumTextDocuments.onDidSaveInLanguageClient}. */
|
|
51
|
+
export interface LanguageClientSavedEvent {
|
|
52
|
+
readonly uri: string;
|
|
53
|
+
}
|
|
54
|
+
/** Delivered by {@link HydraniumTextDocuments.onDidCloseLastOpen}. */
|
|
55
|
+
export interface LastOpenClosedEvent {
|
|
56
|
+
readonly uri: CanonicalUri;
|
|
33
57
|
}
|
|
34
58
|
/**
|
|
35
59
|
* All per-URI client-facing tracking the manager keys by normalized URI,
|
|
@@ -73,6 +97,22 @@ export interface DocumentTrackingRecord {
|
|
|
73
97
|
* record on last close.
|
|
74
98
|
*/
|
|
75
99
|
languageClientUris?: Set<LanguageClientUri>;
|
|
100
|
+
/**
|
|
101
|
+
* The clients whose close of this document was caused by a lost connection
|
|
102
|
+
* and that have not opened it again, each with a stopwatch started at its
|
|
103
|
+
* loss on the store's `Clock`. While the document waits out the revert grace, only an
|
|
104
|
+
* open by one of them within its own
|
|
105
|
+
* {@link HydraniumTextDocumentsOptions.revertGraceMs} of that loss cancels
|
|
106
|
+
* the revert. Every such client counts, not only the last to close: one
|
|
107
|
+
* connection's sessions all end lost together, and any of them may reopen
|
|
108
|
+
* first. Without the time limit, a client that returns late inherits the
|
|
109
|
+
* unsaved text of a holder lost after it. A stopwatch rather than a `now()`
|
|
110
|
+
* reading, because a wall-clock step would otherwise expire a claim early or
|
|
111
|
+
* revive one past its grace, against a grace timer that the step leaves
|
|
112
|
+
* alone. An entry past its grace counts as any other client's and is pruned
|
|
113
|
+
* at the next open of the document.
|
|
114
|
+
*/
|
|
115
|
+
lostClients?: Map<string, Stopwatch>;
|
|
76
116
|
}
|
|
77
117
|
/**
|
|
78
118
|
* A document held open by at least one client, with the client ids holding it —
|
|
@@ -181,6 +221,9 @@ export type LanguageClientChangeOrigin =
|
|
|
181
221
|
* document's content-revision number), and splicing them lets versions drift
|
|
182
222
|
* silently past based-on gate holders.
|
|
183
223
|
* - Version-author history so each edit is attributable to its originating client.
|
|
224
|
+
* - The revert to disk once no client has a document open, for every head
|
|
225
|
+
* ({@link revertToDisk}), deferred by
|
|
226
|
+
* {@link HydraniumTextDocumentsOptions.revertGraceMs} after a lost connection.
|
|
184
227
|
* - Pending-content staging used by the integrity service to thread corrections
|
|
185
228
|
* through `workspace/applyEdit` cycles for currently-closed documents.
|
|
186
229
|
* - `didOpen` notifications arriving over the LSP connection wait on the
|
|
@@ -267,6 +310,10 @@ export declare class HydraniumTextDocuments<T extends TextDocument = TextDocumen
|
|
|
267
310
|
protected readonly __shadow: LanguageClientTextShadow;
|
|
268
311
|
protected readonly tracer: Tracer;
|
|
269
312
|
protected readonly configuration: TextDocumentsConfiguration<T>;
|
|
313
|
+
/** See {@link HydraniumTextDocumentsOptions.revertGraceMs}. */
|
|
314
|
+
protected readonly revertGraceMs: number;
|
|
315
|
+
protected readonly lastOpenClosedEmitter: Emitter<LastOpenClosedEvent>;
|
|
316
|
+
protected readonly languageClientSavedEmitter: Emitter<LanguageClientSavedEvent>;
|
|
270
317
|
constructor(services: ServerSharedServices, options?: HydraniumTextDocumentsOptions<T>);
|
|
271
318
|
create(uri: string, languageId: string, version: number, content: string): T;
|
|
272
319
|
update(document: T, changes: TextDocumentContentChangeEvent[], version: number): T;
|
|
@@ -301,10 +348,69 @@ export declare class HydraniumTextDocuments<T extends TextDocument = TextDocumen
|
|
|
301
348
|
* open — callers (`AstDocumentManager.update`) open first.
|
|
302
349
|
*/
|
|
303
350
|
applyContentChange(uri: DocumentUri, text: string, clientId: string): number;
|
|
304
|
-
|
|
351
|
+
/**
|
|
352
|
+
* Close `clientId`'s open of the document. When it was the last open, the
|
|
353
|
+
* document is released and reverts to disk, at once or, for a `'lost'`
|
|
354
|
+
* close, after {@link HydraniumTextDocumentsOptions.revertGraceMs}.
|
|
355
|
+
*/
|
|
356
|
+
notifyDidCloseTextDocument(event: DidCloseTextDocumentParams, clientId?: string, cause?: SessionEndCause): void;
|
|
357
|
+
/**
|
|
358
|
+
* Keep the document, text and all, for the revert grace, then release it.
|
|
359
|
+
* The document stays in the store meanwhile, so a lost client that opens it
|
|
360
|
+
* again within its own grace attaches to it and finds its unsaved text
|
|
361
|
+
* rather than reading disk; see {@link resolvePendingRevert} for any other
|
|
362
|
+
* open.
|
|
363
|
+
*/
|
|
364
|
+
protected deferRelease(uri: CanonicalUri): void;
|
|
365
|
+
/**
|
|
366
|
+
* Resolve the pending revert of `uri` for an open by `clientId`. An open by a
|
|
367
|
+
* client lost from the document within its grace cancels the revert, and
|
|
368
|
+
* the client finds its unsaved text. Any other open releases the document
|
|
369
|
+
* first, so it opens as a first open does: cancelling for every open hands
|
|
370
|
+
* a lost client's unsaved text to whoever opens next, a reloaded page or an
|
|
371
|
+
* editor, with nothing marking it unsaved.
|
|
372
|
+
*/
|
|
373
|
+
protected resolvePendingRevert(uri: CanonicalUri, clientId: string): void;
|
|
374
|
+
/** Drop the entries of {@link DocumentTrackingRecord.lostClients} whose grace has run out. */
|
|
375
|
+
protected pruneLostClients(record: DocumentTrackingRecord): void;
|
|
376
|
+
/**
|
|
377
|
+
* Drop the document no client has open any more, then announce it on
|
|
378
|
+
* {@link onDidCloseLastOpen}, which is what reverts it to disk.
|
|
379
|
+
*/
|
|
380
|
+
protected releaseDocument(uri: CanonicalUri): void;
|
|
381
|
+
/**
|
|
382
|
+
* Rebuild a released document from disk, so the build stops carrying the
|
|
383
|
+
* unsaved text of its last client.
|
|
384
|
+
*
|
|
385
|
+
* Only a `file:` document reverts. A document of another scheme may have
|
|
386
|
+
* been loaded by the adopter into the workspace index, and a rebuild would
|
|
387
|
+
* drop it and break every reference to it.
|
|
388
|
+
*
|
|
389
|
+
* The file's existence is read in its disk queue, so the rebuild follows
|
|
390
|
+
* any save still queued rather than reverting past it. A document with no
|
|
391
|
+
* file behind it — created and never saved, or deleted meanwhile — is
|
|
392
|
+
* removed from the workspace instead: there is no disk text to revert to,
|
|
393
|
+
* and one whose file goes after that read is removed when its rebuild
|
|
394
|
+
* finds none.
|
|
395
|
+
*
|
|
396
|
+
* Whether to revert at all is decided inside the write lock, as its holder:
|
|
397
|
+
* decided before waiting for the lock, a client that opens or re-creates the
|
|
398
|
+
* document meanwhile has its text rebuilt over from disk, or removed. A
|
|
399
|
+
* document some client has open again, or that waits out a new grace, is
|
|
400
|
+
* left to that client.
|
|
401
|
+
*/
|
|
402
|
+
protected revertToDisk(uri: CanonicalUri): Promise<void>;
|
|
305
403
|
notifyWillSaveTextDocument(event: WillSaveTextDocumentParams): void;
|
|
306
404
|
notifyWillSaveTextDocumentWaitUntil(event: WillSaveTextDocumentParams, token: CancellationToken): HandlerResult<TextEdit[], void>;
|
|
405
|
+
/**
|
|
406
|
+
* Handle a save the language client reports: fire
|
|
407
|
+
* {@link onDidSaveInLanguageClient}, then announce it on {@link onDidSave}
|
|
408
|
+
* only once the file read back from disk holds the store's current text.
|
|
409
|
+
*/
|
|
410
|
+
protected notifyLanguageClientSave(event: DidSaveTextDocumentParams): Promise<void>;
|
|
307
411
|
notifyDidSaveTextDocument(event: DidSaveTextDocumentParams, clientId?: string): void;
|
|
412
|
+
/** Fire {@link onDidSave} for `document`, which need not be synced any more. */
|
|
413
|
+
protected announceSave(document: T, clientId: string): void;
|
|
308
414
|
notifyDidOpenTextDocument(event: DidOpenTextDocumentParams, clientId?: string): void;
|
|
309
415
|
/**
|
|
310
416
|
* Record `clientId` as an additional holder of a document another client
|
|
@@ -321,8 +427,10 @@ export declare class HydraniumTextDocuments<T extends TextDocument = TextDocumen
|
|
|
321
427
|
* Unifying the two routes therefore rebaselines a textual client's guard to a
|
|
322
428
|
* version it never declared.
|
|
323
429
|
*
|
|
324
|
-
* Returns whether a hold was added — `false` when `uri` is not open,
|
|
325
|
-
* `clientId` already holds it
|
|
430
|
+
* Returns whether a hold was added — `false` when `uri` is not open,
|
|
431
|
+
* `clientId` already holds it, or the document was waiting out the revert
|
|
432
|
+
* grace for other clients and was released instead (see
|
|
433
|
+
* {@link resolvePendingRevert}); the caller then opens it anew.
|
|
326
434
|
*/
|
|
327
435
|
attachClient(uri: DocumentUri, clientId: string): boolean;
|
|
328
436
|
protected logClientJoined(uri: DocumentUri, clientId: string, version: number, existingClients: readonly string[]): void;
|
|
@@ -453,6 +561,26 @@ export declare class HydraniumTextDocuments<T extends TextDocument = TextDocumen
|
|
|
453
561
|
openDocuments(): OpenDocument[];
|
|
454
562
|
/** Fires once a client session has ended, after every document it had open was closed. */
|
|
455
563
|
get onDidCloseSession(): Event<ClientSessionClosedEvent>;
|
|
564
|
+
/**
|
|
565
|
+
* Fires once a document no client has open is released: at its last close,
|
|
566
|
+
* or, for a lost client's last close, when its revert grace runs out,
|
|
567
|
+
* another client opens it, or it is deleted. The document then reverts to
|
|
568
|
+
* disk.
|
|
569
|
+
*/
|
|
570
|
+
get onDidCloseLastOpen(): Event<LastOpenClosedEvent>;
|
|
571
|
+
/**
|
|
572
|
+
* Fires for every save the language client reports of a document it has
|
|
573
|
+
* open: the editor has written the file. {@link onDidSave} follows only
|
|
574
|
+
* when the file holds the store's text.
|
|
575
|
+
*/
|
|
576
|
+
get onDidSaveInLanguageClient(): Event<LanguageClientSavedEvent>;
|
|
577
|
+
/**
|
|
578
|
+
* Whether `uri` is waiting out the revert grace: its last open closed with a
|
|
579
|
+
* lost connection, and it still holds its unsaved text. Such a document is
|
|
580
|
+
* open for no client, yet not closed either, so a caller that would persist
|
|
581
|
+
* a closed document's text to disk treats it as open.
|
|
582
|
+
*/
|
|
583
|
+
isRevertPending(uri: DocumentUri): boolean;
|
|
456
584
|
/**
|
|
457
585
|
* Start a client session under `clientId`. Throws `DuplicateClientIdError`
|
|
458
586
|
* where {@link ClientSessionRegistry.register} refuses the id.
|
|
@@ -461,13 +589,10 @@ export declare class HydraniumTextDocuments<T extends TextDocument = TextDocumen
|
|
|
461
589
|
/**
|
|
462
590
|
* End the client session `clientId`: close every document it has open, then
|
|
463
591
|
* free the id. Immediate — each close runs the ordinary close path before
|
|
464
|
-
* this returns. A no-op for an id that is not a
|
|
592
|
+
* this returns, with `cause` as its cause. A no-op for an id that is not a
|
|
593
|
+
* registered session.
|
|
465
594
|
*/
|
|
466
|
-
closeSession(clientId: string): void;
|
|
467
|
-
/** The options `clientId` opened `uri` with, or `undefined` when it gave none or does not have it open. */
|
|
468
|
-
openOptions(uri: DocumentUri, clientId: string): OpenOptions | undefined;
|
|
469
|
-
/** Replace the options of an existing open. Does nothing when `clientId` does not have `uri` open. */
|
|
470
|
-
setOpenOptions(uri: DocumentUri, clientId: string, options: OpenOptions | undefined): void;
|
|
595
|
+
closeSession(clientId: string, cause?: SessionEndCause): void;
|
|
471
596
|
/**
|
|
472
597
|
* The file behind `uri` was deleted: close every open of it except the
|
|
473
598
|
* language client's.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-text-documents.d.ts","sourceRoot":"","sources":["../../src/documents/hydranium-text-documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;kFAQkF;AAalF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"hydranium-text-documents.d.ts","sourceRoot":"","sources":["../../src/documents/hydranium-text-documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;kFAQkF;AAalF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,GAAG,EAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EACJ,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,UAAU,EACf,OAAO,EACP,KAAK,KAAK,EACV,KAAK,aAAa,EAElB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAI5B,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,QAAQ,EACb,KAAK,0BAA0B,EACjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,KAAK,8BAA8B,EAAE,MAAM,o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