@hydranium/glsp-server 1.0.0-next.10
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/LICENSE +21 -0
- package/README.md +97 -0
- package/lib/browser/index.d.ts +10 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +15 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/start-glsp-server-in-worker.d.ts +121 -0
- package/lib/browser/start-glsp-server-in-worker.d.ts.map +1 -0
- package/lib/browser/start-glsp-server-in-worker.js +102 -0
- package/lib/browser/start-glsp-server-in-worker.js.map +1 -0
- package/lib/command/hydranium-glsp-recording-command.d.ts +132 -0
- package/lib/command/hydranium-glsp-recording-command.d.ts.map +1 -0
- package/lib/command/hydranium-glsp-recording-command.js +159 -0
- package/lib/command/hydranium-glsp-recording-command.js.map +1 -0
- package/lib/command/index.d.ts +10 -0
- package/lib/command/index.d.ts.map +1 -0
- package/lib/command/index.js +10 -0
- package/lib/command/index.js.map +1 -0
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.d.ts +61 -0
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.d.ts.map +1 -0
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.js +93 -0
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.js.map +1 -0
- package/lib/computed-bounds/index.d.ts +10 -0
- package/lib/computed-bounds/index.d.ts.map +1 -0
- package/lib/computed-bounds/index.js +10 -0
- package/lib/computed-bounds/index.js.map +1 -0
- package/lib/dispatcher/index.d.ts +10 -0
- package/lib/dispatcher/index.d.ts.map +1 -0
- package/lib/dispatcher/index.js +10 -0
- package/lib/dispatcher/index.js.map +1 -0
- package/lib/dispatcher/server-action-dispatcher.d.ts +52 -0
- package/lib/dispatcher/server-action-dispatcher.d.ts.map +1 -0
- package/lib/dispatcher/server-action-dispatcher.js +79 -0
- package/lib/dispatcher/server-action-dispatcher.js.map +1 -0
- package/lib/index.d.ts +19 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +20 -0
- package/lib/index.js.map +1 -0
- package/lib/launcher/abstract-hydranium-glsp-diagram-module.d.ts +75 -0
- package/lib/launcher/abstract-hydranium-glsp-diagram-module.d.ts.map +1 -0
- package/lib/launcher/abstract-hydranium-glsp-diagram-module.js +100 -0
- package/lib/launcher/abstract-hydranium-glsp-diagram-module.js.map +1 -0
- package/lib/launcher/glsp-app-module.d.ts +87 -0
- package/lib/launcher/glsp-app-module.d.ts.map +1 -0
- package/lib/launcher/glsp-app-module.js +71 -0
- package/lib/launcher/glsp-app-module.js.map +1 -0
- package/lib/launcher/glsp-framework-overrides.d.ts +32 -0
- package/lib/launcher/glsp-framework-overrides.d.ts.map +1 -0
- package/lib/launcher/glsp-framework-overrides.js +49 -0
- package/lib/launcher/glsp-framework-overrides.js.map +1 -0
- package/lib/launcher/glsp-server-overrides.d.ts +39 -0
- package/lib/launcher/glsp-server-overrides.d.ts.map +1 -0
- package/lib/launcher/glsp-server-overrides.js +45 -0
- package/lib/launcher/glsp-server-overrides.js.map +1 -0
- package/lib/launcher/hydranium-glsp-server.d.ts +62 -0
- package/lib/launcher/hydranium-glsp-server.d.ts.map +1 -0
- package/lib/launcher/hydranium-glsp-server.js +101 -0
- package/lib/launcher/hydranium-glsp-server.js.map +1 -0
- package/lib/launcher/index.d.ts +12 -0
- package/lib/launcher/index.d.ts.map +1 -0
- package/lib/launcher/index.js +22 -0
- package/lib/launcher/index.js.map +1 -0
- package/lib/logging/glsp-client-logger.d.ts +110 -0
- package/lib/logging/glsp-client-logger.d.ts.map +1 -0
- package/lib/logging/glsp-client-logger.js +151 -0
- package/lib/logging/glsp-client-logger.js.map +1 -0
- package/lib/logging/index.d.ts +10 -0
- package/lib/logging/index.d.ts.map +1 -0
- package/lib/logging/index.js +10 -0
- package/lib/logging/index.js.map +1 -0
- package/lib/node/index.d.ts +10 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +13 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/start-glsp-server.d.ts +122 -0
- package/lib/node/start-glsp-server.d.ts.map +1 -0
- package/lib/node/start-glsp-server.js +103 -0
- package/lib/node/start-glsp-server.js.map +1 -0
- package/lib/state/abstract-hydranium-glsp-state.d.ts +333 -0
- package/lib/state/abstract-hydranium-glsp-state.d.ts.map +1 -0
- package/lib/state/abstract-hydranium-glsp-state.js +451 -0
- package/lib/state/abstract-hydranium-glsp-state.js.map +1 -0
- package/lib/state/full-text-hydranium-glsp-state.d.ts +43 -0
- package/lib/state/full-text-hydranium-glsp-state.d.ts.map +1 -0
- package/lib/state/full-text-hydranium-glsp-state.js +60 -0
- package/lib/state/full-text-hydranium-glsp-state.js.map +1 -0
- package/lib/state/hydranium-glsp-index.d.ts +220 -0
- package/lib/state/hydranium-glsp-index.d.ts.map +1 -0
- package/lib/state/hydranium-glsp-index.js +320 -0
- package/lib/state/hydranium-glsp-index.js.map +1 -0
- package/lib/state/hydranium-shared-core-services.d.ts +90 -0
- package/lib/state/hydranium-shared-core-services.d.ts.map +1 -0
- package/lib/state/hydranium-shared-core-services.js +89 -0
- package/lib/state/hydranium-shared-core-services.js.map +1 -0
- package/lib/state/index.d.ts +17 -0
- package/lib/state/index.d.ts.map +1 -0
- package/lib/state/index.js +17 -0
- package/lib/state/index.js.map +1 -0
- package/lib/state/model-ready-timeout-error.d.ts +28 -0
- package/lib/state/model-ready-timeout-error.d.ts.map +1 -0
- package/lib/state/model-ready-timeout-error.js +36 -0
- package/lib/state/model-ready-timeout-error.js.map +1 -0
- package/lib/state/reconcile-source-model-write.d.ts +43 -0
- package/lib/state/reconcile-source-model-write.d.ts.map +1 -0
- package/lib/state/reconcile-source-model-write.js +47 -0
- package/lib/state/reconcile-source-model-write.js.map +1 -0
- package/lib/state/reconciling-multi-document-glsp-state.d.ts +164 -0
- package/lib/state/reconciling-multi-document-glsp-state.d.ts.map +1 -0
- package/lib/state/reconciling-multi-document-glsp-state.js +222 -0
- package/lib/state/reconciling-multi-document-glsp-state.js.map +1 -0
- package/lib/state/reconciling-transfer-hydranium-glsp-state.d.ts +91 -0
- package/lib/state/reconciling-transfer-hydranium-glsp-state.d.ts.map +1 -0
- package/lib/state/reconciling-transfer-hydranium-glsp-state.js +129 -0
- package/lib/state/reconciling-transfer-hydranium-glsp-state.js.map +1 -0
- package/lib/storage/hydranium-glsp-storage.d.ts +348 -0
- package/lib/storage/hydranium-glsp-storage.d.ts.map +1 -0
- package/lib/storage/hydranium-glsp-storage.js +634 -0
- package/lib/storage/hydranium-glsp-storage.js.map +1 -0
- package/lib/storage/index.d.ts +11 -0
- package/lib/storage/index.d.ts.map +1 -0
- package/lib/storage/index.js +11 -0
- package/lib/storage/index.js.map +1 -0
- package/lib/storage/save-conflict-policy.d.ts +56 -0
- package/lib/storage/save-conflict-policy.d.ts.map +1 -0
- package/lib/storage/save-conflict-policy.js +19 -0
- package/lib/storage/save-conflict-policy.js.map +1 -0
- package/lib/submission/hydranium-glsp-submission-handler.d.ts +109 -0
- package/lib/submission/hydranium-glsp-submission-handler.d.ts.map +1 -0
- package/lib/submission/hydranium-glsp-submission-handler.js +157 -0
- package/lib/submission/hydranium-glsp-submission-handler.js.map +1 -0
- package/lib/submission/index.d.ts +10 -0
- package/lib/submission/index.d.ts.map +1 -0
- package/lib/submission/index.js +10 -0
- package/lib/submission/index.js.map +1 -0
- package/lib/testing/glsp-harness.d.ts +170 -0
- package/lib/testing/glsp-harness.d.ts.map +1 -0
- package/lib/testing/glsp-harness.js +231 -0
- package/lib/testing/glsp-harness.js.map +1 -0
- package/lib/testing/index.d.ts +11 -0
- package/lib/testing/index.d.ts.map +1 -0
- package/lib/testing/index.js +13 -0
- package/lib/testing/index.js.map +1 -0
- package/lib/testing/make-noop-glsp-logger.d.ts +42 -0
- package/lib/testing/make-noop-glsp-logger.d.ts.map +1 -0
- package/lib/testing/make-noop-glsp-logger.js +47 -0
- package/lib/testing/make-noop-glsp-logger.js.map +1 -0
- package/lib/util/index.d.ts +10 -0
- package/lib/util/index.d.ts.map +1 -0
- package/lib/util/index.js +10 -0
- package/lib/util/index.js.map +1 -0
- package/lib/util/service-identifier.d.ts +46 -0
- package/lib/util/service-identifier.d.ts.map +1 -0
- package/lib/util/service-identifier.js +47 -0
- package/lib/util/service-identifier.js.map +1 -0
- package/lib/validation/diagnostic-markers.d.ts +48 -0
- package/lib/validation/diagnostic-markers.d.ts.map +1 -0
- package/lib/validation/diagnostic-markers.js +68 -0
- package/lib/validation/diagnostic-markers.js.map +1 -0
- package/lib/validation/hydranium-glsp-model-validator.d.ts +51 -0
- package/lib/validation/hydranium-glsp-model-validator.d.ts.map +1 -0
- package/lib/validation/hydranium-glsp-model-validator.js +118 -0
- package/lib/validation/hydranium-glsp-model-validator.js.map +1 -0
- package/lib/validation/index.d.ts +11 -0
- package/lib/validation/index.d.ts.map +1 -0
- package/lib/validation/index.js +11 -0
- package/lib/validation/index.js.map +1 -0
- package/package.json +111 -0
- package/src/browser/index.ts +15 -0
- package/src/browser/start-glsp-server-in-worker.ts +202 -0
- package/src/command/hydranium-glsp-recording-command.ts +183 -0
- package/src/command/index.ts +10 -0
- package/src/computed-bounds/hydranium-glsp-computed-bounds-action-handler.ts +103 -0
- package/src/computed-bounds/index.ts +10 -0
- package/src/dispatcher/index.ts +10 -0
- package/src/dispatcher/server-action-dispatcher.ts +72 -0
- package/src/index.ts +20 -0
- package/src/launcher/abstract-hydranium-glsp-diagram-module.ts +117 -0
- package/src/launcher/glsp-app-module.ts +106 -0
- package/src/launcher/glsp-framework-overrides.ts +51 -0
- package/src/launcher/glsp-server-overrides.ts +46 -0
- package/src/launcher/hydranium-glsp-server.ts +104 -0
- package/src/launcher/index.ts +22 -0
- package/src/logging/glsp-client-logger.ts +184 -0
- package/src/logging/index.ts +10 -0
- package/src/node/index.ts +13 -0
- package/src/node/start-glsp-server.ts +214 -0
- package/src/state/abstract-hydranium-glsp-state.ts +503 -0
- package/src/state/full-text-hydranium-glsp-state.ts +63 -0
- package/src/state/hydranium-glsp-index.ts +337 -0
- package/src/state/hydranium-shared-core-services.ts +92 -0
- package/src/state/index.ts +17 -0
- package/src/state/model-ready-timeout-error.ts +33 -0
- package/src/state/reconcile-source-model-write.ts +77 -0
- package/src/state/reconciling-multi-document-glsp-state.ts +248 -0
- package/src/state/reconciling-transfer-hydranium-glsp-state.ts +132 -0
- package/src/storage/hydranium-glsp-storage.ts +660 -0
- package/src/storage/index.ts +11 -0
- package/src/storage/save-conflict-policy.ts +52 -0
- package/src/submission/hydranium-glsp-submission-handler.ts +170 -0
- package/src/submission/index.ts +10 -0
- package/src/testing/glsp-harness.ts +422 -0
- package/src/testing/index.ts +14 -0
- package/src/testing/make-noop-glsp-logger.ts +66 -0
- package/src/util/index.ts +10 -0
- package/src/util/service-identifier.ts +49 -0
- package/src/validation/diagnostic-markers.ts +93 -0
- package/src/validation/hydranium-glsp-model-validator.ts +105 -0
- package/src/validation/index.ts +11 -0
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023-2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
10
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
|
+
};
|
|
15
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17
|
+
};
|
|
18
|
+
import { MarkersReason, SetMarkersAction } from '@eclipse-glsp/protocol';
|
|
19
|
+
import { ActionDispatcher, ClientSessionManager, CommandStack, EditMode, GLSPServerError, Logger as GlspLogger, ModelState, ModelSubmissionHandler, ModelValidator, SOURCE_URI_ARG, SetEditModeAction, TEMPORARY_CLIENT_ID } from '@eclipse-glsp/server';
|
|
20
|
+
import { Debouncer, DisposableCollection } from '@hydranium/protocol';
|
|
21
|
+
import { inject, injectable, optional, postConstruct } from 'inversify';
|
|
22
|
+
import { URI } from '@hydranium/langium';
|
|
23
|
+
import { AstDocument } from '@hydranium/core';
|
|
24
|
+
import { DiagnosticSeverity } from 'vscode-languageserver-types';
|
|
25
|
+
import { HydraniumTypes } from '../state/hydranium-shared-core-services.js';
|
|
26
|
+
import { DEFAULT_SAVE_CONFLICT_POLICY, SaveConflictPolicy } from './save-conflict-policy.js';
|
|
27
|
+
/** Window (ms) over which back-to-back external rebuilds collapse into one resubmit. */
|
|
28
|
+
const EXTERNAL_SUBMIT_DEBOUNCE_MS = 250;
|
|
29
|
+
/**
|
|
30
|
+
* A leading URI scheme — two or more characters before the colon.
|
|
31
|
+
*
|
|
32
|
+
* RFC 3986 permits a single-character scheme, but requiring two is what keeps a
|
|
33
|
+
* Windows drive letter from reading as one. No scheme in play here is shorter
|
|
34
|
+
* than two characters, so the heuristic costs nothing and the alternative
|
|
35
|
+
* mis-parses every Windows path.
|
|
36
|
+
*/
|
|
37
|
+
const URI_SCHEME = /^[a-zA-Z][a-zA-Z\d+\-.]+:/;
|
|
38
|
+
/**
|
|
39
|
+
* True when an (untyped) LSP diagnostic marks an unrecoverable syntax problem.
|
|
40
|
+
* Framework-level diagnostics are `unknown` (the shared `ModelService` is typed
|
|
41
|
+
* `<AstNode, unknown>`), so the shape is narrowed defensively before reading the
|
|
42
|
+
* Langium `data.code`.
|
|
43
|
+
*/
|
|
44
|
+
function isStructuralDiagnostic(diagnostic) {
|
|
45
|
+
if (typeof diagnostic !== 'object' || diagnostic === null) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
const candidate = diagnostic;
|
|
49
|
+
const code = candidate.data?.code;
|
|
50
|
+
return candidate.severity === DiagnosticSeverity.Error && (code === 'lexing-error' || code === 'parsing-error');
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* GLSP source-model storage base shared by all hydranium adopters.
|
|
54
|
+
* Provides the DI signature, the {@link ClientSessionListener} +
|
|
55
|
+
* {@link Disposable} lifecycle plumbing (including the
|
|
56
|
+
* {@link DisposableCollection} drain on session disposal), the
|
|
57
|
+
* {@link RequestModelAction} / {@link SaveModelAction} URI-extraction
|
|
58
|
+
* helpers, and the live load/rebuild/resubmit flow with a settled-root
|
|
59
|
+
* invariant.
|
|
60
|
+
*
|
|
61
|
+
* **The settled-root invariant.** Every {@link AbstractHydraniumGlspState.setSourceRoot}
|
|
62
|
+
* the framework performs captures a root that has reached
|
|
63
|
+
* `IntegrityService.SettledState` (post-`Linked`, references indexed, on-build
|
|
64
|
+
* integrity rules applied). The GModel factory therefore always walks a fully
|
|
65
|
+
* linked + reprojected AST. The flow never captures off a transient mid-rebuild
|
|
66
|
+
* snapshot — notably it re-`settled()`s in the resubmit path rather than trusting
|
|
67
|
+
* the `onModelUpdated` event's document, which can arrive while a re-entered
|
|
68
|
+
* document is still being rebuilt.
|
|
69
|
+
*
|
|
70
|
+
* Adopters with richer needs override the seams ({@link isStructurallyBroken},
|
|
71
|
+
* {@link onParseErrorChanged}, {@link onSourceModelSettled}) rather than the
|
|
72
|
+
* whole flow, and select a {@link SaveConflictPolicy} via the bound option to
|
|
73
|
+
* tune how {@link saveSourceModel} reacts to a concurrent edit.
|
|
74
|
+
*
|
|
75
|
+
* **Default `saveSourceModel` flow.** Delegates to `ModelService.save`, which
|
|
76
|
+
* serialises through the language-specific `Serializer` bound at
|
|
77
|
+
* `services.serializer.Serializer` (resolved per-URI via `ServiceRegistry`),
|
|
78
|
+
* updates the multi-client text-document store, drives a rebuild, and writes the
|
|
79
|
+
* result via the `WritableFileSystemProvider`. The bound
|
|
80
|
+
* {@link SaveConflictPolicy} (default {@link DEFAULT_SAVE_CONFLICT_POLICY},
|
|
81
|
+
* `overwrite`) decides the based-on-version guard, await-vs-fire-and-forget, and
|
|
82
|
+
* failure handling.
|
|
83
|
+
*
|
|
84
|
+
* **tempId filter.** GLSP's `DefaultGlobalActionProvider` spins up a
|
|
85
|
+
* throwaway per-diagram-type container with upstream's {@link TEMPORARY_CLIENT_ID}
|
|
86
|
+
* placeholder purely to enumerate action kinds, then calls `unbindAll()`.
|
|
87
|
+
* The {@link postConstruct} hook skips registration for that placeholder so
|
|
88
|
+
* it doesn't linger in {@link ClientSessionManager}.
|
|
89
|
+
*
|
|
90
|
+
* **Lifecycle ordering.** `init` runs after DI resolution and parks the
|
|
91
|
+
* secondary-write-set watch, which outlives any single load.
|
|
92
|
+
* {@link sessionDisposed} calls {@link dispose}, which drains
|
|
93
|
+
* {@link toDispose} idempotently. Every transient subscription created in
|
|
94
|
+
* {@link doLoadSourceModel} is parked on {@link toDispose} so the drain catches
|
|
95
|
+
* them on client-detach.
|
|
96
|
+
*/
|
|
97
|
+
let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
98
|
+
logger;
|
|
99
|
+
sharedServices;
|
|
100
|
+
state;
|
|
101
|
+
sessionManager;
|
|
102
|
+
actionDispatcher;
|
|
103
|
+
submissionHandler;
|
|
104
|
+
commandStack;
|
|
105
|
+
/**
|
|
106
|
+
* Optional {@link ModelValidator} whose markers are pushed to the client by
|
|
107
|
+
* {@link refreshDiagnosticMarkers}. Bound per diagram via
|
|
108
|
+
* `DiagramModule.bindModelValidator()`; absent (no push) when the head binds
|
|
109
|
+
* no validator. The framework default is `HydraniumGlspModelValidator`
|
|
110
|
+
* (LSP diagnostics → markers).
|
|
111
|
+
*/
|
|
112
|
+
modelValidator;
|
|
113
|
+
/**
|
|
114
|
+
* Selected {@link SaveConflictPolicy} for {@link saveSourceModel}. Bind the
|
|
115
|
+
* {@link SaveConflictPolicy} token in a `DiagramModule` to choose a policy;
|
|
116
|
+
* left unbound it resolves to {@link DEFAULT_SAVE_CONFLICT_POLICY}
|
|
117
|
+
* (`overwrite`, last-write-wins). Read via {@link saveConflictPolicy} so the
|
|
118
|
+
* fallback is applied even when inversify injects `undefined` for an unbound
|
|
119
|
+
* `@optional()` member.
|
|
120
|
+
*/
|
|
121
|
+
boundSaveConflictPolicy;
|
|
122
|
+
/** Disposables created during {@link doLoadSourceModel}; drained on session disposal. */
|
|
123
|
+
toDispose = new DisposableCollection();
|
|
124
|
+
/**
|
|
125
|
+
* Live update subscriptions for the state's SECONDARY documents, keyed by URI.
|
|
126
|
+
* Reconciled by {@link reconcileSecondarySubscriptions} after every capture.
|
|
127
|
+
*
|
|
128
|
+
* Held apart from {@link toDispose} because this set is not fixed for the
|
|
129
|
+
* session: a document can leave the write set, and its subscription has to go
|
|
130
|
+
* with it rather than linger until the client detaches.
|
|
131
|
+
*/
|
|
132
|
+
secondarySubscriptions = new Map();
|
|
133
|
+
/**
|
|
134
|
+
* Whether an external resubmit has ever been dispatched. Gates the
|
|
135
|
+
* keep-the-last-valid-GModel branch, which needs to know a canvas is already
|
|
136
|
+
* standing — not what is on it. The content comparison that decides whether a
|
|
137
|
+
* resubmit is worth dispatching lives on the submission handler, which is the
|
|
138
|
+
* only place that sees operation submits too.
|
|
139
|
+
*/
|
|
140
|
+
hasSubmittedExternally = false;
|
|
141
|
+
/**
|
|
142
|
+
* Trailing-edge debounce for the external resubmit. Rescheduled on each
|
|
143
|
+
* {@link handleModelUpdated} so back-to-back rebuilds (cascade relinks,
|
|
144
|
+
* referenced-document edits) collapse into one {@link doUpdateAndSubmit}.
|
|
145
|
+
* Constructed in {@link init} (the injected {@link ServerSharedServices} —
|
|
146
|
+
* hence its `Clock` — is available by then); disposed on session teardown.
|
|
147
|
+
*/
|
|
148
|
+
resubmitDebouncer;
|
|
149
|
+
/** Latest event document awaiting the debounced resubmit; read by {@link flushResubmit} (last write wins). */
|
|
150
|
+
pendingResubmitDocument;
|
|
151
|
+
init() {
|
|
152
|
+
this.resubmitDebouncer = new Debouncer(this.sharedServices.Clock, () => this.flushResubmit(), {
|
|
153
|
+
delayMs: EXTERNAL_SUBMIT_DEBOUNCE_MS
|
|
154
|
+
});
|
|
155
|
+
if (this.state.clientId === TEMPORARY_CLIENT_ID) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
this.sessionManager.addListener(this, this.state.clientId);
|
|
159
|
+
// Watched for this storage's whole lifetime rather than per load. The load
|
|
160
|
+
// flow is a documented override point, so a subscription parked there would
|
|
161
|
+
// go with it — and the write set is discovered by operation handlers, which
|
|
162
|
+
// run long after any load.
|
|
163
|
+
this.toDispose.push(this.state.onSecondaryUrisChanged(() => this.reconcileSecondarySubscriptions()));
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Default load flow — {@link doLoadSourceModel}. Adopters whose load flow
|
|
167
|
+
* needs more than the seams allow override this method.
|
|
168
|
+
*/
|
|
169
|
+
loadSourceModel(action) {
|
|
170
|
+
return this.doLoadSourceModel(action);
|
|
171
|
+
}
|
|
172
|
+
async doLoadSourceModel(action) {
|
|
173
|
+
const sourceUri = this.getSourceUri(action);
|
|
174
|
+
const rootUri = this.toSourceModelUri(sourceUri);
|
|
175
|
+
const modelService = this.sharedServices.model.ModelService;
|
|
176
|
+
// Open FIRST: a workspace-scanned-but-never-didOpened document rebuilds here,
|
|
177
|
+
// so the capture below settles on a built root rather than a transient
|
|
178
|
+
// mid-rebuild one.
|
|
179
|
+
this.toDispose.push(await modelService.open({ uri: rootUri, clientId: this.state.clientId }));
|
|
180
|
+
// GLSP's sessionDisposed is unreliable on Theia tab-close; dispose on client
|
|
181
|
+
// detach so reopens don't accumulate stale onModelUpdated listeners.
|
|
182
|
+
this.toDispose.push(modelService.onClientClosed(rootUri, this.state.clientId, () => {
|
|
183
|
+
this.logger.info(`Client detached (${this.state.clientId}) — disposing storage subscriptions for ${rootUri}`);
|
|
184
|
+
this.dispose();
|
|
185
|
+
}));
|
|
186
|
+
// React to external rebuilds: settle-gated capture + debounced/deduped resubmit.
|
|
187
|
+
this.toDispose.push(modelService.onModelUpdated(rootUri, event => this.handleModelUpdated(rootUri, event)));
|
|
188
|
+
// Coordinate the command stack's dirty state when another client saves.
|
|
189
|
+
this.toDispose.push(modelService.onModelSaved(rootUri, event => this.handleModelSaved(event)));
|
|
190
|
+
// Capture the initial settled root.
|
|
191
|
+
const document = await modelService.settled(rootUri);
|
|
192
|
+
await this.captureSettledRoot(rootUri, document);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Capture the initial settled root and apply the initial edit mode. `settled()`
|
|
196
|
+
* strips diagnostics by phase contract, so the first edit mode is `EDITABLE`;
|
|
197
|
+
* the first {@link handleModelUpdated} (at `Validated`, with diagnostics) flips
|
|
198
|
+
* it READONLY if the document has structural parse errors. Edit-mode +
|
|
199
|
+
* settle-hook actions are dispatched on a macrotask so the initial
|
|
200
|
+
* `requestModel → setModel` handshake isn't perturbed.
|
|
201
|
+
*/
|
|
202
|
+
async captureSettledRoot(rootUri, document) {
|
|
203
|
+
this.state.setSourceRoot(rootUri, document.root);
|
|
204
|
+
const actions = [...this.refreshEditMode(document), ...this.onSourceModelSettled(document)];
|
|
205
|
+
if (actions.length > 0) {
|
|
206
|
+
// Defer through the injectable Clock (not raw setTimeout) so the dispatch is
|
|
207
|
+
// testable and cancels on session disposal; parked on toDispose for that.
|
|
208
|
+
this.toDispose.push(this.sharedServices.Clock.setTimer(() => this.actionDispatcher.dispatchAll(actions), 0));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Reconcile {@link secondarySubscriptions} against the state's current
|
|
213
|
+
* secondary write set: dispose what left it, subscribe what arrived. Driven by
|
|
214
|
+
* {@link AbstractHydraniumGlspState.onSecondaryUrisChanged}, so it runs when
|
|
215
|
+
* the set actually changes rather than at points a caller guessed it might.
|
|
216
|
+
*
|
|
217
|
+
* **Secondaries need a subscription of their own because nothing else
|
|
218
|
+
* notifies for them.** The state records a secondary's version for the
|
|
219
|
+
* write-side conflict gate and adopter GModel factories re-read secondary
|
|
220
|
+
* content on every build, but no rebuild of a secondary reaches the primary's
|
|
221
|
+
* subscription: Langium's affected-documents walk runs from the referenced
|
|
222
|
+
* document to the referencing one, so a document that references the primary
|
|
223
|
+
* is downstream of it and editing it correctly affects nothing upstream.
|
|
224
|
+
* Manufacturing that invalidation to obtain a notification would cost a real
|
|
225
|
+
* rebuild per edit and make the affected set mean two things — the missing
|
|
226
|
+
* piece is a subscription, not an invalidation.
|
|
227
|
+
*/
|
|
228
|
+
reconcileSecondarySubscriptions() {
|
|
229
|
+
const current = new Set(this.state.secondaryUris);
|
|
230
|
+
for (const [uri, subscription] of this.secondarySubscriptions) {
|
|
231
|
+
if (!current.has(uri)) {
|
|
232
|
+
subscription.dispose();
|
|
233
|
+
this.secondarySubscriptions.delete(uri);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
for (const uri of current) {
|
|
237
|
+
if (!this.secondarySubscriptions.has(uri)) {
|
|
238
|
+
this.secondarySubscriptions.set(uri, this.sharedServices.model.ModelService.onModelUpdated(uri, event => this.handleSecondaryUpdated(uri, event)));
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* React to a rebuild of a SECONDARY document by resubmitting the diagram, so
|
|
244
|
+
* an external edit to (say) a layout file reaches the canvas.
|
|
245
|
+
*
|
|
246
|
+
* Reuses {@link handleModelUpdated}'s authorship guard, and that is the load-
|
|
247
|
+
* bearing half rather than the resubmit: a diagram interaction that writes a
|
|
248
|
+
* secondary — a drag persisting bounds to a layout file — comes back through
|
|
249
|
+
* this listener as the client's own `changed` edit, and resubmitting on it
|
|
250
|
+
* fights the optimistic client-side move the user is still holding.
|
|
251
|
+
*
|
|
252
|
+
* Schedules the PRIMARY's current document, never the secondary's.
|
|
253
|
+
* {@link doUpdateAndSubmit} reads its event document only for the edit-mode
|
|
254
|
+
* and structurally-broken decisions, both of which are statements about the
|
|
255
|
+
* document the canvas edits: passing the secondary's would let a typo in a
|
|
256
|
+
* layout file flip the canvas READONLY and take the keep-the-last-valid-GModel
|
|
257
|
+
* branch off an unrelated document's parse state. The pending-document field
|
|
258
|
+
* is shared with the primary path, so it would poison a concurrently
|
|
259
|
+
* scheduled primary resubmit too.
|
|
260
|
+
*
|
|
261
|
+
* No marker refresh, unlike the primary path: a secondary's diagnostics reach
|
|
262
|
+
* the client only if an adopter's index registers elements as rendering that
|
|
263
|
+
* document, and refreshing here unconditionally would add a dispatch to every
|
|
264
|
+
* drag this client authors — the guard above gates the resubmit, not the
|
|
265
|
+
* markers.
|
|
266
|
+
*/
|
|
267
|
+
handleSecondaryUpdated(uri, event) {
|
|
268
|
+
if (this.disposeIfStale(uri)) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
if (this.state.clientId === event.sourceClientId && event.reason === 'changed') {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
const primary = this.currentPrimaryDocument();
|
|
275
|
+
if (primary === undefined) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
this.logger.debug(`Secondary ${uri} rebuilt by ${event.sourceClientId} (${event.reason}) — scheduling resubmit`);
|
|
279
|
+
this.scheduleUpdateAndSubmit(primary);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* The primary document's current state, or `undefined` when it is not
|
|
283
|
+
* registered.
|
|
284
|
+
*
|
|
285
|
+
* Synchronous by construction — the phase-agnostic lookup door plus the shared
|
|
286
|
+
* projection — so reacting to a secondary neither waits nor can force a build.
|
|
287
|
+
* `settled()` is not an alternative: it strips diagnostics by phase contract,
|
|
288
|
+
* and diagnostics are the reason {@link doUpdateAndSubmit} takes a separate
|
|
289
|
+
* event document at all.
|
|
290
|
+
*/
|
|
291
|
+
currentPrimaryDocument() {
|
|
292
|
+
const document = this.sharedServices.model.ModelService.getDocument(this.state.sourceUri);
|
|
293
|
+
return document ? AstDocument.from(document) : undefined;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* React to an external rebuild reaching `Validated`. Self-cleans if the
|
|
297
|
+
* session has vanished but this listener leaked (neither `sessionDisposed`
|
|
298
|
+
* nor `onClientClosed` fired on tab close). Resubmits for any change not
|
|
299
|
+
* authored by this client's own optimistic `changed` edit, then refreshes
|
|
300
|
+
* diagnostic markers for every update — including own edits, which skip
|
|
301
|
+
* the resubmit but can still change diagnostics.
|
|
302
|
+
*/
|
|
303
|
+
async handleModelUpdated(rootUri, event) {
|
|
304
|
+
if (this.disposeIfStale(rootUri)) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
if (this.state.clientId !== event.sourceClientId || event.reason !== 'changed') {
|
|
308
|
+
this.scheduleUpdateAndSubmit(event.document);
|
|
309
|
+
}
|
|
310
|
+
await this.refreshDiagnosticMarkers();
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Whether this storage has outlived its session — disposing it as a side
|
|
314
|
+
* effect when so. Checked from every subscription entry point because GLSP's
|
|
315
|
+
* `sessionDisposed` is unreliable on Theia tab-close and `onClientClosed` can
|
|
316
|
+
* miss it as well; a listener that survives its session otherwise keeps firing
|
|
317
|
+
* for the life of the process. `context` names the document whose event
|
|
318
|
+
* surfaced the leak.
|
|
319
|
+
*/
|
|
320
|
+
disposeIfStale(context) {
|
|
321
|
+
if (this.sessionManager.getSession(this.state.clientId)) {
|
|
322
|
+
return false;
|
|
323
|
+
}
|
|
324
|
+
this.logger.warn(`Stale storage (clientId=${this.state.clientId} not in ClientSessionManager) — self-disposing ${context}`);
|
|
325
|
+
this.dispose();
|
|
326
|
+
return true;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Record the latest document and (re)arm the trailing-edge
|
|
330
|
+
* {@link resubmitDebouncer}, so a burst of rebuilds runs
|
|
331
|
+
* {@link doUpdateAndSubmit} once with the most recent document.
|
|
332
|
+
*/
|
|
333
|
+
scheduleUpdateAndSubmit(document) {
|
|
334
|
+
this.pendingResubmitDocument = document;
|
|
335
|
+
this.resubmitDebouncer.schedule();
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Debouncer callback: run the resubmit for the latest pending document
|
|
339
|
+
* against this storage's (invariant) source URI and dispatch the result.
|
|
340
|
+
* Fire-and-forget — failures are logged, not surfaced to the timer caller.
|
|
341
|
+
*/
|
|
342
|
+
flushResubmit() {
|
|
343
|
+
const document = this.pendingResubmitDocument;
|
|
344
|
+
if (document === undefined) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
const rootUri = this.state.sourceUri;
|
|
348
|
+
this.doUpdateAndSubmit(rootUri, document).then(actions => this.actionDispatcher.dispatchAll(actions), error => this.logger.error(`Update-and-submit failed for ${rootUri}: ${error instanceof Error ? error.message : String(error)}`));
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Coordinate the command stack when another client persists the document:
|
|
352
|
+
* mark our stack clean so the editor doesn't prompt to re-save identical
|
|
353
|
+
* content. Our own saves already settle the stack through the save flow.
|
|
354
|
+
*/
|
|
355
|
+
handleModelSaved(event) {
|
|
356
|
+
if (this.state.clientId !== event.sourceClientId) {
|
|
357
|
+
this.commandStack.saveIsDone();
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Re-settle to a guaranteed fully-linked + reprojected root, capture it, and
|
|
362
|
+
* (unless suppressed) resubmit a deduped external GModel. Diagnostics for the
|
|
363
|
+
* edit-mode decision come from the event document (`settled()` strips them by
|
|
364
|
+
* phase contract).
|
|
365
|
+
*/
|
|
366
|
+
async doUpdateAndSubmit(rootUri, eventDocument) {
|
|
367
|
+
// Settle-gate the capture: never setSourceRoot off the event's possibly-transient
|
|
368
|
+
// snapshot — the event can arrive while a re-entered document is mid-rebuild.
|
|
369
|
+
const document = await this.sharedServices.model.ModelService.settled(rootUri);
|
|
370
|
+
this.state.setSourceRoot(rootUri, document.root);
|
|
371
|
+
const editModeActions = this.refreshEditMode(eventDocument);
|
|
372
|
+
// Skip the external submit until the initial requestModel completes; submitting too
|
|
373
|
+
// early bumps root.revision and the client's stale first computedBounds is dropped,
|
|
374
|
+
// leaving the canvas empty.
|
|
375
|
+
if (this.submissionHandler.hasPendingInitialRequest()) {
|
|
376
|
+
return editModeActions;
|
|
377
|
+
}
|
|
378
|
+
// While the AST is structurally broken, keep the last valid GModel so the canvas
|
|
379
|
+
// doesn't blank mid-typing. READONLY is still flipped for user feedback.
|
|
380
|
+
if (this.isStructurallyBroken(eventDocument) && this.hasSubmittedExternally) {
|
|
381
|
+
return editModeActions;
|
|
382
|
+
}
|
|
383
|
+
// Read the handler's signature BEFORE submitting and again after: it records
|
|
384
|
+
// every submission whatever the reason, so an unmoved signature means this
|
|
385
|
+
// rebuild produced the graph the client already has. Comparing only against
|
|
386
|
+
// our own previous EXTERNAL submit cannot see that, which is why a drag used
|
|
387
|
+
// to be answered by an echo of itself — the operation had delivered the
|
|
388
|
+
// model, and the external comparison had never heard of it.
|
|
389
|
+
const previousSignature = this.submissionHandler.lastSubmittedSignature;
|
|
390
|
+
const submitActions = await this.submissionHandler.submitModel('external');
|
|
391
|
+
if (this.submissionHandler.lastSubmittedSignature === previousSignature) {
|
|
392
|
+
return editModeActions;
|
|
393
|
+
}
|
|
394
|
+
this.hasSubmittedExternally = true;
|
|
395
|
+
return [...submitActions, ...editModeActions];
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Recompute the desired edit mode from the document's structural-error state,
|
|
399
|
+
* flip {@link AbstractHydraniumGlspState.editMode}, and — only on a transition —
|
|
400
|
+
* return the {@link onParseErrorChanged} actions. No transition → no actions.
|
|
401
|
+
*/
|
|
402
|
+
refreshEditMode(document) {
|
|
403
|
+
const broken = this.isStructurallyBroken(document);
|
|
404
|
+
const previousEditMode = this.state.editMode;
|
|
405
|
+
this.state.editMode = broken ? EditMode.READONLY : EditMode.EDITABLE;
|
|
406
|
+
if (previousEditMode === this.state.editMode) {
|
|
407
|
+
return [];
|
|
408
|
+
}
|
|
409
|
+
return this.onParseErrorChanged(document, broken);
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Seam: is the AST structurally broken (lexing/parsing errors)? Drives both
|
|
413
|
+
* READONLY mode and the GModel resubmit skip — keeping the last valid canvas
|
|
414
|
+
* instead of blanking it mid-typing. Default: any error-severity diagnostic
|
|
415
|
+
* carrying a Langium `lexing-error` / `parsing-error` code. Adopters override
|
|
416
|
+
* to compose additional break reasons.
|
|
417
|
+
*/
|
|
418
|
+
isStructurallyBroken(document) {
|
|
419
|
+
return document.diagnostics.some(diagnostic => isStructuralDiagnostic(diagnostic));
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Seam: actions to emit when the structural-broken state transitions. Default:
|
|
423
|
+
* a single {@link SetEditModeAction} toggling READONLY ↔ EDITABLE — editing is
|
|
424
|
+
* disabled while the syntax is broken but re-enabled once it parses, a sound
|
|
425
|
+
* generic for any Langium-backed diagram. Adopters override to add or replace
|
|
426
|
+
* the transition feedback. The {@link AbstractHydraniumGlspState.editMode}
|
|
427
|
+
* flip itself is owned by {@link refreshEditMode}.
|
|
428
|
+
*/
|
|
429
|
+
onParseErrorChanged(_document, broken) {
|
|
430
|
+
return [SetEditModeAction.create(broken ? EditMode.READONLY : EditMode.EDITABLE)];
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Seam: extra actions to dispatch right after the initial settled root is
|
|
434
|
+
* captured (e.g. an adopter-specific status or palette refresh). Default: none.
|
|
435
|
+
*/
|
|
436
|
+
onSourceModelSettled(_document) {
|
|
437
|
+
return [];
|
|
438
|
+
}
|
|
439
|
+
/** The effective {@link SaveConflictPolicy}: the bound option, or {@link DEFAULT_SAVE_CONFLICT_POLICY} when unbound. */
|
|
440
|
+
get saveConflictPolicy() {
|
|
441
|
+
return this.boundSaveConflictPolicy ?? DEFAULT_SAVE_CONFLICT_POLICY;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Default save flow: route through `ModelService.save`. The framework
|
|
445
|
+
* serialise-and-persist machinery handles serialisation (via the
|
|
446
|
+
* language-specific `Serializer` bound at `services.serializer.Serializer`),
|
|
447
|
+
* the multi-client text-document update, the rebuild, and the eventual
|
|
448
|
+
* `WritableFileSystemProvider.writeFile`.
|
|
449
|
+
*
|
|
450
|
+
* The configured {@link SaveConflictPolicy} (see {@link saveConflictPolicy})
|
|
451
|
+
* decides how a concurrent edit that advanced the document is handled:
|
|
452
|
+
* - `overwrite` (default): no based-on guard, await, propagate failures —
|
|
453
|
+
* last-write-wins, correct for a single-editor head.
|
|
454
|
+
* - `reject`: guard on the captured `state.version`, await, surface a
|
|
455
|
+
* `ConflictError` (and any other failure) to the GLSP save action.
|
|
456
|
+
* - `drop-and-log`: guard, fire-and-forget, log + swallow failures — a stale
|
|
457
|
+
* diagram save is dropped because a concurrent form/code edit already wrote
|
|
458
|
+
* the truth, and GLSP exposes no save-failure back-channel.
|
|
459
|
+
*
|
|
460
|
+
* Returns `MaybePromise<void>` to match upstream `SourceModelStorage`:
|
|
461
|
+
* resolves with the persist under `overwrite`/`reject`, returns synchronously
|
|
462
|
+
* under `drop-and-log`. Adopters that bypass `ModelService` (writing through
|
|
463
|
+
* `WritableFileSystemProvider` directly) still override the whole method.
|
|
464
|
+
*/
|
|
465
|
+
saveSourceModel(action) {
|
|
466
|
+
// Normalised for the same reason the load path is: `SaveModelAction.fileUri`
|
|
467
|
+
// is client-supplied on a "Save As" and carries whichever form that client
|
|
468
|
+
// uses. The state fallback is already a URI string, and normalising one is
|
|
469
|
+
// idempotent, so this only changes the client-supplied branch. Applied at
|
|
470
|
+
// the call site rather than inside `getFileUri` so that method's contract —
|
|
471
|
+
// return what the action said — is unchanged for adopters overriding it.
|
|
472
|
+
const uri = this.toSourceModelUri(this.getFileUri(action));
|
|
473
|
+
const policy = this.saveConflictPolicy;
|
|
474
|
+
const persisted = this.sharedServices.model.ModelService.save({
|
|
475
|
+
uri,
|
|
476
|
+
model: this.state.sourceRoot,
|
|
477
|
+
clientId: this.state.clientId,
|
|
478
|
+
baseVersion: policy.kind === 'overwrite' ? undefined : this.state.version
|
|
479
|
+
}).then(() => undefined);
|
|
480
|
+
if (policy.kind === 'drop-and-log') {
|
|
481
|
+
// Fire-and-forget: the diagram save lost the race to a concurrent edit
|
|
482
|
+
// that already persisted the truth, so it must neither block the action
|
|
483
|
+
// nor surface. Log rather than leave an unhandled rejection.
|
|
484
|
+
persisted.catch(error => this.logger.error(`Save failed for ${uri}: ${error instanceof Error ? error.message : String(error)}`));
|
|
485
|
+
return undefined;
|
|
486
|
+
}
|
|
487
|
+
// overwrite / reject: await; a ConflictError (reject) or any other failure
|
|
488
|
+
// propagates to GLSP's save-action handler.
|
|
489
|
+
return persisted;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Normalise GLSP's `sourceUri` — which may be a filesystem PATH or a URI
|
|
493
|
+
* string — to the URI string the workspace keys documents by.
|
|
494
|
+
*
|
|
495
|
+
* **The protocol does not pin which form a client sends, and the clients in
|
|
496
|
+
* play disagree.** GLSP's VS Code integration sends `document.uri.toString()`;
|
|
497
|
+
* a headless caller passes the path it already has. Committing to either one
|
|
498
|
+
* alone is what this method exists to avoid.
|
|
499
|
+
*
|
|
500
|
+
* **Getting it wrong does not throw where the mistake is.** `URI.file` given
|
|
501
|
+
* a URI string treats the whole thing as a path, percent-encodes the scheme,
|
|
502
|
+
* and yields an `fsPath` with that scheme buried in the middle. Nothing
|
|
503
|
+
* rejects it; it travels down to the filesystem and surfaces as an ENOENT
|
|
504
|
+
* several layers from the coercion that produced it.
|
|
505
|
+
*
|
|
506
|
+
* Adopters whose client sends a third form override this.
|
|
507
|
+
*/
|
|
508
|
+
toSourceModelUri(sourceUri) {
|
|
509
|
+
return URI_SCHEME.test(sourceUri) ? URI.parse(sourceUri).toString() : URI.file(sourceUri).toString();
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Extract the source URI from a {@link RequestModelAction}. Throws
|
|
513
|
+
* {@link GLSPServerError} if the option is missing or non-string —
|
|
514
|
+
* GLSP's protocol contract requires the client to pass `sourceUri`
|
|
515
|
+
* when initiating a model request.
|
|
516
|
+
*
|
|
517
|
+
* Returns it VERBATIM, in whatever form the client sent;
|
|
518
|
+
* {@link toSourceModelUri} is what normalises it.
|
|
519
|
+
*/
|
|
520
|
+
getSourceUri(action) {
|
|
521
|
+
const sourceUri = action.options?.[SOURCE_URI_ARG];
|
|
522
|
+
if (typeof sourceUri !== 'string') {
|
|
523
|
+
throw new GLSPServerError(`Invalid RequestModelAction! Missing argument with key '${SOURCE_URI_ARG}'`);
|
|
524
|
+
}
|
|
525
|
+
return sourceUri;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Resolve the URI to save to: prefer the {@link SaveModelAction.fileUri}
|
|
529
|
+
* (set when the user chose "Save As"), fall back to the
|
|
530
|
+
* {@link SOURCE_URI_ARG} mirrored into the inherited properties map by
|
|
531
|
+
* {@link AbstractHydraniumGlspState.setSourceRoot}.
|
|
532
|
+
*
|
|
533
|
+
* A save action carries no request id, so a throw here reaches the user as a
|
|
534
|
+
* toast built from `message`, with `cause` behind its details control. The
|
|
535
|
+
* two therefore address different readers and must not be collapsed: the
|
|
536
|
+
* message names what failed in the user's terms, and the cause names which
|
|
537
|
+
* lookups came back empty for whom. Neither can name the URI — not having
|
|
538
|
+
* one IS the failure, and both sources are written together, so the typed
|
|
539
|
+
* `sourceUri` is equally empty whenever this fires.
|
|
540
|
+
*/
|
|
541
|
+
getFileUri(action) {
|
|
542
|
+
const uri = action.fileUri ?? this.state.get(SOURCE_URI_ARG);
|
|
543
|
+
if (!uri) {
|
|
544
|
+
throw new GLSPServerError('Could not determine where to save this model', `no fileUri on the save action and no ${SOURCE_URI_ARG} in the model state (clientId=${this.state.clientId})`);
|
|
545
|
+
}
|
|
546
|
+
return uri;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Recompute the bound {@link ModelValidator}'s markers and push them to the
|
|
550
|
+
* client as a `SetMarkersAction` — asynchronously and independently of model
|
|
551
|
+
* rendering. Called from {@link handleModelUpdated} (which fires at `Validated`),
|
|
552
|
+
* so diagram markers refresh without gating the diagram submit on validation.
|
|
553
|
+
* No-op when no validator is bound.
|
|
554
|
+
*
|
|
555
|
+
* Always dispatched under {@link MarkersReason.BATCH}: the GLSP client's
|
|
556
|
+
* `ValidationFeedbackEmitter` keys feedback by reason and replaces the prior
|
|
557
|
+
* set, so re-pushing the full set clears stale markers (an empty set clears
|
|
558
|
+
* all once the model is valid), and sharing the tool-palette validate
|
|
559
|
+
* command's `BATCH` reason means the two paths replace rather than duplicate.
|
|
560
|
+
*/
|
|
561
|
+
async refreshDiagnosticMarkers() {
|
|
562
|
+
if (!this.modelValidator) {
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
const markers = await this.modelValidator.validate([this.state.root], MarkersReason.BATCH);
|
|
566
|
+
this.actionDispatcher.dispatch(SetMarkersAction.create(markers, { reason: MarkersReason.BATCH }));
|
|
567
|
+
}
|
|
568
|
+
sessionDisposed(_clientSession) {
|
|
569
|
+
this.dispose();
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Cancel any pending resubmit and drain every subscription — those registered
|
|
573
|
+
* during {@link doLoadSourceModel} and the per-secondary ones, which live
|
|
574
|
+
* outside {@link toDispose} because they come and go with the write set.
|
|
575
|
+
* Idempotent.
|
|
576
|
+
*/
|
|
577
|
+
dispose() {
|
|
578
|
+
this.resubmitDebouncer?.dispose();
|
|
579
|
+
for (const subscription of this.secondarySubscriptions.values()) {
|
|
580
|
+
subscription.dispose();
|
|
581
|
+
}
|
|
582
|
+
this.secondarySubscriptions.clear();
|
|
583
|
+
this.toDispose.dispose();
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
__decorate([
|
|
587
|
+
inject(GlspLogger),
|
|
588
|
+
__metadata("design:type", GlspLogger)
|
|
589
|
+
], HydraniumGlspStorage.prototype, "logger", void 0);
|
|
590
|
+
__decorate([
|
|
591
|
+
inject(HydraniumTypes.SharedCoreServices),
|
|
592
|
+
__metadata("design:type", Object)
|
|
593
|
+
], HydraniumGlspStorage.prototype, "sharedServices", void 0);
|
|
594
|
+
__decorate([
|
|
595
|
+
inject(ModelState),
|
|
596
|
+
__metadata("design:type", Function)
|
|
597
|
+
], HydraniumGlspStorage.prototype, "state", void 0);
|
|
598
|
+
__decorate([
|
|
599
|
+
inject(ClientSessionManager),
|
|
600
|
+
__metadata("design:type", Object)
|
|
601
|
+
], HydraniumGlspStorage.prototype, "sessionManager", void 0);
|
|
602
|
+
__decorate([
|
|
603
|
+
inject(ActionDispatcher),
|
|
604
|
+
__metadata("design:type", Object)
|
|
605
|
+
], HydraniumGlspStorage.prototype, "actionDispatcher", void 0);
|
|
606
|
+
__decorate([
|
|
607
|
+
inject(ModelSubmissionHandler),
|
|
608
|
+
__metadata("design:type", Function)
|
|
609
|
+
], HydraniumGlspStorage.prototype, "submissionHandler", void 0);
|
|
610
|
+
__decorate([
|
|
611
|
+
inject(CommandStack),
|
|
612
|
+
__metadata("design:type", Function)
|
|
613
|
+
], HydraniumGlspStorage.prototype, "commandStack", void 0);
|
|
614
|
+
__decorate([
|
|
615
|
+
inject(ModelValidator),
|
|
616
|
+
optional(),
|
|
617
|
+
__metadata("design:type", Object)
|
|
618
|
+
], HydraniumGlspStorage.prototype, "modelValidator", void 0);
|
|
619
|
+
__decorate([
|
|
620
|
+
inject(SaveConflictPolicy),
|
|
621
|
+
optional(),
|
|
622
|
+
__metadata("design:type", Object)
|
|
623
|
+
], HydraniumGlspStorage.prototype, "boundSaveConflictPolicy", void 0);
|
|
624
|
+
__decorate([
|
|
625
|
+
postConstruct(),
|
|
626
|
+
__metadata("design:type", Function),
|
|
627
|
+
__metadata("design:paramtypes", []),
|
|
628
|
+
__metadata("design:returntype", void 0)
|
|
629
|
+
], HydraniumGlspStorage.prototype, "init", null);
|
|
630
|
+
HydraniumGlspStorage = __decorate([
|
|
631
|
+
injectable()
|
|
632
|
+
], HydraniumGlspStorage);
|
|
633
|
+
export { HydraniumGlspStorage };
|
|
634
|
+
//# sourceMappingURL=hydranium-glsp-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-storage.js","sourceRoot":"","sources":["../../src/storage/hydranium-glsp-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;;;;AAElF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAEJ,gBAAgB,EAGhB,oBAAoB,EACpB,YAAY,EAGZ,QAAQ,EACR,eAAe,EACf,MAAM,IAAI,UAAU,EAEpB,UAAU,EACV,sBAAsB,EACtB,cAAc,EAEd,cAAc,EAEd,iBAAiB,EAEjB,mBAAmB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAuF,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE7F,wFAAwF;AACxF,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,UAA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,CAAC;;+DAA4F;AAClF;IAAxC,MAAM,CAAC,YAAY,CAAC;;0DAAuD;AASrB;IAAtD,MAAM,CAAC,cAAc,CAAC;IAAE,QAAQ,EAAE;;4DAAoD;AAU5B;IAA1D,MAAM,CAAC,kBAAkB,CAAC;IAAE,QAAQ,EAAE;;qEAAiE;AAqC9F;IADT,aAAa,EAAE;;;;gDAcf;AA9ES,oBAAoB;IADhC,UAAU,EAAE;GACA,oBAAoB,CA6hBhC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
export * from './hydranium-glsp-storage.js';
|
|
10
|
+
export * from './save-conflict-policy.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|