@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.
- package/README.md +80 -88
- package/lib/browser/start-glsp-server-in-worker.d.ts +43 -42
- package/lib/browser/start-glsp-server-in-worker.d.ts.map +1 -1
- package/lib/browser/start-glsp-server-in-worker.js +62 -13
- package/lib/browser/start-glsp-server-in-worker.js.map +1 -1
- package/lib/command/diagram-edit-dropped-error.d.ts +31 -0
- package/lib/command/diagram-edit-dropped-error.d.ts.map +1 -0
- package/lib/command/diagram-edit-dropped-error.js +48 -0
- package/lib/command/diagram-edit-dropped-error.js.map +1 -0
- package/lib/command/hydranium-glsp-command-stack.d.ts +33 -0
- package/lib/command/hydranium-glsp-command-stack.d.ts.map +1 -0
- package/lib/command/hydranium-glsp-command-stack.js +63 -0
- package/lib/command/hydranium-glsp-command-stack.js.map +1 -0
- package/lib/command/hydranium-glsp-operation-action-handler.d.ts +64 -0
- package/lib/command/hydranium-glsp-operation-action-handler.d.ts.map +1 -0
- package/lib/command/hydranium-glsp-operation-action-handler.js +142 -0
- package/lib/command/hydranium-glsp-operation-action-handler.js.map +1 -0
- package/lib/command/hydranium-glsp-operation-command.d.ts +250 -0
- package/lib/command/hydranium-glsp-operation-command.d.ts.map +1 -0
- package/lib/command/hydranium-glsp-operation-command.js +491 -0
- package/lib/command/hydranium-glsp-operation-command.js.map +1 -0
- package/lib/command/hydranium-glsp-recording-command.d.ts +26 -87
- package/lib/command/hydranium-glsp-recording-command.d.ts.map +1 -1
- package/lib/command/hydranium-glsp-recording-command.js +40 -117
- package/lib/command/hydranium-glsp-recording-command.js.map +1 -1
- package/lib/command/hydranium-glsp-undo-redo-action-handler.d.ts +23 -0
- package/lib/command/hydranium-glsp-undo-redo-action-handler.d.ts.map +1 -0
- package/lib/command/hydranium-glsp-undo-redo-action-handler.js +41 -0
- package/lib/command/hydranium-glsp-undo-redo-action-handler.js.map +1 -0
- package/lib/command/index.d.ts +5 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +5 -0
- package/lib/command/index.js.map +1 -1
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.d.ts +1 -1
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.d.ts.map +1 -1
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.js +2 -2
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.js.map +1 -1
- package/lib/dispatcher/server-action-dispatcher.d.ts +25 -24
- package/lib/dispatcher/server-action-dispatcher.d.ts.map +1 -1
- package/lib/dispatcher/server-action-dispatcher.js +38 -26
- package/lib/dispatcher/server-action-dispatcher.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/launcher/abstract-hydranium-glsp-diagram-module.d.ts +35 -59
- package/lib/launcher/abstract-hydranium-glsp-diagram-module.d.ts.map +1 -1
- package/lib/launcher/abstract-hydranium-glsp-diagram-module.js +60 -71
- package/lib/launcher/abstract-hydranium-glsp-diagram-module.js.map +1 -1
- package/lib/launcher/drop-notifications-to-gone-client.d.ts +23 -0
- package/lib/launcher/drop-notifications-to-gone-client.d.ts.map +1 -0
- package/lib/launcher/drop-notifications-to-gone-client.js +43 -0
- package/lib/launcher/drop-notifications-to-gone-client.js.map +1 -0
- package/lib/launcher/glsp-app-module.d.ts +1 -2
- package/lib/launcher/glsp-app-module.d.ts.map +1 -1
- package/lib/launcher/glsp-app-module.js.map +1 -1
- package/lib/launcher/glsp-connection-logger.d.ts +19 -0
- package/lib/launcher/glsp-connection-logger.d.ts.map +1 -0
- package/lib/launcher/glsp-connection-logger.js +24 -0
- package/lib/launcher/glsp-connection-logger.js.map +1 -0
- package/lib/launcher/glsp-server-overrides.d.ts +10 -8
- package/lib/launcher/glsp-server-overrides.d.ts.map +1 -1
- package/lib/launcher/glsp-server-overrides.js +25 -11
- package/lib/launcher/glsp-server-overrides.js.map +1 -1
- package/lib/launcher/hydranium-glsp-server.d.ts +60 -15
- package/lib/launcher/hydranium-glsp-server.d.ts.map +1 -1
- package/lib/launcher/hydranium-glsp-server.js +145 -22
- package/lib/launcher/hydranium-glsp-server.js.map +1 -1
- package/lib/launcher/index.d.ts +2 -0
- package/lib/launcher/index.d.ts.map +1 -1
- package/lib/launcher/index.js +5 -4
- package/lib/launcher/index.js.map +1 -1
- package/lib/logging/glsp-client-logger.d.ts +10 -6
- package/lib/logging/glsp-client-logger.d.ts.map +1 -1
- package/lib/logging/glsp-client-logger.js +14 -7
- package/lib/logging/glsp-client-logger.js.map +1 -1
- package/lib/messages/index.d.ts +11 -6
- package/lib/messages/index.d.ts.map +1 -1
- package/lib/messages/index.js +11 -6
- package/lib/messages/index.js.map +1 -1
- package/lib/node/start-glsp-server.d.ts +50 -15
- package/lib/node/start-glsp-server.d.ts.map +1 -1
- package/lib/node/start-glsp-server.js +97 -30
- package/lib/node/start-glsp-server.js.map +1 -1
- package/lib/state/abstract-hydranium-glsp-state.d.ts +326 -102
- package/lib/state/abstract-hydranium-glsp-state.d.ts.map +1 -1
- package/lib/state/abstract-hydranium-glsp-state.js +529 -139
- package/lib/state/abstract-hydranium-glsp-state.js.map +1 -1
- package/lib/state/diagram-status.d.ts +38 -0
- package/lib/state/diagram-status.d.ts.map +1 -0
- package/lib/state/diagram-status.js +27 -0
- package/lib/state/diagram-status.js.map +1 -0
- package/lib/state/full-text-hydranium-glsp-state.d.ts +22 -9
- package/lib/state/full-text-hydranium-glsp-state.d.ts.map +1 -1
- package/lib/state/full-text-hydranium-glsp-state.js +45 -18
- package/lib/state/full-text-hydranium-glsp-state.js.map +1 -1
- package/lib/state/hydranium-glsp-index.d.ts +40 -29
- package/lib/state/hydranium-glsp-index.d.ts.map +1 -1
- package/lib/state/hydranium-glsp-index.js +82 -45
- package/lib/state/hydranium-glsp-index.js.map +1 -1
- package/lib/state/hydranium-shared-core-services.d.ts +16 -29
- package/lib/state/hydranium-shared-core-services.d.ts.map +1 -1
- package/lib/state/hydranium-shared-core-services.js +15 -28
- package/lib/state/hydranium-shared-core-services.js.map +1 -1
- package/lib/state/index.d.ts +1 -0
- package/lib/state/index.d.ts.map +1 -1
- package/lib/state/index.js +1 -0
- package/lib/state/index.js.map +1 -1
- package/lib/state/model-ready-timeout-error.d.ts.map +1 -1
- package/lib/state/model-ready-timeout-error.js.map +1 -1
- package/lib/state/reconcile-source-model-write.d.ts +13 -27
- package/lib/state/reconcile-source-model-write.d.ts.map +1 -1
- package/lib/state/reconcile-source-model-write.js +44 -32
- package/lib/state/reconcile-source-model-write.js.map +1 -1
- package/lib/state/reconciling-multi-document-glsp-state.d.ts +125 -69
- package/lib/state/reconciling-multi-document-glsp-state.d.ts.map +1 -1
- package/lib/state/reconciling-multi-document-glsp-state.js +242 -100
- package/lib/state/reconciling-multi-document-glsp-state.js.map +1 -1
- package/lib/state/reconciling-transfer-hydranium-glsp-state.d.ts +36 -28
- package/lib/state/reconciling-transfer-hydranium-glsp-state.d.ts.map +1 -1
- package/lib/state/reconciling-transfer-hydranium-glsp-state.js +59 -42
- package/lib/state/reconciling-transfer-hydranium-glsp-state.js.map +1 -1
- package/lib/status/diagram-status-reporter.d.ts +44 -0
- package/lib/status/diagram-status-reporter.d.ts.map +1 -0
- package/lib/status/diagram-status-reporter.js +88 -0
- package/lib/status/diagram-status-reporter.js.map +1 -0
- package/lib/status/hydranium-glsp-request-model-action-handler.d.ts +27 -0
- package/lib/status/hydranium-glsp-request-model-action-handler.d.ts.map +1 -0
- package/lib/status/hydranium-glsp-request-model-action-handler.js +52 -0
- package/lib/status/hydranium-glsp-request-model-action-handler.js.map +1 -0
- package/lib/status/hydranium-glsp-set-edit-mode-action-handler.d.ts +27 -0
- package/lib/status/hydranium-glsp-set-edit-mode-action-handler.d.ts.map +1 -0
- package/lib/status/hydranium-glsp-set-edit-mode-action-handler.js +53 -0
- package/lib/status/hydranium-glsp-set-edit-mode-action-handler.js.map +1 -0
- package/lib/status/index.d.ts +12 -0
- package/lib/status/index.d.ts.map +1 -0
- package/lib/status/index.js +12 -0
- package/lib/status/index.js.map +1 -0
- package/lib/storage/hydranium-glsp-request-save-model-action-handler.d.ts +30 -0
- package/lib/storage/hydranium-glsp-request-save-model-action-handler.d.ts.map +1 -0
- package/lib/storage/hydranium-glsp-request-save-model-action-handler.js +47 -0
- package/lib/storage/hydranium-glsp-request-save-model-action-handler.js.map +1 -0
- package/lib/storage/hydranium-glsp-storage.d.ts +324 -143
- package/lib/storage/hydranium-glsp-storage.d.ts.map +1 -1
- package/lib/storage/hydranium-glsp-storage.js +569 -213
- package/lib/storage/hydranium-glsp-storage.js.map +1 -1
- package/lib/storage/index.d.ts +2 -1
- package/lib/storage/index.d.ts.map +1 -1
- package/lib/storage/index.js +2 -1
- package/lib/storage/index.js.map +1 -1
- package/lib/storage/save-delivery-policy.d.ts +51 -0
- package/lib/storage/save-delivery-policy.d.ts.map +1 -0
- package/lib/storage/{save-conflict-policy.js → save-delivery-policy.js} +7 -8
- package/lib/storage/save-delivery-policy.js.map +1 -0
- package/lib/submission/hydranium-glsp-submission-handler.d.ts +44 -4
- package/lib/submission/hydranium-glsp-submission-handler.d.ts.map +1 -1
- package/lib/submission/hydranium-glsp-submission-handler.js +82 -6
- package/lib/submission/hydranium-glsp-submission-handler.js.map +1 -1
- package/lib/testing/glsp-harness.d.ts +34 -7
- package/lib/testing/glsp-harness.d.ts.map +1 -1
- package/lib/testing/glsp-harness.js +47 -19
- package/lib/testing/glsp-harness.js.map +1 -1
- package/lib/validation/diagnostic-markers.d.ts +3 -3
- package/lib/validation/diagnostic-markers.d.ts.map +1 -1
- package/lib/validation/diagnostic-markers.js +1 -1
- package/lib/validation/diagnostic-markers.js.map +1 -1
- package/lib/validation/hydranium-glsp-model-validator.d.ts +1 -2
- package/lib/validation/hydranium-glsp-model-validator.d.ts.map +1 -1
- package/lib/validation/hydranium-glsp-model-validator.js +1 -1
- package/lib/validation/hydranium-glsp-model-validator.js.map +1 -1
- package/package.json +31 -52
- package/src/browser/start-glsp-server-in-worker.ts +79 -51
- package/src/command/diagram-edit-dropped-error.ts +51 -0
- package/src/command/hydranium-glsp-command-stack.ts +47 -0
- package/src/command/hydranium-glsp-operation-action-handler.ts +141 -0
- package/src/command/hydranium-glsp-operation-command.ts +602 -0
- package/src/command/hydranium-glsp-recording-command.ts +40 -121
- package/src/command/hydranium-glsp-undo-redo-action-handler.ts +29 -0
- package/src/command/index.ts +10 -0
- package/src/computed-bounds/hydranium-glsp-computed-bounds-action-handler.ts +2 -2
- package/src/dispatcher/server-action-dispatcher.ts +39 -31
- package/src/index.ts +1 -0
- package/src/launcher/abstract-hydranium-glsp-diagram-module.ts +79 -91
- package/src/launcher/drop-notifications-to-gone-client.ts +47 -0
- package/src/launcher/glsp-app-module.ts +1 -2
- package/src/launcher/glsp-connection-logger.ts +27 -0
- package/src/launcher/glsp-server-overrides.ts +27 -11
- package/src/launcher/hydranium-glsp-server.ts +153 -23
- package/src/launcher/index.ts +5 -4
- package/src/logging/glsp-client-logger.ts +16 -9
- package/src/messages/index.ts +16 -6
- package/src/node/start-glsp-server.ts +133 -40
- package/src/state/abstract-hydranium-glsp-state.ts +609 -154
- package/src/state/diagram-status.ts +41 -0
- package/src/state/full-text-hydranium-glsp-state.ts +46 -18
- package/src/state/hydranium-glsp-index.ts +85 -41
- package/src/state/hydranium-shared-core-services.ts +16 -29
- package/src/state/index.ts +1 -0
- package/src/state/reconcile-source-model-write.ts +51 -53
- package/src/state/reconciling-multi-document-glsp-state.ts +276 -102
- package/src/state/reconciling-transfer-hydranium-glsp-state.ts +67 -45
- package/src/status/diagram-status-reporter.ts +106 -0
- package/src/status/hydranium-glsp-request-model-action-handler.ts +43 -0
- package/src/status/hydranium-glsp-set-edit-mode-action-handler.ts +38 -0
- package/src/status/index.ts +12 -0
- package/src/storage/hydranium-glsp-request-save-model-action-handler.ts +40 -0
- package/src/storage/hydranium-glsp-storage.ts +647 -223
- package/src/storage/index.ts +2 -1
- package/src/storage/save-delivery-policy.ts +49 -0
- package/src/submission/hydranium-glsp-submission-handler.ts +91 -5
- package/src/testing/glsp-harness.ts +67 -25
- package/src/validation/diagnostic-markers.ts +3 -3
- package/src/validation/hydranium-glsp-model-validator.ts +4 -5
- package/lib/storage/save-conflict-policy.d.ts +0 -56
- package/lib/storage/save-conflict-policy.d.ts.map +0 -1
- package/lib/storage/save-conflict-policy.js.map +0 -1
- 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
|
|
11
|
+
import { DiagramStatusReporter } from '../status/diagram-status-reporter.js';
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* and
|
|
28
|
-
*
|
|
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
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
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
|
|
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,
|
|
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 {
|
|
18
|
-
import {
|
|
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
|
-
*
|
|
21
|
-
*
|
|
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
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
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
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
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
|
-
|
|
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,
|
|
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,
|
|
1
|
+
{"version":3,"file":"glsp-app-module.d.ts","sourceRoot":"","sources":["../../src/launcher/glsp-app-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvE,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;IAEzB;;;;;;;;OAQG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBACa,sBAAsB,CAAC,OAAO,SAAS,oBAAoB,GAAG,oBAAoB,CAAE,SAAQ,UAAU;IACpG,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,6BAA6B,CAAC,OAAO,CAAC;IAA9E,YAA+B,OAAO,EAAE,6BAA6B,CAAC,OAAO,CAAC,EAE7E;IAED,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,CAIN;IAED;;;;OAIG;IACH,SAAS,CAAC,2BAA2B,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAEpE;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-app-module.js","sourceRoot":"","sources":["../../src/launcher/glsp-app-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;;;;AAElF,OAAO,
|
|
1
|
+
{"version":3,"file":"glsp-app-module.js","sourceRoot":"","sources":["../../src/launcher/glsp-app-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;;;;AAElF,OAAO,EAAuB,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAyB,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AA0C5E;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAoF,SAAQ,UAAU;IACjF,OAAO;IAAtC,YAA+B,OAA+C;QAC3E,KAAK,EAAE,CAAC;uBADoB,OAAO;IAEtC,CAAC;IAEkB,SAAS,CACzB,IAAqB,EACrB,MAAyB,EACzB,OAA2B,EAC3B,MAAyB;QAEzB,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7E,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,IAAI,2BAA2B,EAAE,CAAC,CAAC;QAC1H,IAAI,CAAC,2BAA2B,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACvE,CAAC;IAED;;;;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
|
|
18
|
-
*
|
|
19
|
-
*
|
|
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
|
-
* **
|
|
23
|
-
* `GLSPServer
|
|
24
|
-
*
|
|
25
|
-
*
|
|
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
|
|
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
|
|
20
|
-
*
|
|
21
|
-
*
|
|
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
|
-
* **
|
|
25
|
-
* `GLSPServer
|
|
26
|
-
*
|
|
27
|
-
*
|
|
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((
|
|
42
|
-
|
|
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;
|
|
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,CAAa,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtD,IAAI,MAAM,YAAY,mBAAmB,EAAE,CAAC;gBACzC,OAAO,MAAM,CAAC;YACjB,CAAC;YACD,IAAI,MAAM,CAAC,WAAW,KAAK,iBAAiB,EAAE,CAAC;gBAC5C,OAAO,CAAC,SAAS;qBACb,GAAG,CAAgB,aAAa,CAAC,CAAC,qBAAqB,CAAC;qBACxD,IAAI,CACF,mCAAmC,MAAM,CAAC,WAAW,CAAC,IAAI,6BAA6B;oBACpF,mDAAmD,CACxD,CAAC;YACR,CAAC;YACD,OAAO,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACN,CAAC"}
|