@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.
Files changed (108) hide show
  1. package/lib/documents/ast-document-manager.d.ts +8 -44
  2. package/lib/documents/ast-document-manager.d.ts.map +1 -1
  3. package/lib/documents/ast-document-manager.js +22 -41
  4. package/lib/documents/ast-document-manager.js.map +1 -1
  5. package/lib/documents/client-session-errors.d.ts +4 -33
  6. package/lib/documents/client-session-errors.d.ts.map +1 -1
  7. package/lib/documents/client-session-errors.js +4 -46
  8. package/lib/documents/client-session-errors.js.map +1 -1
  9. package/lib/documents/client-session-registry.d.ts +40 -20
  10. package/lib/documents/client-session-registry.d.ts.map +1 -1
  11. package/lib/documents/client-session-registry.js +33 -20
  12. package/lib/documents/client-session-registry.js.map +1 -1
  13. package/lib/documents/file-system-task-queue.d.ts +49 -0
  14. package/lib/documents/file-system-task-queue.d.ts.map +1 -0
  15. package/lib/documents/file-system-task-queue.js +34 -0
  16. package/lib/documents/file-system-task-queue.js.map +1 -0
  17. package/lib/documents/hydranium-text-documents.d.ts +138 -13
  18. package/lib/documents/hydranium-text-documents.d.ts.map +1 -1
  19. package/lib/documents/hydranium-text-documents.js +283 -40
  20. package/lib/documents/hydranium-text-documents.js.map +1 -1
  21. package/lib/documents/index.d.ts +1 -0
  22. package/lib/documents/index.d.ts.map +1 -1
  23. package/lib/documents/index.js +1 -0
  24. package/lib/documents/index.js.map +1 -1
  25. package/lib/langium/document-builder/document-builder.d.ts +15 -2
  26. package/lib/langium/document-builder/document-builder.d.ts.map +1 -1
  27. package/lib/langium/document-builder/document-builder.js +15 -2
  28. package/lib/langium/document-builder/document-builder.js.map +1 -1
  29. package/lib/langium/integrity/integrity-service.d.ts +3 -2
  30. package/lib/langium/integrity/integrity-service.d.ts.map +1 -1
  31. package/lib/langium/integrity/integrity-service.js +9 -6
  32. package/lib/langium/integrity/integrity-service.js.map +1 -1
  33. package/lib/langium/language-module.d.ts +2 -2
  34. package/lib/langium/language-module.js +2 -2
  35. package/lib/langium/language-module.js.map +1 -1
  36. package/lib/langium/model-service/client-session.d.ts +203 -24
  37. package/lib/langium/model-service/client-session.d.ts.map +1 -1
  38. package/lib/langium/model-service/client-session.js +233 -29
  39. package/lib/langium/model-service/client-session.js.map +1 -1
  40. package/lib/langium/model-service/model-service.d.ts +62 -217
  41. package/lib/langium/model-service/model-service.d.ts.map +1 -1
  42. package/lib/langium/model-service/model-service.js +54 -357
  43. package/lib/langium/model-service/model-service.js.map +1 -1
  44. package/lib/langium/module.d.ts +11 -1
  45. package/lib/langium/module.d.ts.map +1 -1
  46. package/lib/langium/module.js +5 -1
  47. package/lib/langium/module.js.map +1 -1
  48. package/lib/langium/update-rewrite/update-rewrite.d.ts +1 -1
  49. package/lib/langium/workspace/in-memory-file-system-provider.d.ts.map +1 -1
  50. package/lib/langium/workspace/in-memory-file-system-provider.js +10 -2
  51. package/lib/langium/workspace/in-memory-file-system-provider.js.map +1 -1
  52. package/lib/langium/workspace/write-lock-scope.d.ts +1 -1
  53. package/lib/langium/workspace/write-lock-scope.js +1 -1
  54. package/lib/lsp/hydranium-document-update-handler.d.ts +69 -67
  55. package/lib/lsp/hydranium-document-update-handler.d.ts.map +1 -1
  56. package/lib/lsp/hydranium-document-update-handler.js +111 -89
  57. package/lib/lsp/hydranium-document-update-handler.js.map +1 -1
  58. package/lib/lsp/shared-module.d.ts +4 -8
  59. package/lib/lsp/shared-module.d.ts.map +1 -1
  60. package/lib/lsp/shared-module.js.map +1 -1
  61. package/lib/lsp/start-language-server.d.ts +3 -4
  62. package/lib/lsp/start-language-server.d.ts.map +1 -1
  63. package/lib/lsp/start-language-server.js +3 -4
  64. package/lib/lsp/start-language-server.js.map +1 -1
  65. package/lib/testing/make-test-services.d.ts +16 -4
  66. package/lib/testing/make-test-services.d.ts.map +1 -1
  67. package/lib/testing/make-test-services.js +6 -2
  68. package/lib/testing/make-test-services.js.map +1 -1
  69. package/lib/testing/node/lsp-server-connection.d.ts +1 -1
  70. package/lib/testing/node/scratch-workspace.js +1 -1
  71. package/lib/testing/run-update-pipeline.d.ts +4 -4
  72. package/lib/testing/run-update-pipeline.d.ts.map +1 -1
  73. package/lib/testing/stub-ast-document-manager.d.ts +5 -5
  74. package/lib/testing/stub-ast-document-manager.d.ts.map +1 -1
  75. package/lib/testing/stub-ast-document-manager.js +6 -8
  76. package/lib/testing/stub-ast-document-manager.js.map +1 -1
  77. package/lib/testing/stub-hydranium-text-documents.d.ts +10 -5
  78. package/lib/testing/stub-hydranium-text-documents.d.ts.map +1 -1
  79. package/lib/testing/stub-hydranium-text-documents.js +16 -9
  80. package/lib/testing/stub-hydranium-text-documents.js.map +1 -1
  81. package/lib/testing/stub-model-service.d.ts +2 -2
  82. package/lib/testing/stub-model-service.js +2 -2
  83. package/package.json +5 -5
  84. package/src/documents/ast-document-manager.ts +27 -78
  85. package/src/documents/client-session-errors.ts +11 -43
  86. package/src/documents/client-session-registry.ts +54 -28
  87. package/src/documents/file-system-task-queue.ts +68 -0
  88. package/src/documents/hydranium-text-documents.ts +348 -44
  89. package/src/documents/index.ts +1 -0
  90. package/src/langium/document-builder/document-builder.ts +16 -2
  91. package/src/langium/integrity/integrity-service.ts +9 -6
  92. package/src/langium/language-module.ts +4 -4
  93. package/src/langium/model-service/client-session.ts +363 -39
  94. package/src/langium/model-service/model-service.ts +91 -420
  95. package/src/langium/module.ts +14 -2
  96. package/src/langium/update-rewrite/update-rewrite.ts +1 -1
  97. package/src/langium/workspace/in-memory-file-system-provider.ts +11 -2
  98. package/src/langium/workspace/write-lock-scope.ts +1 -1
  99. package/src/lsp/hydranium-document-update-handler.ts +138 -92
  100. package/src/lsp/shared-module.ts +4 -8
  101. package/src/lsp/start-language-server.ts +3 -4
  102. package/src/testing/make-test-services.ts +25 -6
  103. package/src/testing/node/lsp-server-connection.ts +1 -1
  104. package/src/testing/node/scratch-workspace.ts +1 -1
  105. package/src/testing/run-update-pipeline.ts +4 -4
  106. package/src/testing/stub-ast-document-manager.ts +10 -24
  107. package/src/testing/stub-hydranium-text-documents.ts +29 -16
  108. package/src/testing/stub-model-service.ts +2 -2
@@ -91,9 +91,8 @@ export interface AstDocument<TAst extends AstNode, TDiagnostic extends AstDiagno
91
91
  * Text-document version this snapshot was taken at — read from
92
92
  * `LangiumDocument.textDocument.version`. Symmetric with
93
93
  * `TransferDocument.version` on the wire side: an in-process caller that
94
- * holds an `AstDocument` and mutates it sends this straight back as
95
- * `TransferUpdateArgs.basedOn` / `TransferSaveArgs.basedOn`, and the
96
- * conflict gate arms on it.
94
+ * holds an `AstDocument` and mutates it sends this straight back as the
95
+ * `basedOn` of its session's write, and the conflict gate arms on it.
97
96
  */
98
97
  version: SnapshotVersion;
99
98
  }
@@ -164,43 +163,17 @@ export interface AstDocumentManager<TAst extends AstNode, TDiagnostic extends As
164
163
  /** Apply `text` as `clientId`'s edit. Resolves to the resulting text-document version. */
165
164
  update(uri: string, text: string, clientId: string): Promise<number>;
166
165
  /**
167
- * Write the document's current text to disk through the URI's disk queue.
168
- * The text is taken when this is called, so saves of one URI land in the
166
+ * Write the document's current text to disk through `FileSystemTaskQueue`.
167
+ * The text is taken when this is called, so saves of one file land in the
169
168
  * order they were called.
170
169
  */
171
170
  save(uri: string, clientId: string): Promise<void>;
172
- /**
173
- * Run `task` once every disk task already queued for `uri` has settled, and
174
- * before any queued after it. Every server-side disk access of a file that
175
- * must not interleave with its saves goes through here: two writes of one
176
- * file that bypass it can land in either order, and the older text then
177
- * stays on disk. Tasks of different URIs run in parallel. A task that has
178
- * nothing to do still resolves once the tasks before it have settled.
179
- *
180
- * A task must not await a build, nor a save, another disk task or an open
181
- * of a document no client has open, all of the same URI: a build's
182
- * integrity repair queues its own write here and the build waits for it,
183
- * and such an open reads the file here, so a task waiting on either queued
184
- * behind it never resolves, which wedges the URI's queue for good.
185
- */
186
- queueDiskTask<T>(uri: string, task: () => Promise<T>): Promise<T>;
187
171
  onUpdate(uri: string, listener: (event: AstDocumentUpdatedEvent<TAst, TDiagnostic>) => void): Disposable;
188
172
  onSave(uri: string, listener: (event: AstDocumentSavedEvent<TAst, TDiagnostic>) => void | Promise<void>): Disposable;
189
173
  onClientClosed(uri: string, clientId: string, listener: () => void): Disposable;
190
174
  getDocument(uri: string): LangiumDocument | undefined;
191
175
  /** Client id that authored the document's current version, or `undefined` for a framework-internal build. */
192
176
  getAuthor(document: LangiumDocument): string | undefined;
193
- /**
194
- * Whether `uri` is one of the URIs the most recent build request named, as
195
- * opposed to a document that build swept in as a dependent. Deletions are
196
- * excluded: they never reach this layer, since a deleted document is
197
- * removed before the build set is computed.
198
- *
199
- * The answer refers to the latest request, which may still be building, and
200
- * it is retained between builds — so outside a build it describes whichever
201
- * one ran last.
202
- */
203
- isTriggeringEdit(uri: string): boolean;
204
177
  }
205
178
  /**
206
179
  * Higher-level facade over {@link HydraniumTextDocuments} that speaks the
@@ -225,13 +198,6 @@ export interface AstDocumentManager<TAst extends AstNode, TDiagnostic extends As
225
198
  export declare class DefaultAstDocumentManager<TAst extends AstNode, TDiagnostic extends AstDiagnostic = AstDiagnostic> implements AstDocumentManager<TAst, TDiagnostic> {
226
199
  protected readonly services: ServerSharedServices;
227
200
  protected lastUpdate?: UpdateInfo;
228
- /**
229
- * Per canonical URI, the settling of the last disk task queued for it; the
230
- * next task chains behind it. An entry leaves once its URI's queue is idle.
231
- * Kept outside the workspace lock, whose `write` cancels the write before
232
- * it: a save cancelled that way reports success for text it never wrote.
233
- */
234
- protected readonly diskQueues: Map<CanonicalUri, Promise<void>>;
235
201
  /** Per canonical URI, the newest save queued for it, which {@link coalesceSaves} lets older queued saves defer to. */
236
202
  protected readonly newestSaves: Map<CanonicalUri, Promise<void>>;
237
203
  protected readonly coalesceSaves: boolean;
@@ -275,8 +241,8 @@ export declare class DefaultAstDocumentManager<TAst extends AstNode, TDiagnostic
275
241
  * The client that authored `document`'s current version, or `undefined` when
276
242
  * no client wrote it — a framework-internal rebuild (workspace startup, a
277
243
  * cascade relink, a `didClose`-reload) or a genuine author gap. Honest about
278
- * absence so routing consumers (`ModelService.isNonLanguageClientEdit`)
279
- * test `undefined` directly rather than against a sentinel; the presentation
244
+ * absence so a routing consumer tests `undefined` directly rather than
245
+ * against a sentinel; the presentation
280
246
  * default ({@link UNKNOWN_CLIENT_ID}) is applied at the boundary that needs a
281
247
  * concrete value (the `onUpdate` event's `sourceClientId`, the data-server's
282
248
  * `resolveSourceClientId`).
@@ -303,7 +269,7 @@ export declare class DefaultAstDocumentManager<TAst extends AstNode, TDiagnostic
303
269
  * callers don't need to pass it — the manager owns content and version
304
270
  * sequencing.
305
271
  *
306
- * The text is taken synchronously, before the save waits in the URI's disk
272
+ * The text is taken synchronously, before the save waits in the file's task
307
273
  * queue; the compare and the write run in the queue. Taken later, a save
308
274
  * that waits behind another writes whatever the store holds when its turn
309
275
  * comes, edits made after the call included, and announces that text under
@@ -318,9 +284,8 @@ export declare class DefaultAstDocumentManager<TAst extends AstNode, TDiagnostic
318
284
  * Throws if no document is open for `uri`.
319
285
  */
320
286
  save(uri: string, clientId: string): Promise<void>;
321
- /** Write `text` to `uri` unless the file already holds it, then announce the save. Runs inside the URI's disk queue. */
287
+ /** Write `text` to `uri` unless the file already holds it, then announce the save. Runs inside the file's task queue. */
322
288
  protected writeSave(uri: CanonicalUri, text: string, clientId: string): Promise<void>;
323
- queueDiskTask<T>(uri: string, task: () => Promise<T>): Promise<T>;
324
289
  /**
325
290
  * Whether the file at `uri` already holds `text`.
326
291
  *
@@ -332,7 +297,6 @@ export declare class DefaultAstDocumentManager<TAst extends AstNode, TDiagnostic
332
297
  */
333
298
  protected matchesDisk(uri: string, text: string): Promise<boolean>;
334
299
  isOpen(uri: string): boolean;
335
- isTriggeringEdit(uri: string): boolean;
336
300
  /**
337
301
  * The `LangiumDocument` for an externally-supplied URI, looked up by its
338
302
  * canonical identity. Folds the `getDocument(toUri(canonicalUri(uri)))` idiom
@@ -1 +1 @@
1
- {"version":3,"file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CAAC,IAAI,CAAC;IAIhD;;;;;;;;;;OAUG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ1E;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BxD,yHAAyH;cACzG,SAAS,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY3F;;;;;;;;OAQG;cACa,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAOxE,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5B;;;;;;OAMG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;cAIrC,kCAAkC,CAC/C,GAAG,EAAE,MAAM,EACX,UAAU,GAAE,MAAoC,EAChD,OAAO,SAAI,EACX,IAAI,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,CAAC;IAa5B;;;;OAIG;IACH,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,eAAe,GAAG,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC;CAGpF"}
@@ -72,13 +72,6 @@ export var AstDocument;
72
72
  export class DefaultAstDocumentManager {
73
73
  services;
74
74
  lastUpdate;
75
- /**
76
- * Per canonical URI, the settling of the last disk task queued for it; the
77
- * next task chains behind it. An entry leaves once its URI's queue is idle.
78
- * Kept outside the workspace lock, whose `write` cancels the write before
79
- * it: a save cancelled that way reports success for text it never wrote.
80
- */
81
- diskQueues = new Map();
82
75
  /** Per canonical URI, the newest save queued for it, which {@link coalesceSaves} lets older queued saves defer to. */
83
76
  newestSaves = new Map();
84
77
  coalesceSaves;
@@ -216,8 +209,8 @@ export class DefaultAstDocumentManager {
216
209
  * The client that authored `document`'s current version, or `undefined` when
217
210
  * no client wrote it — a framework-internal rebuild (workspace startup, a
218
211
  * cascade relink, a `didClose`-reload) or a genuine author gap. Honest about
219
- * absence so routing consumers (`ModelService.isNonLanguageClientEdit`)
220
- * test `undefined` directly rather than against a sentinel; the presentation
212
+ * absence so a routing consumer tests `undefined` directly rather than
213
+ * against a sentinel; the presentation
221
214
  * default ({@link UNKNOWN_CLIENT_ID}) is applied at the boundary that needs a
222
215
  * concrete value (the `onUpdate` event's `sourceClientId`, the data-server's
223
216
  * `resolveSourceClientId`).
@@ -227,9 +220,9 @@ export class DefaultAstDocumentManager {
227
220
  }
228
221
  async open(args) {
229
222
  // `open()` is the RPC-level "ensure this document is loaded" call. It is issued
230
- // by a view attaching, but also internally by `update()` / `save()` and by every
231
- // additional client attaching to the same URI, including the several sub-editors
232
- // a composite view opens. When the document is already loaded there is nothing to
223
+ // by a session opening the document, including by every additional client
224
+ // attaching to the same URI and the several sub-editors a composite view
225
+ // opens. When the document is already loaded there is nothing to
233
226
  // do here but hand back the close-disposable — callers that want the current
234
227
  // state read it from this method's surrounding RPC response, not from a re-build.
235
228
  //
@@ -244,17 +237,20 @@ export class DefaultAstDocumentManager {
244
237
  // wires `onDidOpen -> this.open`, it would fire a second, identical rebuild on
245
238
  // every first open.
246
239
  //
247
- // So an already-open `open()` records the attaching client's hold and nothing
248
- // else. The hold is per `(uri, clientId)` and the last-close revert counts down
249
- // to it, so skipping it lets the first holder's close tear down a document
250
- // another client is still reading.
240
+ // So an already-open `open()` records the attaching client's open and nothing
241
+ // else. The open is per `(uri, clientId)` and the last-close revert counts down
242
+ // to it, so skipping it lets the first client's close tear down a document
243
+ // another client is still reading. A document waiting out the revert grace
244
+ // is still loaded: a client lost from it within its own grace attaches and
245
+ // keeps its text, and for any other client the attach releases it, so the
246
+ // open reads the file.
247
+ if (this.isOpen(args.uri)) {
248
+ this.textDocuments.attachClient(args.uri, args.clientId);
249
+ }
251
250
  if (!this.isOpen(args.uri)) {
252
251
  const textDocument = await this.createDocumentFromTextOrFileSystem(args.uri, args.languageId, args.version, args.text);
253
252
  this.textDocuments.notifyDidOpenTextDocument({ textDocument }, args.clientId);
254
253
  }
255
- else {
256
- this.textDocuments.attachClient(args.uri, args.clientId);
257
- }
258
254
  return Disposable.create(() => this.close(args));
259
255
  }
260
256
  async close(args) {
@@ -285,7 +281,7 @@ export class DefaultAstDocumentManager {
285
281
  * callers don't need to pass it — the manager owns content and version
286
282
  * sequencing.
287
283
  *
288
- * The text is taken synchronously, before the save waits in the URI's disk
284
+ * The text is taken synchronously, before the save waits in the file's task
289
285
  * queue; the compare and the write run in the queue. Taken later, a save
290
286
  * that waits behind another writes whatever the store holds when its turn
291
287
  * comes, edits made after the call included, and announces that text under
@@ -310,7 +306,7 @@ export class DefaultAstDocumentManager {
310
306
  }
311
307
  const text = document.getText();
312
308
  let supersededBy;
313
- const saved = this.queueDiskTask(canonical, async () => {
309
+ const saved = this.services.workspace.FileSystemTaskQueue.enqueue(canonical, async () => {
314
310
  const newest = this.newestSaves.get(canonical);
315
311
  if (this.coalesceSaves && newest !== saved) {
316
312
  supersededBy = newest;
@@ -327,7 +323,7 @@ export class DefaultAstDocumentManager {
327
323
  this.newestSaves.set(canonical, saved);
328
324
  return saved;
329
325
  }
330
- /** Write `text` to `uri` unless the file already holds it, then announce the save. Runs inside the URI's disk queue. */
326
+ /** Write `text` to `uri` unless the file already holds it, then announce the save. Runs inside the file's task queue. */
331
327
  async writeSave(uri, text, clientId) {
332
328
  if (!(await this.matchesDisk(uri, text))) {
333
329
  await this.tracer.with(uri).time(`Write file (${text.length} bytes, from ${clientId})`,
@@ -336,18 +332,6 @@ export class DefaultAstDocumentManager {
336
332
  }
337
333
  this.textDocuments.notifyDidSaveTextDocument({ textDocument: TextDocumentIdentifier.create(uri), text }, clientId);
338
334
  }
339
- queueDiskTask(uri, task) {
340
- const key = this.uriPolicy.canonicalUri(uri);
341
- const result = (this.diskQueues.get(key) ?? Promise.resolve()).then(task);
342
- const settled = result.then(() => undefined, () => undefined);
343
- this.diskQueues.set(key, settled);
344
- void settled.then(() => {
345
- if (this.diskQueues.get(key) === settled) {
346
- this.diskQueues.delete(key);
347
- }
348
- });
349
- return result;
350
- }
351
335
  /**
352
336
  * Whether the file at `uri` already holds `text`.
353
337
  *
@@ -366,10 +350,6 @@ export class DefaultAstDocumentManager {
366
350
  isOpen(uri) {
367
351
  return !!this.textDocuments.get(uri);
368
352
  }
369
- isTriggeringEdit(uri) {
370
- const canonical = this.uriPolicy.canonicalUri(uri);
371
- return this.lastUpdate?.changed.some(changed => this.uriPolicy.canonicalUri(changed) === canonical) ?? false;
372
- }
373
353
  /**
374
354
  * The `LangiumDocument` for an externally-supplied URI, looked up by its
375
355
  * canonical identity. Folds the `getDocument(toUri(canonicalUri(uri)))` idiom
@@ -381,13 +361,14 @@ export class DefaultAstDocumentManager {
381
361
  return this.langiumDocs.getDocument(UriUtils.toUri(this.uriPolicy.canonicalUri(uri)));
382
362
  }
383
363
  async createDocumentFromTextOrFileSystem(uri, languageId = this.resolveLanguageId(uri), version = 0, text) {
384
- // Read in the disk queue: a read beside a queued save of the file returns
385
- // the text from before it, and the document then opens on that.
364
+ // Read in the file's task queue: a read beside a queued save of the file
365
+ // returns the text from before it, and the document then opens on that.
386
366
  return {
387
367
  uri,
388
368
  languageId,
389
369
  version,
390
- text: text ?? (await this.queueDiskTask(uri, () => this.fileSystemProvider.readFile(UriUtils.toUri(uri))))
370
+ text: text ??
371
+ (await this.services.workspace.FileSystemTaskQueue.enqueue(uri, () => this.fileSystemProvider.readFile(UriUtils.toUri(uri))))
391
372
  };
392
373
  }
393
374
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ast-document-manager.js","sourceRoot":"","sources":["../../src/documents/ast-document-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAOJ,iBA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E,OAAO;YACJ,GAAG;YACH,UAAU;YACV,OAAO;YACP,IAAI,EACD,IAAI;gBACJ,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,mBAAmB,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAClI,CAAC;IACL,CAAC;IAED;;;;OAIG;IACO,aAAa,CAAC,QAAyB;QAC9C,OAAO,WAAW,CAAC,IAAI,CAAoB,QAAQ,CAAC,CAAC;IACxD,CAAC;CACH"}
@@ -7,38 +7,9 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  /**
10
- * Thrown by every call on a client session after it ended, and by an open that
11
- * was still in flight when its session ended.
12
- *
13
- * The message names the client id, so it is addressed to whoever composes the
14
- * system rather than to an end user.
15
- */
16
- export declare class SessionClosedError extends Error {
17
- readonly clientId: string;
18
- constructor(clientId: string);
19
- }
20
- /**
21
- * Thrown when a client session writes a document it does not have open.
22
- *
23
- * A session writes only what it has open, so this is the answer both to a write
24
- * that never opened and to one whose open was closed underneath it — by the
25
- * session itself, or by the document being deleted.
26
- */
27
- export declare class DocumentNotOpenError extends Error {
28
- readonly uri: string;
29
- readonly clientId: string;
30
- constructor(uri: string, clientId: string);
31
- }
32
- /**
33
- * Thrown when a client session is started under an id that is already live in
34
- * the process, or that the framework reserves for itself.
35
- *
36
- * Ids are unique process-wide because the id is also the author label on every
37
- * version and the key a client recognises its own echoes by; two participants
38
- * sharing one would each take the other's writes for their own.
10
+ * Re-export, because these errors cross the wire and the side that has to
11
+ * recognise them is the client. They are defined in `@hydranium/protocol` so a
12
+ * frontend can name them without depending on the server tier.
39
13
  */
40
- export declare class DuplicateClientIdError extends Error {
41
- readonly clientId: string;
42
- constructor(clientId: string);
43
- }
14
+ export { DocumentNotOpenError, DuplicateClientIdError, SessionClosedError, isDocumentNotOpenError, isDuplicateClientIdError, isSessionClosedError } from '@hydranium/protocol';
44
15
  //# sourceMappingURL=client-session-errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client-session-errors.d.ts","sourceRoot":"","sources":["../../src/documents/client-session-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;GAMG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM;gBAAhB,QAAQ,EAAE,MAAM;CAIvC;AAED;;;;;;GAMG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAEzC,QAAQ,CAAC,GAAG,EAAE,MAAM;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM;gBADhB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM;CAK9B;AAED;;;;;;;GAOG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM;gBAAhB,QAAQ,EAAE,MAAM;CAIvC"}
1
+ {"version":3,"file":"client-session-errors.d.ts","sourceRoot":"","sources":["../../src/documents/client-session-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;GAIG;AACH,OAAO,EACJ,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACtB,MAAM,qBAAqB,CAAC"}
@@ -7,51 +7,9 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  /**
10
- * Thrown by every call on a client session after it ended, and by an open that
11
- * was still in flight when its session ended.
12
- *
13
- * The message names the client id, so it is addressed to whoever composes the
14
- * system rather than to an end user.
15
- */
16
- export class SessionClosedError extends Error {
17
- clientId;
18
- constructor(clientId) {
19
- super(`Client session ${clientId} is closed`);
20
- this.clientId = clientId;
21
- this.name = 'SessionClosedError';
22
- }
23
- }
24
- /**
25
- * Thrown when a client session writes a document it does not have open.
26
- *
27
- * A session writes only what it has open, so this is the answer both to a write
28
- * that never opened and to one whose open was closed underneath it — by the
29
- * session itself, or by the document being deleted.
30
- */
31
- export class DocumentNotOpenError extends Error {
32
- uri;
33
- clientId;
34
- constructor(uri, clientId) {
35
- super(`Document ${uri} is not open in client session ${clientId}`);
36
- this.uri = uri;
37
- this.clientId = clientId;
38
- this.name = 'DocumentNotOpenError';
39
- }
40
- }
41
- /**
42
- * Thrown when a client session is started under an id that is already live in
43
- * the process, or that the framework reserves for itself.
44
- *
45
- * Ids are unique process-wide because the id is also the author label on every
46
- * version and the key a client recognises its own echoes by; two participants
47
- * sharing one would each take the other's writes for their own.
10
+ * Re-export, because these errors cross the wire and the side that has to
11
+ * recognise them is the client. They are defined in `@hydranium/protocol` so a
12
+ * frontend can name them without depending on the server tier.
48
13
  */
49
- export class DuplicateClientIdError extends Error {
50
- clientId;
51
- constructor(clientId) {
52
- super(`Client id ${clientId} is already in use`);
53
- this.clientId = clientId;
54
- this.name = 'DuplicateClientIdError';
55
- }
56
- }
14
+ export { DocumentNotOpenError, DuplicateClientIdError, SessionClosedError, isDocumentNotOpenError, isDuplicateClientIdError, isSessionClosedError } from '@hydranium/protocol';
57
15
  //# sourceMappingURL=client-session-errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client-session-errors.js","sourceRoot":"","sources":["../../src/documents/client-session-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;GAMG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACrB;IAArB,YAAqB,QAAgB;QAClC,KAAK,CAAC,kBAAkB,QAAQ,YAAY,CAAC,CAAC;QAD5B,aAAQ,GAAR,QAAQ,CAAQ;QAElC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACpC,CAAC;CACH;AAED;;;;;;GAMG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAEhC;IACA;IAFZ,YACY,GAAW,EACX,QAAgB;QAEzB,KAAK,CAAC,YAAY,GAAG,kCAAkC,QAAQ,EAAE,CAAC,CAAC;QAH1D,QAAG,GAAH,GAAG,CAAQ;QACX,aAAQ,GAAR,QAAQ,CAAQ;QAGzB,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACtC,CAAC;CACH;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IACzB;IAArB,YAAqB,QAAgB;QAClC,KAAK,CAAC,aAAa,QAAQ,oBAAoB,CAAC,CAAC;QAD/B,aAAQ,GAAR,QAAQ,CAAQ;QAElC,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACxC,CAAC;CACH"}
1
+ {"version":3,"file":"client-session-errors.js","sourceRoot":"","sources":["../../src/documents/client-session-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;GAIG;AACH,OAAO,EACJ,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACtB,MAAM,qBAAqB,CAAC"}
@@ -7,27 +7,38 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  import { type CanonicalUri } from '@hydranium/protocol';
10
- import { Emitter, type Event } from 'vscode-languageserver';
10
+ import { type Disposable, Emitter, type Event } from 'vscode-languageserver';
11
11
  /**
12
- * What a client session states about one of its opens, kept per
13
- * `(session, uri)` for as long as that open lasts.
12
+ * What a client session states about one of its opens, kept by the session
13
+ * and readable only while that open lasts.
14
14
  *
15
15
  * Any object type: an adopter declares the fields its own open path reads and
16
- * passes that type as a session's `TOpenOptions`. Stored per open rather than
16
+ * passes that type as a session's `TOpenOptions`. Kept per open rather than
17
17
  * per document, so two sessions opening one document with different options
18
18
  * each keep their own.
19
19
  */
20
20
  export type OpenOptions = object;
21
21
  /**
22
- * `'closing'` covers the span in which a session's opens are being closed. The
23
- * id is still taken then, and the session can open nothing more, so an open
24
- * issued from a close listener cannot outlive the session that made it.
22
+ * A session is `'live'` from its registration, which is synchronous, so no
23
+ * state comes before it. `'closing'` covers the span in which the session's
24
+ * opens are being closed: the id is still taken, and the session can open
25
+ * nothing more, so an open issued from a close listener cannot outlive the
26
+ * session that made it. An id with no state has no session: it was never
27
+ * registered, or has closed.
25
28
  */
26
29
  export type ClientSessionState = 'live' | 'closing';
27
30
  /** Delivered by {@link ClientSessionRegistry.onDidCloseSession}. */
28
31
  export interface ClientSessionClosedEvent {
29
32
  readonly clientId: string;
30
33
  }
34
+ /**
35
+ * Why a close happened. `'lost'` is a close caused by the client's connection
36
+ * going away rather than by the client, and only such a last close waits out
37
+ * the store's revert grace: a client that closed or ended on purpose has
38
+ * discarded its unsaved edits, while one that lost its connection may be about
39
+ * to register again and open the document once more.
40
+ */
41
+ export type SessionEndCause = 'closed' | 'lost';
31
42
  /**
32
43
  * The ids no client session may be started under: the wire's well-known ids and
33
44
  * the integrity author. Each names a framework participant rather than a
@@ -40,11 +51,11 @@ export declare const RESERVED_CLIENT_IDS: readonly string[];
40
51
  * sessions — the open facts every head shares, composed by
41
52
  * `HydraniumTextDocuments`.
42
53
  *
43
- * Opens are recorded for every client id, registered or not. An id that was
44
- * never registered is a client that predates sessions and writes through the
45
- * flat `clientId` calls; its opens are tracked exactly as a session's are, and
46
- * only the session table ignores it. Requiring registration before an open
47
- * would refuse every such client.
54
+ * Opens are recorded for every client id, registered or not. The language
55
+ * client opens under its reserved id without a session, over the LSP
56
+ * connection, and its opens are tracked exactly as a session's are; only the
57
+ * session table ignores it. Requiring registration before an open would refuse
58
+ * the editor.
48
59
  *
49
60
  * One open per `(client, uri)`, with no reference count: a repeat open changes
50
61
  * nothing, and one close ends it.
@@ -56,10 +67,16 @@ export declare const RESERVED_CLIENT_IDS: readonly string[];
56
67
  export declare class ClientSessionRegistry {
57
68
  protected readonly sessions: Map<string, ClientSessionState>;
58
69
  protected readonly clientsByUri: Map<CanonicalUri, Set<string>>;
59
- /** Each client's opens, with the options it opened them with. */
60
- protected readonly opensByClient: Map<string, Map<CanonicalUri, object | undefined>>;
70
+ protected readonly opensByClient: Map<string, Set<CanonicalUri>>;
61
71
  protected readonly reservedIds: ReadonlySet<string>;
62
72
  protected readonly sessionClosedEmitter: Emitter<ClientSessionClosedEvent>;
73
+ /**
74
+ * The documents whose last open closed with a lost connection and whose
75
+ * revert is deferred, each with the timer that runs it. Any open of such a
76
+ * document cancels its timer; the store decides whether the opener keeps the
77
+ * unsaved text.
78
+ */
79
+ protected readonly pendingReverts: Map<CanonicalUri, Disposable>;
63
80
  /** Fires once a session has been removed from the table, after all its opens closed. */
64
81
  get onDidCloseSession(): Event<ClientSessionClosedEvent>;
65
82
  /**
@@ -83,7 +100,7 @@ export declare class ClientSessionRegistry {
83
100
  /** Remove `clientId` from the session table and announce it. A no-op for an id that is not registered. */
84
101
  unregister(clientId: string): void;
85
102
  /**
86
- * Record that `clientId` opened `uri`, with no options. Returns `false` when
103
+ * Record that `clientId` opened `uri`. Returns `false` when
87
104
  * it already had it open, in which case nothing changes.
88
105
  *
89
106
  * Throws {@link SessionClosedError} for a session that is closing.
@@ -104,12 +121,15 @@ export declare class ClientSessionRegistry {
104
121
  readonly uri: CanonicalUri;
105
122
  readonly clients: string[];
106
123
  }>;
107
- /** The options `clientId` opened `uri` with, or `undefined` when it gave none or does not have it open. */
108
- openOptions(uri: CanonicalUri, clientId: string): OpenOptions | undefined;
109
- /** Replace the options of an existing open. Does nothing when `clientId` does not have `uri` open. */
110
- setOpenOptions(uri: CanonicalUri, clientId: string, options: OpenOptions | undefined): void;
124
+ /** Record `timer` as the deferred revert of `uri`. */
125
+ deferRevert(uri: CanonicalUri, timer: Disposable): void;
126
+ /** Whether the revert of `uri` is deferred. */
127
+ isRevertPending(uri: CanonicalUri): boolean;
128
+ /** Cancel the deferred revert of `uri`, if one is pending. */
129
+ cancelRevert(uri: CanonicalUri): void;
111
130
  /**
112
- * Forget every session and open without announcing anything. Subscriptions
131
+ * Forget every session, open and deferred revert without announcing
132
+ * anything, for a test double that resets between tests. Subscriptions
113
133
  * stay, so a listener registered before the clear hears the sessions that
114
134
  * end after it.
115
135
  */
@@ -1 +1 @@
1
- {"version":3,"file":"client-session-registry.d.ts","sourceRoot":"","sources":["../../src/documents/client-session-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAI5D;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAAC;AAEpD,oEAAoE;AACpE,MAAM,WAAW,wBAAwB;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAAmD,CAAC;AAErG;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,qBAAqB;IAC/B,SAAS,CAAC,QAAQ,CAAC,QAAQ,kCAAyC;IACpE,SAAS,CAAC,QAAQ,CAAC,YAAY,iCAAwC;IACvE,iEAAiE;IACjE,SAAS,CAAC,QAAQ,CAAC,aAAa,qDAAiE;IACjG,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAgC;IACnF,SAAS,CAAC,QAAQ,CAAC,oBAAoB,oCAA2C;IAElF,wFAAwF;IACxF,IAAI,iBAAiB,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAEvD;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAOhC,mEAAmE;IACnE,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIvC;;;OAGG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,EAAE;IAO5C,0G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