@hydranium/glsp-server 1.0.0-next.31 → 1.0.0-next.315

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 (217) hide show
  1. package/README.md +80 -88
  2. package/lib/browser/start-glsp-server-in-worker.d.ts +43 -42
  3. package/lib/browser/start-glsp-server-in-worker.d.ts.map +1 -1
  4. package/lib/browser/start-glsp-server-in-worker.js +62 -13
  5. package/lib/browser/start-glsp-server-in-worker.js.map +1 -1
  6. package/lib/command/diagram-edit-dropped-error.d.ts +31 -0
  7. package/lib/command/diagram-edit-dropped-error.d.ts.map +1 -0
  8. package/lib/command/diagram-edit-dropped-error.js +48 -0
  9. package/lib/command/diagram-edit-dropped-error.js.map +1 -0
  10. package/lib/command/hydranium-glsp-command-stack.d.ts +33 -0
  11. package/lib/command/hydranium-glsp-command-stack.d.ts.map +1 -0
  12. package/lib/command/hydranium-glsp-command-stack.js +63 -0
  13. package/lib/command/hydranium-glsp-command-stack.js.map +1 -0
  14. package/lib/command/hydranium-glsp-operation-action-handler.d.ts +64 -0
  15. package/lib/command/hydranium-glsp-operation-action-handler.d.ts.map +1 -0
  16. package/lib/command/hydranium-glsp-operation-action-handler.js +142 -0
  17. package/lib/command/hydranium-glsp-operation-action-handler.js.map +1 -0
  18. package/lib/command/hydranium-glsp-operation-command.d.ts +250 -0
  19. package/lib/command/hydranium-glsp-operation-command.d.ts.map +1 -0
  20. package/lib/command/hydranium-glsp-operation-command.js +491 -0
  21. package/lib/command/hydranium-glsp-operation-command.js.map +1 -0
  22. package/lib/command/hydranium-glsp-recording-command.d.ts +26 -87
  23. package/lib/command/hydranium-glsp-recording-command.d.ts.map +1 -1
  24. package/lib/command/hydranium-glsp-recording-command.js +40 -117
  25. package/lib/command/hydranium-glsp-recording-command.js.map +1 -1
  26. package/lib/command/hydranium-glsp-undo-redo-action-handler.d.ts +23 -0
  27. package/lib/command/hydranium-glsp-undo-redo-action-handler.d.ts.map +1 -0
  28. package/lib/command/hydranium-glsp-undo-redo-action-handler.js +41 -0
  29. package/lib/command/hydranium-glsp-undo-redo-action-handler.js.map +1 -0
  30. package/lib/command/index.d.ts +5 -0
  31. package/lib/command/index.d.ts.map +1 -1
  32. package/lib/command/index.js +5 -0
  33. package/lib/command/index.js.map +1 -1
  34. package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.d.ts +1 -1
  35. package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.d.ts.map +1 -1
  36. package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.js +2 -2
  37. package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.js.map +1 -1
  38. package/lib/dispatcher/server-action-dispatcher.d.ts +25 -24
  39. package/lib/dispatcher/server-action-dispatcher.d.ts.map +1 -1
  40. package/lib/dispatcher/server-action-dispatcher.js +38 -26
  41. package/lib/dispatcher/server-action-dispatcher.js.map +1 -1
  42. package/lib/index.d.ts +1 -0
  43. package/lib/index.d.ts.map +1 -1
  44. package/lib/index.js +1 -0
  45. package/lib/index.js.map +1 -1
  46. package/lib/launcher/abstract-hydranium-glsp-diagram-module.d.ts +35 -59
  47. package/lib/launcher/abstract-hydranium-glsp-diagram-module.d.ts.map +1 -1
  48. package/lib/launcher/abstract-hydranium-glsp-diagram-module.js +60 -71
  49. package/lib/launcher/abstract-hydranium-glsp-diagram-module.js.map +1 -1
  50. package/lib/launcher/drop-notifications-to-gone-client.d.ts +23 -0
  51. package/lib/launcher/drop-notifications-to-gone-client.d.ts.map +1 -0
  52. package/lib/launcher/drop-notifications-to-gone-client.js +43 -0
  53. package/lib/launcher/drop-notifications-to-gone-client.js.map +1 -0
  54. package/lib/launcher/glsp-app-module.d.ts +1 -2
  55. package/lib/launcher/glsp-app-module.d.ts.map +1 -1
  56. package/lib/launcher/glsp-app-module.js.map +1 -1
  57. package/lib/launcher/glsp-connection-logger.d.ts +19 -0
  58. package/lib/launcher/glsp-connection-logger.d.ts.map +1 -0
  59. package/lib/launcher/glsp-connection-logger.js +24 -0
  60. package/lib/launcher/glsp-connection-logger.js.map +1 -0
  61. package/lib/launcher/glsp-server-overrides.d.ts +10 -8
  62. package/lib/launcher/glsp-server-overrides.d.ts.map +1 -1
  63. package/lib/launcher/glsp-server-overrides.js +25 -11
  64. package/lib/launcher/glsp-server-overrides.js.map +1 -1
  65. package/lib/launcher/hydranium-glsp-server.d.ts +60 -15
  66. package/lib/launcher/hydranium-glsp-server.d.ts.map +1 -1
  67. package/lib/launcher/hydranium-glsp-server.js +145 -22
  68. package/lib/launcher/hydranium-glsp-server.js.map +1 -1
  69. package/lib/launcher/index.d.ts +2 -0
  70. package/lib/launcher/index.d.ts.map +1 -1
  71. package/lib/launcher/index.js +5 -4
  72. package/lib/launcher/index.js.map +1 -1
  73. package/lib/logging/glsp-client-logger.d.ts +10 -6
  74. package/lib/logging/glsp-client-logger.d.ts.map +1 -1
  75. package/lib/logging/glsp-client-logger.js +14 -7
  76. package/lib/logging/glsp-client-logger.js.map +1 -1
  77. package/lib/messages/index.d.ts +11 -6
  78. package/lib/messages/index.d.ts.map +1 -1
  79. package/lib/messages/index.js +11 -6
  80. package/lib/messages/index.js.map +1 -1
  81. package/lib/node/start-glsp-server.d.ts +50 -15
  82. package/lib/node/start-glsp-server.d.ts.map +1 -1
  83. package/lib/node/start-glsp-server.js +97 -30
  84. package/lib/node/start-glsp-server.js.map +1 -1
  85. package/lib/state/abstract-hydranium-glsp-state.d.ts +326 -102
  86. package/lib/state/abstract-hydranium-glsp-state.d.ts.map +1 -1
  87. package/lib/state/abstract-hydranium-glsp-state.js +529 -139
  88. package/lib/state/abstract-hydranium-glsp-state.js.map +1 -1
  89. package/lib/state/diagram-status.d.ts +38 -0
  90. package/lib/state/diagram-status.d.ts.map +1 -0
  91. package/lib/state/diagram-status.js +27 -0
  92. package/lib/state/diagram-status.js.map +1 -0
  93. package/lib/state/full-text-hydranium-glsp-state.d.ts +22 -9
  94. package/lib/state/full-text-hydranium-glsp-state.d.ts.map +1 -1
  95. package/lib/state/full-text-hydranium-glsp-state.js +45 -18
  96. package/lib/state/full-text-hydranium-glsp-state.js.map +1 -1
  97. package/lib/state/hydranium-glsp-index.d.ts +40 -29
  98. package/lib/state/hydranium-glsp-index.d.ts.map +1 -1
  99. package/lib/state/hydranium-glsp-index.js +82 -45
  100. package/lib/state/hydranium-glsp-index.js.map +1 -1
  101. package/lib/state/hydranium-shared-core-services.d.ts +16 -29
  102. package/lib/state/hydranium-shared-core-services.d.ts.map +1 -1
  103. package/lib/state/hydranium-shared-core-services.js +15 -28
  104. package/lib/state/hydranium-shared-core-services.js.map +1 -1
  105. package/lib/state/index.d.ts +1 -0
  106. package/lib/state/index.d.ts.map +1 -1
  107. package/lib/state/index.js +1 -0
  108. package/lib/state/index.js.map +1 -1
  109. package/lib/state/model-ready-timeout-error.d.ts.map +1 -1
  110. package/lib/state/model-ready-timeout-error.js.map +1 -1
  111. package/lib/state/reconcile-source-model-write.d.ts +13 -27
  112. package/lib/state/reconcile-source-model-write.d.ts.map +1 -1
  113. package/lib/state/reconcile-source-model-write.js +44 -32
  114. package/lib/state/reconcile-source-model-write.js.map +1 -1
  115. package/lib/state/reconciling-multi-document-glsp-state.d.ts +125 -69
  116. package/lib/state/reconciling-multi-document-glsp-state.d.ts.map +1 -1
  117. package/lib/state/reconciling-multi-document-glsp-state.js +242 -100
  118. package/lib/state/reconciling-multi-document-glsp-state.js.map +1 -1
  119. package/lib/state/reconciling-transfer-hydranium-glsp-state.d.ts +36 -28
  120. package/lib/state/reconciling-transfer-hydranium-glsp-state.d.ts.map +1 -1
  121. package/lib/state/reconciling-transfer-hydranium-glsp-state.js +59 -42
  122. package/lib/state/reconciling-transfer-hydranium-glsp-state.js.map +1 -1
  123. package/lib/status/diagram-status-reporter.d.ts +44 -0
  124. package/lib/status/diagram-status-reporter.d.ts.map +1 -0
  125. package/lib/status/diagram-status-reporter.js +88 -0
  126. package/lib/status/diagram-status-reporter.js.map +1 -0
  127. package/lib/status/hydranium-glsp-request-model-action-handler.d.ts +27 -0
  128. package/lib/status/hydranium-glsp-request-model-action-handler.d.ts.map +1 -0
  129. package/lib/status/hydranium-glsp-request-model-action-handler.js +52 -0
  130. package/lib/status/hydranium-glsp-request-model-action-handler.js.map +1 -0
  131. package/lib/status/hydranium-glsp-set-edit-mode-action-handler.d.ts +27 -0
  132. package/lib/status/hydranium-glsp-set-edit-mode-action-handler.d.ts.map +1 -0
  133. package/lib/status/hydranium-glsp-set-edit-mode-action-handler.js +53 -0
  134. package/lib/status/hydranium-glsp-set-edit-mode-action-handler.js.map +1 -0
  135. package/lib/status/index.d.ts +12 -0
  136. package/lib/status/index.d.ts.map +1 -0
  137. package/lib/status/index.js +12 -0
  138. package/lib/status/index.js.map +1 -0
  139. package/lib/storage/hydranium-glsp-request-save-model-action-handler.d.ts +30 -0
  140. package/lib/storage/hydranium-glsp-request-save-model-action-handler.d.ts.map +1 -0
  141. package/lib/storage/hydranium-glsp-request-save-model-action-handler.js +47 -0
  142. package/lib/storage/hydranium-glsp-request-save-model-action-handler.js.map +1 -0
  143. package/lib/storage/hydranium-glsp-storage.d.ts +324 -143
  144. package/lib/storage/hydranium-glsp-storage.d.ts.map +1 -1
  145. package/lib/storage/hydranium-glsp-storage.js +569 -213
  146. package/lib/storage/hydranium-glsp-storage.js.map +1 -1
  147. package/lib/storage/index.d.ts +2 -1
  148. package/lib/storage/index.d.ts.map +1 -1
  149. package/lib/storage/index.js +2 -1
  150. package/lib/storage/index.js.map +1 -1
  151. package/lib/storage/save-delivery-policy.d.ts +51 -0
  152. package/lib/storage/save-delivery-policy.d.ts.map +1 -0
  153. package/lib/storage/{save-conflict-policy.js → save-delivery-policy.js} +7 -8
  154. package/lib/storage/save-delivery-policy.js.map +1 -0
  155. package/lib/submission/hydranium-glsp-submission-handler.d.ts +44 -4
  156. package/lib/submission/hydranium-glsp-submission-handler.d.ts.map +1 -1
  157. package/lib/submission/hydranium-glsp-submission-handler.js +82 -6
  158. package/lib/submission/hydranium-glsp-submission-handler.js.map +1 -1
  159. package/lib/testing/glsp-harness.d.ts +34 -7
  160. package/lib/testing/glsp-harness.d.ts.map +1 -1
  161. package/lib/testing/glsp-harness.js +47 -19
  162. package/lib/testing/glsp-harness.js.map +1 -1
  163. package/lib/validation/diagnostic-markers.d.ts +3 -3
  164. package/lib/validation/diagnostic-markers.d.ts.map +1 -1
  165. package/lib/validation/diagnostic-markers.js +1 -1
  166. package/lib/validation/diagnostic-markers.js.map +1 -1
  167. package/lib/validation/hydranium-glsp-model-validator.d.ts +1 -2
  168. package/lib/validation/hydranium-glsp-model-validator.d.ts.map +1 -1
  169. package/lib/validation/hydranium-glsp-model-validator.js +1 -1
  170. package/lib/validation/hydranium-glsp-model-validator.js.map +1 -1
  171. package/package.json +31 -52
  172. package/src/browser/start-glsp-server-in-worker.ts +79 -51
  173. package/src/command/diagram-edit-dropped-error.ts +51 -0
  174. package/src/command/hydranium-glsp-command-stack.ts +47 -0
  175. package/src/command/hydranium-glsp-operation-action-handler.ts +141 -0
  176. package/src/command/hydranium-glsp-operation-command.ts +602 -0
  177. package/src/command/hydranium-glsp-recording-command.ts +40 -121
  178. package/src/command/hydranium-glsp-undo-redo-action-handler.ts +29 -0
  179. package/src/command/index.ts +10 -0
  180. package/src/computed-bounds/hydranium-glsp-computed-bounds-action-handler.ts +2 -2
  181. package/src/dispatcher/server-action-dispatcher.ts +39 -31
  182. package/src/index.ts +1 -0
  183. package/src/launcher/abstract-hydranium-glsp-diagram-module.ts +79 -91
  184. package/src/launcher/drop-notifications-to-gone-client.ts +47 -0
  185. package/src/launcher/glsp-app-module.ts +1 -2
  186. package/src/launcher/glsp-connection-logger.ts +27 -0
  187. package/src/launcher/glsp-server-overrides.ts +27 -11
  188. package/src/launcher/hydranium-glsp-server.ts +153 -23
  189. package/src/launcher/index.ts +5 -4
  190. package/src/logging/glsp-client-logger.ts +16 -9
  191. package/src/messages/index.ts +16 -6
  192. package/src/node/start-glsp-server.ts +133 -40
  193. package/src/state/abstract-hydranium-glsp-state.ts +609 -154
  194. package/src/state/diagram-status.ts +41 -0
  195. package/src/state/full-text-hydranium-glsp-state.ts +46 -18
  196. package/src/state/hydranium-glsp-index.ts +85 -41
  197. package/src/state/hydranium-shared-core-services.ts +16 -29
  198. package/src/state/index.ts +1 -0
  199. package/src/state/reconcile-source-model-write.ts +51 -53
  200. package/src/state/reconciling-multi-document-glsp-state.ts +276 -102
  201. package/src/state/reconciling-transfer-hydranium-glsp-state.ts +67 -45
  202. package/src/status/diagram-status-reporter.ts +106 -0
  203. package/src/status/hydranium-glsp-request-model-action-handler.ts +43 -0
  204. package/src/status/hydranium-glsp-set-edit-mode-action-handler.ts +38 -0
  205. package/src/status/index.ts +12 -0
  206. package/src/storage/hydranium-glsp-request-save-model-action-handler.ts +40 -0
  207. package/src/storage/hydranium-glsp-storage.ts +647 -223
  208. package/src/storage/index.ts +2 -1
  209. package/src/storage/save-delivery-policy.ts +49 -0
  210. package/src/submission/hydranium-glsp-submission-handler.ts +91 -5
  211. package/src/testing/glsp-harness.ts +67 -25
  212. package/src/validation/diagnostic-markers.ts +3 -3
  213. package/src/validation/hydranium-glsp-model-validator.ts +4 -5
  214. package/lib/storage/save-conflict-policy.d.ts +0 -56
  215. package/lib/storage/save-conflict-policy.d.ts.map +0 -1
  216. package/lib/storage/save-conflict-policy.js.map +0 -1
  217. package/src/storage/save-conflict-policy.ts +0 -52
@@ -6,70 +6,46 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import { DiagramModule } from '@eclipse-glsp/server';
9
+ import { type ActionDispatcher, type ActionHandlerConstructor, type BindingTarget, type ClientSessionInitializer, type CommandStack, DiagramModule, type InstanceMultiBinding, type MultiBinding } from '@eclipse-glsp/server';
10
10
  import { type interfaces } from 'inversify';
11
- import type { LanguageMetaData } from '@hydranium/langium';
11
+ import { DiagramStatusReporter } from '../status/diagram-status-reporter.js';
12
12
  /**
13
- * Bind {@link HydraniumTypes}.DiagramLanguage on a GLSP **session** container
14
- * to the services of `metadata`'s grammar.
15
- *
16
- * Exported separately from {@link AbstractHydraniumGlspDiagramModule} for adopters
17
- * whose diagram module already extends an intermediate base of their own and
18
- * cannot take the framework base class; call it from `configure` after
19
- * `super.configure(...)`. The base class is the preferred entry point because
20
- * it makes the declaration non-optional.
21
- *
22
- * **Why the session tier.** GLSP builds its app container once per process,
23
- * before any document exists, so a per-language service bound there can only
24
- * ever be one grammar's. The session container is created per open diagram
25
- * with its `diagramType` known, and a diagram type has exactly one grammar —
26
- * so the language is a static fact about the module, resolvable with no URI
27
- * and no ordering hazard. That last part is load-bearing: GLSP's
28
- * `OperationHandlerRegistryInitializer` constructs every operation handler at
29
- * `InitializeClientSession`, i.e. BEFORE `RequestModelAction` supplies the
30
- * source URI, so anything derived from `ModelState.sourceUri` at injection
31
- * time would throw on every diagram open.
32
- *
33
- * **The whole language, not pre-resolved providers.** There is deliberately no
34
- * token for an individual per-language provider; see {@link HydraniumTypes} for
35
- * why. Callers reach `modelState.diagramLanguage` or
36
- * `modelState.languageServicesFor(node)` instead, which name the choice.
37
- *
38
- * Resolution is `toDynamicValue` + `inSingletonScope` — deferred so the parent
39
- * container's `SharedCoreServices` is available, then resolved once per
40
- * session rather than per injection.
41
- */
42
- export declare function bindDiagramLanguage(bind: interfaces.Bind, metadata: LanguageMetaData): void;
43
- /**
44
- * GLSP {@link DiagramModule} base that declares which grammar its diagram type
45
- * edits, and binds that language's per-language services on the session
46
- * container.
47
- *
48
- * Subclass instead of `DiagramModule` and implement {@link declareLanguage}
49
- * alongside `diagramType`; the two are the same kind of fact about a diagram
50
- * type, and pairing them is what lets one GLSP head serve N grammars.
51
- *
52
- * Adopter GLSP components then read the language they mean:
53
- * `modelState.diagramLanguage.references.CandidateProvider` for a reference
54
- * written on the canvas, `modelState.languageServicesFor(node).references.X`
55
- * for anything reached through a reference. No per-language service is bound
56
- * to a token of its own — see {@link bindDiagramLanguage} for why.
13
+ * GLSP {@link DiagramModule} base that wires the framework's diagram status,
14
+ * dispatch timing, command stack, save, and transactional operation, undo and
15
+ * redo handlers.
16
+ *
17
+ * A diagram module declares no grammar: a session's language is the one its
18
+ * loaded document routes to, so one diagram type can serve several grammars.
19
+ * Adopter GLSP components read `modelState.diagramLanguage` for a reference
20
+ * written on the canvas and `modelState.languageServicesFor(node)` for
21
+ * anything reached through a reference; see `HydraniumTypes` for why no
22
+ * per-language service has a token of its own.
23
+ *
24
+ * An adopter whose diagram module already extends a base of its own repeats
25
+ * what this class's overrides do. Without the status bindings among them,
26
+ * nothing tells the client why its diagram is read-only; without the operation
27
+ * and undo handlers, operation handlers edit the built root every reader
28
+ * shares.
57
29
  */
58
30
  export declare abstract class AbstractHydraniumGlspDiagramModule extends DiagramModule {
31
+ protected configure(bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind): void;
32
+ /** The {@link DiagramStatusReporter} of the session; {@link DefaultDiagramStatusReporter} by default. */
33
+ protected bindDiagramStatusReporter(): BindingTarget<DiagramStatusReporter>;
34
+ /** Starts the {@link DiagramStatusReporter} with the session, since nothing else injects it. */
35
+ configureClientSessionInitializers(binding: MultiBinding<ClientSessionInitializer>): void;
36
+ /** {@link HydraniumGlspServerActionDispatcher}, so every dispatch is timed once logging is at debug. */
37
+ protected bindActionDispatcher(): BindingTarget<ActionDispatcher>;
38
+ /** {@link HydraniumGlspCommandStack}, so the diagram is dirty exactly while a document it has open is. */
39
+ protected bindCommandStack(): BindingTarget<CommandStack>;
59
40
  /**
60
- * The `LanguageMetaData` of the grammar this diagram type edits — pass the
61
- * generated `<Grammar>LanguageMetaData` constant directly.
62
- *
63
- * Abstract rather than optional so a new diagram module cannot silently
64
- * omit it: a missing declaration is a compile error here, where the fix is
65
- * obvious, instead of an unbound-token failure at the first diagram open.
66
- *
67
- * NOT named `bindLanguage`: every `bindX()` on GLSP's `DiagramModule`
68
- * returns a `BindingTarget<T>` that GLSP's own `configure` consumes, and a
69
- * method in that family returning a `LanguageMetaData` invites
70
- * `{ service: … }`. This one states a fact; the framework does the binding.
41
+ * Adds {@link HydraniumGlspRequestSaveModelActionHandler}, the save the
42
+ * Theia client sends, beside GLSP's own save handler; replaces the GLSP
43
+ * handlers that write the client's status or edit mode with ones that set a
44
+ * diagram status instead; and runs operations, undo and redo through
45
+ * {@link HydraniumGlspOperationActionHandler} and
46
+ * {@link HydraniumGlspUndoRedoActionHandler}, without which handlers edit
47
+ * the built root every reader shares.
71
48
  */
72
- protected abstract declareLanguage(): LanguageMetaData;
73
- protected configure(bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind): void;
49
+ protected configureActionHandlers(binding: InstanceMultiBinding<ActionHandlerConstructor>): void;
74
50
  }
75
51
  //# sourceMappingURL=abstract-hydranium-glsp-diagram-module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"abstract-hydranium-glsp-diagram-module.d.ts","sourceRoot":"","sources":["../../src/launcher/abstract-hydranium-glsp-diagram-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAI3F;AA0BD;;;;;;;;;;;;;;GAcG;AACH,8BACsB,kCAAmC,SAAQ,aAAa;IAC3E;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,QAAQ,CAAC,eAAe,IAAI,gBAAgB;cAEnC,SAAS,CACzB,IAAI,EAAE,UAAU,CAAC,IAAI,EACrB,MAAM,EAAE,UAAU,CAAC,MAAM,EACzB,OAAO,EAAE,UAAU,CAAC,OAAO,EAC3B,MAAM,EAAE,UAAU,CAAC,MAAM,GACzB,IAAI;CAIT"}
1
+ {"version":3,"file":"abstract-hydranium-glsp-diagram-module.d.ts","sourceRoot":"","sources":["../../src/launcher/abstract-hydranium-glsp-diagram-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAE7B,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,YAAY,EAKnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAMxD,OAAO,EAAgC,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAI3G;;;;;;;;;;;;;;;;;GAiBG;AACH,8BACsB,kCAAmC,SAAQ,aAAa;IAC3E,UAAmB,SAAS,CACzB,IAAI,EAAE,UAAU,CAAC,IAAI,EACrB,MAAM,EAAE,UAAU,CAAC,MAAM,EACzB,OAAO,EAAE,UAAU,CAAC,OAAO,EAC3B,MAAM,EAAE,UAAU,CAAC,MAAM,GACzB,IAAI,CAKN;IAED,yGAAyG;IACzG,SAAS,CAAC,yBAAyB,IAAI,aAAa,CAAC,qBAAqB,CAAC,CAE1E;IAED,gGAAgG;IACvF,kCAAkC,CAAC,OAAO,EAAE,YAAY,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAGjG;IAED,wGAAwG;IACxG,UAAmB,oBAAoB,IAAI,aAAa,CAAC,gBAAgB,CAAC,CAEzE;IAED,0GAA0G;IAC1G,UAAmB,gBAAgB,IAAI,aAAa,CAAC,YAAY,CAAC,CAEjE;IAED;;;;;;;;OAQG;IACH,UAAmB,uBAAuB,CAAC,OAAO,EAAE,oBAAoB,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAOxG;CACH"}
@@ -12,85 +12,74 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
12
12
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
13
13
  return c > 3 && r && Object.defineProperty(target, key, r), r;
14
14
  };
15
- import { DiagramModule } from '@eclipse-glsp/server';
15
+ import { applyBindingTarget, DiagramModule, OperationActionHandler, RequestModelActionHandler, SetEditModeActionHandler, UndoRedoActionHandler } from '@eclipse-glsp/server';
16
16
  import { injectable } from 'inversify';
17
- import { typedMetadata } from '@hydranium/core';
18
- import { HydraniumTypes } from '../state/hydranium-shared-core-services.js';
17
+ import { HydraniumGlspServerActionDispatcher } from '../dispatcher/server-action-dispatcher.js';
18
+ import { HydraniumGlspRequestSaveModelActionHandler } from '../storage/hydranium-glsp-request-save-model-action-handler.js';
19
+ import { HydraniumGlspCommandStack } from '../command/hydranium-glsp-command-stack.js';
20
+ import { HydraniumGlspOperationActionHandler } from '../command/hydranium-glsp-operation-action-handler.js';
21
+ import { HydraniumGlspUndoRedoActionHandler } from '../command/hydranium-glsp-undo-redo-action-handler.js';
22
+ import { DefaultDiagramStatusReporter, DiagramStatusReporter } from '../status/diagram-status-reporter.js';
23
+ import { HydraniumGlspRequestModelActionHandler } from '../status/hydranium-glsp-request-model-action-handler.js';
24
+ import { HydraniumGlspSetEditModeActionHandler } from '../status/hydranium-glsp-set-edit-mode-action-handler.js';
19
25
  /**
20
- * Bind {@link HydraniumTypes}.DiagramLanguage on a GLSP **session** container
21
- * to the services of `metadata`'s grammar.
26
+ * GLSP {@link DiagramModule} base that wires the framework's diagram status,
27
+ * dispatch timing, command stack, save, and transactional operation, undo and
28
+ * redo handlers.
22
29
  *
23
- * Exported separately from {@link AbstractHydraniumGlspDiagramModule} for adopters
24
- * whose diagram module already extends an intermediate base of their own and
25
- * cannot take the framework base class; call it from `configure` after
26
- * `super.configure(...)`. The base class is the preferred entry point because
27
- * it makes the declaration non-optional.
30
+ * A diagram module declares no grammar: a session's language is the one its
31
+ * loaded document routes to, so one diagram type can serve several grammars.
32
+ * Adopter GLSP components read `modelState.diagramLanguage` for a reference
33
+ * written on the canvas and `modelState.languageServicesFor(node)` for
34
+ * anything reached through a reference; see `HydraniumTypes` for why no
35
+ * per-language service has a token of its own.
28
36
  *
29
- * **Why the session tier.** GLSP builds its app container once per process,
30
- * before any document exists, so a per-language service bound there can only
31
- * ever be one grammar's. The session container is created per open diagram
32
- * with its `diagramType` known, and a diagram type has exactly one grammar —
33
- * so the language is a static fact about the module, resolvable with no URI
34
- * and no ordering hazard. That last part is load-bearing: GLSP's
35
- * `OperationHandlerRegistryInitializer` constructs every operation handler at
36
- * `InitializeClientSession`, i.e. BEFORE `RequestModelAction` supplies the
37
- * source URI, so anything derived from `ModelState.sourceUri` at injection
38
- * time would throw on every diagram open.
39
- *
40
- * **The whole language, not pre-resolved providers.** There is deliberately no
41
- * token for an individual per-language provider; see {@link HydraniumTypes} for
42
- * why. Callers reach `modelState.diagramLanguage` or
43
- * `modelState.languageServicesFor(node)` instead, which name the choice.
44
- *
45
- * Resolution is `toDynamicValue` + `inSingletonScope` — deferred so the parent
46
- * container's `SharedCoreServices` is available, then resolved once per
47
- * session rather than per injection.
48
- */
49
- export function bindDiagramLanguage(bind, metadata) {
50
- bind(HydraniumTypes.DiagramLanguage)
51
- .toDynamicValue(context => resolveDiagramLanguage(context.container, metadata))
52
- .inSingletonScope();
53
- }
54
- /**
55
- * The registered services for `metadata`'s language, or a throw naming both
56
- * the declared id and the registered ones.
57
- *
58
- * Failing loudly is the point: the declared language is the one fact this
59
- * module states that the grammar does not, so it can drift. An unregistered id
60
- * means the adopter declared a language they never registered — a wiring
61
- * mistake whose silent form (falling back to some other grammar's providers)
62
- * would surface much later as references that resolve against the wrong scope.
63
- */
64
- function resolveDiagramLanguage(container, metadata) {
65
- const registry = container.get(HydraniumTypes.SharedCoreServices).ServiceRegistry;
66
- const language = registry.getServices(typedMetadata(metadata));
67
- if (!language) {
68
- const registered = registry.all.map(candidate => candidate.LanguageMetaData.languageId);
69
- throw new Error(`Diagram module declares language '${metadata.languageId}', which is not registered on the ServiceRegistry. ` +
70
- `Registered languages: ${registered.length > 0 ? registered.join(', ') : '(none)'}. ` +
71
- 'Declare the languageId of a grammar passed to bootstrapLangiumLanguages.');
72
- }
73
- return language;
74
- }
75
- /**
76
- * GLSP {@link DiagramModule} base that declares which grammar its diagram type
77
- * edits, and binds that language's per-language services on the session
78
- * container.
79
- *
80
- * Subclass instead of `DiagramModule` and implement {@link declareLanguage}
81
- * alongside `diagramType`; the two are the same kind of fact about a diagram
82
- * type, and pairing them is what lets one GLSP head serve N grammars.
83
- *
84
- * Adopter GLSP components then read the language they mean:
85
- * `modelState.diagramLanguage.references.CandidateProvider` for a reference
86
- * written on the canvas, `modelState.languageServicesFor(node).references.X`
87
- * for anything reached through a reference. No per-language service is bound
88
- * to a token of its own — see {@link bindDiagramLanguage} for why.
37
+ * An adopter whose diagram module already extends a base of its own repeats
38
+ * what this class's overrides do. Without the status bindings among them,
39
+ * nothing tells the client why its diagram is read-only; without the operation
40
+ * and undo handlers, operation handlers edit the built root every reader
41
+ * shares.
89
42
  */
90
43
  let AbstractHydraniumGlspDiagramModule = class AbstractHydraniumGlspDiagramModule extends DiagramModule {
91
44
  configure(bind, unbind, isBound, rebind) {
45
+ // Bound first: `super.configure` applies the session initializers, and the
46
+ // reporter's initializer entry refers to this binding.
47
+ applyBindingTarget({ bind, isBound }, DiagramStatusReporter, this.bindDiagramStatusReporter()).inSingletonScope();
92
48
  super.configure(bind, unbind, isBound, rebind);
93
- bindDiagramLanguage(bind, this.declareLanguage());
49
+ }
50
+ /** The {@link DiagramStatusReporter} of the session; {@link DefaultDiagramStatusReporter} by default. */
51
+ bindDiagramStatusReporter() {
52
+ return DefaultDiagramStatusReporter;
53
+ }
54
+ /** Starts the {@link DiagramStatusReporter} with the session, since nothing else injects it. */
55
+ configureClientSessionInitializers(binding) {
56
+ super.configureClientSessionInitializers(binding);
57
+ binding.add({ service: DiagramStatusReporter });
58
+ }
59
+ /** {@link HydraniumGlspServerActionDispatcher}, so every dispatch is timed once logging is at debug. */
60
+ bindActionDispatcher() {
61
+ return HydraniumGlspServerActionDispatcher;
62
+ }
63
+ /** {@link HydraniumGlspCommandStack}, so the diagram is dirty exactly while a document it has open is. */
64
+ bindCommandStack() {
65
+ return HydraniumGlspCommandStack;
66
+ }
67
+ /**
68
+ * Adds {@link HydraniumGlspRequestSaveModelActionHandler}, the save the
69
+ * Theia client sends, beside GLSP's own save handler; replaces the GLSP
70
+ * handlers that write the client's status or edit mode with ones that set a
71
+ * diagram status instead; and runs operations, undo and redo through
72
+ * {@link HydraniumGlspOperationActionHandler} and
73
+ * {@link HydraniumGlspUndoRedoActionHandler}, without which handlers edit
74
+ * the built root every reader shares.
75
+ */
76
+ configureActionHandlers(binding) {
77
+ super.configureActionHandlers(binding);
78
+ binding.add(HydraniumGlspRequestSaveModelActionHandler);
79
+ binding.rebind(RequestModelActionHandler, HydraniumGlspRequestModelActionHandler);
80
+ binding.rebind(SetEditModeActionHandler, HydraniumGlspSetEditModeActionHandler);
81
+ binding.rebind(OperationActionHandler, HydraniumGlspOperationActionHandler);
82
+ binding.rebind(UndoRedoActionHandler, HydraniumGlspUndoRedoActionHandler);
94
83
  }
95
84
  };
96
85
  AbstractHydraniumGlspDiagramModule = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"abstract-hydranium-glsp-diagram-module.js","sourceRoot":"","sources":["../../src/launcher/abstract-hydranium-glsp-diagram-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AAExD,OAAO,EAA0D,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MA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CACH,CAAA;AAzBqB,kCAAkC;IADvD,UAAU,EAAE;GACS,kCAAkC,CAyBvD"}
1
+ {"version":3,"file":"abstract-hydranium-glsp-diagram-module.js","sourceRoot":"","sources":["../../src/launcher/abstract-hydranium-glsp-diagram-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;AAElF,OAAO,EAGJ,kBAAkB,EAIlB,aAAa,EAGb,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,mCAAmC,EAAE,MAAM,2CAA2C,CAAC;AAChG,OAAO,EAAE,0CAA0C,EAAE,MAAM,gEAAgE,CAAC;AAC5H,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,mCAAmC,EAAE,MAAM,uDAAuD,CAAC;AAC5G,OAAO,EAAE,kCAAkC,EAAE,MAAM,uDAAuD,CAAC;AAC3G,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC3G,OAAO,EAAE,sCAAsC,EAAE,MAAM,0DAA0D,CAAC;AAClH,OAAO,EAAE,qCAAqC,EAAE,MAAM,0DAA0D,CAAC;AAEjH;;;;;;;;;;;;;;;;;GAiBG;AAEI,IAAe,kCAAkC,GAAjD,MAAe,kCAAmC,SAAQ,aAAa;IACxD,SAAS,CACzB,IAAqB,EACrB,MAAyB,EACzB,OAA2B,EAC3B,MAAyB;QAEzB,2EAA2E;QAC3E,uDAAuD;QACvD,kBAAkB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,qBAAqB,EAAE,IAAI,CAAC,yBAAyB,EAAE,CAAC,CAAC,gBAAgB,EAAE,CAAC;QAClH,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IAED,yGAAyG;IAC/F,yBAAyB;QAChC,OAAO,4BAA4B,CAAC;IACvC,CAAC;IAED,gGAAgG;IACvF,kCAAkC,CAAC,OAA+C;QACxF,KAAK,CAAC,kCAAkC,CAAC,OAAO,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,wGAAwG;IACrF,oBAAoB;QACpC,OAAO,mCAAmC,CAAC;IAC9C,CAAC;IAED,0GAA0G;IACvF,gBAAgB;QAChC,OAAO,yBAAyB,CAAC;IACpC,CAAC;IAED;;;;;;;;OAQG;IACgB,uBAAuB,CAAC,OAAuD;QAC/F,KAAK,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;QACxD,OAAO,CAAC,MAAM,CAAC,yBAAyB,EAAE,sCAAsC,CAAC,CAAC;QAClF,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,qCAAqC,CAAC,CAAC;QAChF,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,mCAAmC,CAAC,CAAC;QAC5E,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,kCAAkC,CAAC,CAAC;IAC7E,CAAC;CACH,CAAA;AAnDqB,kCAAkC;IADvD,UAAU,EAAE;GACS,kCAAkC,CAmDvD"}
@@ -0,0 +1,23 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ import type { Logger as GlspLogger } from '@eclipse-glsp/server';
10
+ /**
11
+ * `connection` with a notification to a client that has gone dropped, logged
12
+ * at debug, rather than left to throw or reject. GLSP sends every action as a
13
+ * notification and drops the promise, so a client that disconnects mid-write
14
+ * (an `EPIPE`) or a send after GLSP disposed the connection is otherwise an
15
+ * unhandled rejection on every ordinary close. Any other failure still throws
16
+ * or rejects: {@link isClientGoneError} tells the two apart, as on the
17
+ * LSP head. A launcher that overrides `createConnection` applies it, as the
18
+ * framework's own do.
19
+ */
20
+ export declare function dropNotificationsToGoneClient<T extends {
21
+ sendNotification(method: string, ...params: unknown[]): Promise<void>;
22
+ }>(connection: T, logger: GlspLogger): T;
23
+ //# sourceMappingURL=drop-notifications-to-gone-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drop-notifications-to-gone-client.d.ts","sourceRoot":"","sources":["../../src/launcher/drop-notifications-to-gone-client.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGjE;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,SAAS;IAAE,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,EAC9H,UAAU,EAAE,CAAC,EACb,MAAM,EAAE,UAAU,GAClB,CAAC,CAqBH"}
@@ -0,0 +1,43 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ import { isClientGoneError } from '@hydranium/core';
10
+ /**
11
+ * `connection` with a notification to a client that has gone dropped, logged
12
+ * at debug, rather than left to throw or reject. GLSP sends every action as a
13
+ * notification and drops the promise, so a client that disconnects mid-write
14
+ * (an `EPIPE`) or a send after GLSP disposed the connection is otherwise an
15
+ * unhandled rejection on every ordinary close. Any other failure still throws
16
+ * or rejects: {@link isClientGoneError} tells the two apart, as on the
17
+ * LSP head. A launcher that overrides `createConnection` applies it, as the
18
+ * framework's own do.
19
+ */
20
+ export function dropNotificationsToGoneClient(connection, logger) {
21
+ const dropIfGone = (error) => {
22
+ if (!isClientGoneError(error)) {
23
+ throw error;
24
+ }
25
+ logger.debug(`Dropped a notification to a client that has gone: ${String(error)}`);
26
+ };
27
+ const sendNotification = (method, ...params) => {
28
+ try {
29
+ return connection.sendNotification(method, ...params).catch(dropIfGone);
30
+ }
31
+ catch (error) {
32
+ // A disposed connection throws rather than rejecting.
33
+ dropIfGone(error);
34
+ return Promise.resolve();
35
+ }
36
+ };
37
+ return new Proxy(connection, {
38
+ get(target, property, receiver) {
39
+ return property === 'sendNotification' ? sendNotification : Reflect.get(target, property, receiver);
40
+ }
41
+ });
42
+ }
43
+ //# sourceMappingURL=drop-notifications-to-gone-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drop-notifications-to-gone-client.js","sourceRoot":"","sources":["../../src/launcher/drop-notifications-to-gone-client.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAC1C,UAAa,EACb,MAAkB;IAElB,MAAM,UAAU,GAAG,CAAC,KAAc,EAAQ,EAAE;QACzC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,KAAK,CAAC;QACf,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,qDAAqD,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACtF,CAAC,CAAC;IACF,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAE,GAAG,MAAiB,EAAiB,EAAE;QAC9E,IAAI,CAAC;YACF,OAAO,UAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC3E,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACvB,sDAAsD;YACtD,UAAU,CAAC,KAAK,CAAC,CAAC;YAClB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC5B,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,KAAK,CAAC,UAAU,EAAE;QAC1B,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ;YAC3B,OAAO,QAAQ,KAAK,kBAAkB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACvG,CAAC;KACH,CAAC,CAAC;AACN,CAAC"}
@@ -6,8 +6,7 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import { GLSPModule } from '@eclipse-glsp/server';
10
- import type { BindingContext } from '@eclipse-glsp/protocol/lib/di/inversify-util.js';
9
+ import { type BindingContext, GLSPModule } from '@eclipse-glsp/server';
11
10
  import type { ServerSharedServices } from '@hydranium/core';
12
11
  import { type ConflictResolver } from '@hydranium/protocol';
13
12
  import { type interfaces } from 'inversify';
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-app-module.d.ts","sourceRoot":"","sources":["../../src/launcher/glsp-app-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,KAAK,gBAAgB,EAA+B,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAGxD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,6BAA6B,CAAC,OAAO,SAAS,oBAAoB,GAAG,oBAAoB;IACvG;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAE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ED;;;;OAIG;IACO,2BAA2B,CAAC,QAAwB;QAC3D,mBAAmB;IACtB,CAAC;CACH,CAAA;AAxBY,sBAAsB;IADlC,UAAU,EAAE;;GACA,sBAAsB,CAwBlC"}
@@ -0,0 +1,19 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ import type { Logger as GlspLogger } from '@eclipse-glsp/server';
10
+ import type { Logger as ConnectionLogger } from 'vscode-jsonrpc';
11
+ /**
12
+ * A GLSP logger in the shape a `vscode-jsonrpc` connection logs to. A launcher
13
+ * that overrides `createConnection` passes it over its injected `logger`, or
14
+ * the connection logs to `console` or nowhere instead of the adopter's logger.
15
+ * GLSP's logger has no `log`; the connection's `log` lines go to `info`, the
16
+ * threshold the framework's own `Logger.log` emits at.
17
+ */
18
+ export declare function createGlspConnectionLogger(logger: GlspLogger): ConnectionLogger;
19
+ //# sourceMappingURL=glsp-connection-logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glsp-connection-logger.d.ts","sourceRoot":"","sources":["../../src/launcher/glsp-connection-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEjE;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,UAAU,GAAG,gBAAgB,CAO/E"}
@@ -0,0 +1,24 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ /**
10
+ * A GLSP logger in the shape a `vscode-jsonrpc` connection logs to. A launcher
11
+ * that overrides `createConnection` passes it over its injected `logger`, or
12
+ * the connection logs to `console` or nowhere instead of the adopter's logger.
13
+ * GLSP's logger has no `log`; the connection's `log` lines go to `info`, the
14
+ * threshold the framework's own `Logger.log` emits at.
15
+ */
16
+ export function createGlspConnectionLogger(logger) {
17
+ return {
18
+ error: message => logger.error(message),
19
+ warn: message => logger.warn(message),
20
+ info: message => logger.info(message),
21
+ log: message => logger.info(message)
22
+ };
23
+ }
24
+ //# sourceMappingURL=glsp-connection-logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glsp-connection-logger.js","sourceRoot":"","sources":["../../src/launcher/glsp-connection-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAKlF;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAkB;IAC1D,OAAO;QACJ,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;QACvC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACrC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACrC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;KACtC,CAAC;AACL,CAAC"}
@@ -14,15 +14,17 @@ import { ContainerModule } from 'inversify';
14
14
  *
15
15
  * **The tier matters, and the app container cannot stand in for it.** GLSP's
16
16
  * launcher creates the server container as a child and loads the adopter's
17
- * `ServerModule` into it, so a `GLSPServer` binding made further up is shadowed
18
- * rather than consulted, and inversify refuses to rebind a parent's binding
19
- * from a child at all. The framework's app-tier overrides therefore cannot
20
- * reach this symbol.
17
+ * `ServerModule` into it. The framework's server is a singleton of that
18
+ * container; bound in the app container, every connected application would
19
+ * share one server.
21
20
  *
22
- * **Load this AFTER the adopter's `ServerModule`, never beside it.** Both bind
23
- * `GLSPServer`, so a plain second binding resolves to an ambiguous-match error
24
- * rather than to either one; `rebind` needs the first binding to already be
25
- * present.
21
+ * **An adopter's server is kept when it extends {@link HydraniumGlspServer}.**
22
+ * Any other `GLSPServer` the adopter's `ServerModule` binds, upstream's default
23
+ * included, is replaced when the container first creates it, so a server that
24
+ * extends upstream's directly is discarded, with a warning naming its class.
25
+ * The replacement happens on activation because `rebind` would replace an
26
+ * adopter's subclass as well; the discarded server is constructed once and
27
+ * never used.
26
28
  *
27
29
  * Keeping this out of the adopter's hands is the point: an adopter passes their
28
30
  * own `ServerModule` in, so anything they must add themselves is a fix the
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-server-overrides.d.ts","sourceRoot":"","sources":["../../src/launcher/glsp-server-overrides.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAG5C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,yBAAyB,IAAI,eAAe,CAI3D"}
1
+ {"version":3,"file":"glsp-server-overrides.d.ts","sourceRoot":"","sources":["../../src/launcher/glsp-server-overrides.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAG5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,yBAAyB,IAAI,eAAe,CAkB3D"}
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import { GLSPServer } from '@eclipse-glsp/server';
9
+ import { DefaultGLSPServer, GLSPServer, LoggerFactory } from '@eclipse-glsp/server';
10
10
  import { ContainerModule } from 'inversify';
11
11
  import { HydraniumGlspServer } from './hydranium-glsp-server.js';
12
12
  /**
@@ -16,15 +16,17 @@ import { HydraniumGlspServer } from './hydranium-glsp-server.js';
16
16
  *
17
17
  * **The tier matters, and the app container cannot stand in for it.** GLSP's
18
18
  * launcher creates the server container as a child and loads the adopter's
19
- * `ServerModule` into it, so a `GLSPServer` binding made further up is shadowed
20
- * rather than consulted, and inversify refuses to rebind a parent's binding
21
- * from a child at all. The framework's app-tier overrides therefore cannot
22
- * reach this symbol.
19
+ * `ServerModule` into it. The framework's server is a singleton of that
20
+ * container; bound in the app container, every connected application would
21
+ * share one server.
23
22
  *
24
- * **Load this AFTER the adopter's `ServerModule`, never beside it.** Both bind
25
- * `GLSPServer`, so a plain second binding resolves to an ambiguous-match error
26
- * rather than to either one; `rebind` needs the first binding to already be
27
- * present.
23
+ * **An adopter's server is kept when it extends {@link HydraniumGlspServer}.**
24
+ * Any other `GLSPServer` the adopter's `ServerModule` binds, upstream's default
25
+ * included, is replaced when the container first creates it, so a server that
26
+ * extends upstream's directly is discarded, with a warning naming its class.
27
+ * The replacement happens on activation because `rebind` would replace an
28
+ * adopter's subclass as well; the discarded server is constructed once and
29
+ * never used.
28
30
  *
29
31
  * Keeping this out of the adopter's hands is the point: an adopter passes their
30
32
  * own `ServerModule` in, so anything they must add themselves is a fix the
@@ -38,8 +40,20 @@ import { HydraniumGlspServer } from './hydranium-glsp-server.js';
38
40
  * a further adopter subclass moves it again.
39
41
  */
40
42
  export function createGlspServerOverrides() {
41
- return new ContainerModule((_bind, _unbind, _isBound, rebind) => {
42
- rebind(GLSPServer).to(HydraniumGlspServer).inSingletonScope();
43
+ return new ContainerModule((bind, _unbind, _isBound, _rebind, _unbindAsync, onActivation) => {
44
+ bind(HydraniumGlspServer).toSelf().inSingletonScope();
45
+ onActivation(GLSPServer, (context, server) => {
46
+ if (server instanceof HydraniumGlspServer) {
47
+ return server;
48
+ }
49
+ if (server.constructor !== DefaultGLSPServer) {
50
+ context.container
51
+ .get(LoggerFactory)('HydraniumGlspServer')
52
+ .warn(`Replacing the bound GLSP server ${server.constructor.name} with HydraniumGlspServer; ` +
53
+ 'extend HydraniumGlspServer to keep its behaviour.');
54
+ }
55
+ return context.container.get(HydraniumGlspServer);
56
+ });
43
57
  });
44
58
  }
45
59
  //# sourceMappingURL=glsp-server-overrides.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-server-overrides.js","sourceRoot":"","sources":["../../src/launcher/glsp-server-overrides.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,yBAAyB;IACtC,OAAO,IAAI,eAAe,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;QAC7D,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACjE,CAAC,CAAC,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"glsp-server-overrides.js","sourceRoot":"","sources":["../../src/launcher/glsp-server-overrides.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,yBAAyB;IACtC,OAAO,IAAI,eAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE;QACzF,IAAI,CAAC,mBAAmB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACtD,YAAY,C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