@eclipse-glsp/server 1.1.0-RC10 → 1.1.0-next.231d53b.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/launch/worker-server-launcher.js +2 -1
- package/lib/browser/launch/worker-server-launcher.js.map +1 -1
- package/lib/common/actions/action-dispatcher.d.ts +2 -1
- package/lib/common/actions/action-dispatcher.d.ts.map +1 -1
- package/lib/common/actions/action-dispatcher.js +9 -6
- package/lib/common/actions/action-dispatcher.js.map +1 -1
- package/lib/common/actions/action-handler-registry.js +4 -2
- package/lib/common/actions/action-handler-registry.js.map +1 -1
- package/lib/common/actions/client-action-handler.d.ts +17 -8
- package/lib/common/actions/client-action-handler.d.ts.map +1 -1
- package/lib/common/actions/client-action-handler.js +32 -21
- package/lib/common/actions/client-action-handler.js.map +1 -1
- package/lib/common/actions/global-action-provider.d.ts +6 -21
- package/lib/common/actions/global-action-provider.d.ts.map +1 -1
- package/lib/common/actions/global-action-provider.js +17 -21
- package/lib/common/actions/global-action-provider.js.map +1 -1
- package/lib/common/command/command-stack.js +2 -1
- package/lib/common/command/command-stack.js.map +1 -1
- package/lib/common/command/recording-command.d.ts +9 -15
- package/lib/common/command/recording-command.d.ts.map +1 -1
- package/lib/common/command/recording-command.js +12 -26
- package/lib/common/command/recording-command.js.map +1 -1
- package/lib/common/command/undo-redo-action-handler.js +2 -1
- package/lib/common/command/undo-redo-action-handler.js.map +1 -1
- package/lib/common/di/client-session-module.d.ts +9 -1
- package/lib/common/di/client-session-module.d.ts.map +1 -1
- package/lib/common/di/client-session-module.js +9 -9
- package/lib/common/di/client-session-module.js.map +1 -1
- package/lib/common/di/diagram-module.d.ts +23 -1
- package/lib/common/di/diagram-module.d.ts.map +1 -1
- package/lib/common/di/diagram-module.js +23 -53
- package/lib/common/di/diagram-module.js.map +1 -1
- package/lib/common/di/glsp-module.js +2 -1
- package/lib/common/di/glsp-module.js.map +1 -1
- package/lib/common/di/server-module.d.ts +0 -1
- package/lib/common/di/server-module.d.ts.map +1 -1
- package/lib/common/di/server-module.js +0 -1
- package/lib/common/di/server-module.js.map +1 -1
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.d.ts.map +1 -1
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.js +2 -1
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.js.map +1 -1
- package/lib/common/features/contextactions/command-palette-action-provider.js +2 -1
- package/lib/common/features/contextactions/command-palette-action-provider.js.map +1 -1
- package/lib/common/features/contextactions/context-actions-provider-registry.js +2 -1
- package/lib/common/features/contextactions/context-actions-provider-registry.js.map +1 -1
- package/lib/common/features/contextactions/context-menu-item-provider.js +2 -1
- package/lib/common/features/contextactions/context-menu-item-provider.js.map +1 -1
- package/lib/common/features/contextactions/request-context-actions-handler.js +2 -1
- package/lib/common/features/contextactions/request-context-actions-handler.js.map +1 -1
- package/lib/common/features/contextactions/tool-palette-item-provider.js +4 -2
- package/lib/common/features/contextactions/tool-palette-item-provider.js.map +1 -1
- package/lib/common/features/directediting/context-edit-validator-registry.js +2 -1
- package/lib/common/features/directediting/context-edit-validator-registry.js.map +1 -1
- package/lib/common/features/directediting/label-edit-validator.js +2 -1
- package/lib/common/features/directediting/label-edit-validator.js.map +1 -1
- package/lib/common/features/directediting/request-edit-validation-handler.js +2 -1
- package/lib/common/features/directediting/request-edit-validation-handler.js.map +1 -1
- package/lib/common/features/layout/computed-bounds-action-handler.js +2 -1
- package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -1
- package/lib/common/features/layout/layout-operation-handler.js +2 -1
- package/lib/common/features/layout/layout-operation-handler.js.map +1 -1
- package/lib/common/features/model/gmodel-factory.js +2 -1
- package/lib/common/features/model/gmodel-factory.js.map +1 -1
- package/lib/common/features/model/gmodel-index.js +2 -1
- package/lib/common/features/model/gmodel-index.js.map +1 -1
- package/lib/common/features/model/gmodel-serializer.d.ts +10 -10
- package/lib/common/features/model/gmodel-serializer.d.ts.map +1 -1
- package/lib/common/features/model/gmodel-serializer.js +2 -1
- package/lib/common/features/model/gmodel-serializer.js.map +1 -1
- package/lib/common/features/model/model-state.d.ts.map +1 -1
- package/lib/common/features/model/model-state.js +5 -1
- package/lib/common/features/model/model-state.js.map +1 -1
- package/lib/common/features/model/model-submission-handler.d.ts +30 -3
- package/lib/common/features/model/model-submission-handler.d.ts.map +1 -1
- package/lib/common/features/model/model-submission-handler.js +73 -8
- package/lib/common/features/model/model-submission-handler.js.map +1 -1
- package/lib/common/features/model/request-model-action-handler.d.ts +5 -6
- package/lib/common/features/model/request-model-action-handler.d.ts.map +1 -1
- package/lib/common/features/model/request-model-action-handler.js +37 -14
- package/lib/common/features/model/request-model-action-handler.js.map +1 -1
- package/lib/common/features/model/save-model-action-handler.js +2 -1
- package/lib/common/features/model/save-model-action-handler.js.map +1 -1
- package/lib/common/features/navigation/navigation-target-provider-registry.js +2 -1
- package/lib/common/features/navigation/navigation-target-provider-registry.js.map +1 -1
- package/lib/common/features/navigation/navigation-target-resolver.js +2 -1
- package/lib/common/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/common/features/navigation/request-navigation-targets-action-handler.js +2 -1
- package/lib/common/features/navigation/request-navigation-targets-action-handler.js.map +1 -1
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js +2 -1
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js.map +1 -1
- package/lib/common/features/popup/request-popup-model-action-handler.js +2 -1
- package/lib/common/features/popup/request-popup-model-action-handler.js.map +1 -1
- package/lib/common/features/progress/progress-service.d.ts +44 -0
- package/lib/common/features/progress/progress-service.d.ts.map +1 -0
- package/lib/common/features/progress/progress-service.js +51 -0
- package/lib/common/features/progress/progress-service.js.map +1 -0
- package/lib/common/features/type-hints/edge-creation-checker.d.ts +42 -0
- package/lib/common/features/type-hints/edge-creation-checker.d.ts.map +1 -0
- package/lib/common/features/type-hints/edge-creation-checker.js +20 -0
- package/lib/common/features/type-hints/edge-creation-checker.js.map +1 -0
- package/lib/common/features/type-hints/request-check-edge-action-handler.d.ts +29 -0
- package/lib/common/features/type-hints/request-check-edge-action-handler.d.ts.map +1 -0
- package/lib/common/features/type-hints/request-check-edge-action-handler.js +72 -0
- package/lib/common/features/type-hints/request-check-edge-action-handler.js.map +1 -0
- package/lib/common/{diagram → features/type-hints}/request-type-hints-action-handler.d.ts +2 -3
- package/lib/common/features/type-hints/request-type-hints-action-handler.d.ts.map +1 -0
- package/lib/common/{diagram → features/type-hints}/request-type-hints-action-handler.js +3 -3
- package/lib/common/features/type-hints/request-type-hints-action-handler.js.map +1 -0
- package/lib/common/features/validation/model-validator.d.ts +47 -2
- package/lib/common/features/validation/model-validator.d.ts.map +1 -1
- package/lib/common/features/validation/model-validator.js +80 -1
- package/lib/common/features/validation/model-validator.js.map +1 -1
- package/lib/common/features/validation/request-markers-handler.d.ts +15 -0
- package/lib/common/features/validation/request-markers-handler.d.ts.map +1 -1
- package/lib/common/features/validation/request-markers-handler.js +5 -10
- package/lib/common/features/validation/request-markers-handler.js.map +1 -1
- package/lib/common/gmodel/apply-label-edit-operation-handler.js +2 -1
- package/lib/common/gmodel/apply-label-edit-operation-handler.js.map +1 -1
- package/lib/common/gmodel/change-bounds-operation-handler.js +2 -1
- package/lib/common/gmodel/change-bounds-operation-handler.js.map +1 -1
- package/lib/common/gmodel/change-routing-points-operation-handler.js +2 -1
- package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -1
- package/lib/common/gmodel/cut-operation-handler.d.ts.map +1 -1
- package/lib/common/gmodel/cut-operation-handler.js +7 -4
- package/lib/common/gmodel/cut-operation-handler.js.map +1 -1
- package/lib/common/gmodel/delete-operation-handler.d.ts +1 -1
- package/lib/common/gmodel/delete-operation-handler.d.ts.map +1 -1
- package/lib/common/gmodel/delete-operation-handler.js +7 -6
- package/lib/common/gmodel/delete-operation-handler.js.map +1 -1
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts +3 -3
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts.map +1 -1
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.js +2 -1
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.js.map +1 -1
- package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts +3 -3
- package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts.map +1 -1
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js +2 -1
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -1
- package/lib/common/gmodel/gmodel-diagram-module.js +2 -1
- package/lib/common/gmodel/gmodel-diagram-module.js.map +1 -1
- package/lib/common/gmodel/paste-operation-handler.d.ts.map +1 -1
- package/lib/common/gmodel/paste-operation-handler.js +2 -1
- package/lib/common/gmodel/paste-operation-handler.js.map +1 -1
- package/lib/common/gmodel/reconnect-edge-operation-handler.js +2 -1
- package/lib/common/gmodel/reconnect-edge-operation-handler.js.map +1 -1
- package/lib/common/index.d.ts +3 -1
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +3 -1
- package/lib/common/index.js.map +1 -1
- package/lib/common/launch/glsp-server-launcher.js +2 -1
- package/lib/common/launch/glsp-server-launcher.js.map +1 -1
- package/lib/common/launch/jsonrpc-server-launcher.js +2 -1
- package/lib/common/launch/jsonrpc-server-launcher.js.map +1 -1
- package/lib/common/operations/compound-operation-handler.d.ts +5 -0
- package/lib/common/operations/compound-operation-handler.d.ts.map +1 -1
- package/lib/common/operations/compound-operation-handler.js +8 -2
- package/lib/common/operations/compound-operation-handler.js.map +1 -1
- package/lib/common/operations/create-operation-handler.d.ts +19 -5
- package/lib/common/operations/create-operation-handler.d.ts.map +1 -1
- package/lib/common/operations/create-operation-handler.js +2 -1
- package/lib/common/operations/create-operation-handler.js.map +1 -1
- package/lib/common/operations/json-operation-handler.d.ts +94 -0
- package/lib/common/operations/json-operation-handler.d.ts.map +1 -0
- package/lib/common/operations/json-operation-handler.js +120 -0
- package/lib/common/operations/json-operation-handler.js.map +1 -0
- package/lib/common/operations/operation-action-handler.d.ts.map +1 -1
- package/lib/common/operations/operation-action-handler.js +3 -2
- package/lib/common/operations/operation-action-handler.js.map +1 -1
- package/lib/common/operations/operation-handler-registry.d.ts +1 -9
- package/lib/common/operations/operation-handler-registry.d.ts.map +1 -1
- package/lib/common/operations/operation-handler-registry.js +4 -12
- package/lib/common/operations/operation-handler-registry.js.map +1 -1
- package/lib/common/operations/operation-handler.d.ts +2 -2
- package/lib/common/operations/operation-handler.d.ts.map +1 -1
- package/lib/common/operations/operation-handler.js +2 -1
- package/lib/common/operations/operation-handler.js.map +1 -1
- package/lib/common/protocol/client-action.d.ts +31 -0
- package/lib/common/protocol/client-action.d.ts.map +1 -0
- package/lib/common/protocol/client-action.js +35 -0
- package/lib/common/protocol/client-action.js.map +1 -0
- package/lib/common/protocol/glsp-server.d.ts +1 -1
- package/lib/common/protocol/glsp-server.d.ts.map +1 -1
- package/lib/common/protocol/glsp-server.js +9 -10
- package/lib/common/protocol/glsp-server.js.map +1 -1
- package/lib/common/session/client-session-factory.js +5 -4
- package/lib/common/session/client-session-factory.js.map +1 -1
- package/lib/common/session/client-session-manager.js +2 -1
- package/lib/common/session/client-session-manager.js.map +1 -1
- package/lib/common/utils/client-options-util.d.ts +3 -0
- package/lib/common/utils/client-options-util.d.ts.map +1 -1
- package/lib/common/utils/client-options-util.js +5 -15
- package/lib/common/utils/client-options-util.js.map +1 -1
- package/lib/common/utils/console-logger.js +2 -1
- package/lib/common/utils/console-logger.js.map +1 -1
- package/lib/common/utils/logger.js +2 -1
- package/lib/common/utils/logger.js.map +1 -1
- package/lib/common/utils/promise-queue.d.ts.map +1 -1
- package/lib/common/utils/promise-queue.js +3 -6
- package/lib/common/utils/promise-queue.js.map +1 -1
- package/lib/common/utils/registry.d.ts +3 -1
- package/lib/common/utils/registry.d.ts.map +1 -1
- package/lib/common/utils/registry.js +15 -4
- package/lib/common/utils/registry.js.map +1 -1
- package/lib/node/abstract-json-model-storage.d.ts.map +1 -1
- package/lib/node/abstract-json-model-storage.js +10 -3
- package/lib/node/abstract-json-model-storage.js.map +1 -1
- package/lib/node/gmodel/gmodel-storage.d.ts.map +1 -1
- package/lib/node/gmodel/gmodel-storage.js +4 -2
- package/lib/node/gmodel/gmodel-storage.js.map +1 -1
- package/lib/node/launch/cli-parser.js +1 -1
- package/lib/node/launch/cli-parser.js.map +1 -1
- package/lib/node/launch/socket-server-launcher.js +2 -1
- package/lib/node/launch/socket-server-launcher.js.map +1 -1
- package/lib/node/launch/websocket-server-launcher.js +2 -1
- package/lib/node/launch/websocket-server-launcher.js.map +1 -1
- package/package.json +4 -5
- package/src/common/actions/action-dispatcher.spec.ts +3 -2
- package/src/common/actions/action-dispatcher.ts +8 -5
- package/src/common/actions/client-action-handler.ts +28 -18
- package/src/common/actions/global-action-provider.spec.ts +4 -15
- package/src/common/actions/global-action-provider.ts +21 -25
- package/src/common/command/recording-command.spec.ts +15 -5
- package/src/common/command/recording-command.ts +16 -27
- package/src/common/di/client-session-module.ts +17 -10
- package/src/common/di/diagram-module.ts +31 -70
- package/src/common/di/server-module.ts +0 -1
- package/src/common/features/clipboard/request-clipboard-data-action-handler.ts +3 -3
- package/src/common/features/model/gmodel-serializer.ts +11 -11
- package/src/common/features/model/model-state.ts +3 -0
- package/src/common/features/model/model-submission-handler.ts +64 -7
- package/src/common/features/model/request-model-action-handler.ts +37 -17
- package/src/common/features/progress/progress-service.ts +74 -0
- package/src/common/features/type-hints/edge-creation-checker.ts +44 -0
- package/src/common/features/type-hints/request-check-edge-action-handler.ts +62 -0
- package/src/common/{diagram → features/type-hints}/request-type-hints-action-handler.spec.ts +2 -2
- package/src/common/{diagram → features/type-hints}/request-type-hints-action-handler.ts +2 -3
- package/src/common/features/validation/model-validator.ts +75 -3
- package/src/common/features/validation/request-markers-handler.ts +4 -10
- package/src/common/gmodel/cut-operation-handler.ts +5 -3
- package/src/common/gmodel/delete-operation-handler.ts +6 -5
- package/src/common/gmodel/gmodel-create-edge-operation-handler.ts +3 -3
- package/src/common/gmodel/gmodel-create-node-operation-handler.ts +3 -3
- package/src/common/gmodel/paste-operation-handler.ts +2 -2
- package/src/common/index.ts +3 -1
- package/src/common/operations/compound-operation-handler.ts +6 -1
- package/src/common/operations/create-operation-handler.ts +22 -5
- package/src/common/operations/json-operation-handler.ts +147 -0
- package/src/common/operations/operation-action-handler.ts +2 -2
- package/src/common/operations/operation-handler-registry.ts +1 -12
- package/src/common/operations/operation-handler.ts +2 -2
- package/src/common/protocol/client-action.ts +38 -0
- package/src/common/protocol/glsp-server.spec.ts +11 -10
- package/src/common/protocol/glsp-server.ts +11 -14
- package/src/common/session/client-session-factory.spec.ts +2 -2
- package/src/common/session/client-session-factory.ts +3 -3
- package/src/common/session/client-session-manager.spec.ts +4 -3
- package/src/common/utils/client-options-util.ts +8 -0
- package/src/common/utils/promise-queue.ts +4 -5
- package/src/common/utils/registry.spec.ts +3 -1
- package/src/common/utils/registry.ts +8 -3
- package/src/node/abstract-json-model-storage.ts +8 -2
- package/src/node/gmodel/gmodel-storage.ts +3 -3
- package/src/node/launch/cli-parser.ts +1 -1
- package/lib/common/diagram/request-type-hints-action-handler.d.ts.map +0 -1
- package/lib/common/diagram/request-type-hints-action-handler.js.map +0 -1
|
@@ -5,6 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
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;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
12
|
exports.MultiRegistry = exports.Registry = void 0;
|
|
10
13
|
/********************************************************************************
|
|
@@ -24,6 +27,7 @@ exports.MultiRegistry = exports.Registry = void 0;
|
|
|
24
27
|
********************************************************************************/
|
|
25
28
|
const array_util_1 = require("@eclipse-glsp/protocol/lib/utils/array-util");
|
|
26
29
|
const inversify_1 = require("inversify");
|
|
30
|
+
const logger_1 = require("./logger");
|
|
27
31
|
/**
|
|
28
32
|
* A registry manages a set of key-value pairs and provides query functionality. In GLSP this is typically used to
|
|
29
33
|
* provide a convenience API for working with multi-injected instances e.g. action handlers or
|
|
@@ -32,7 +36,7 @@ const inversify_1 = require("inversify");
|
|
|
32
36
|
* @typeParam K Key type
|
|
33
37
|
* @param V Value type
|
|
34
38
|
*/
|
|
35
|
-
let Registry =
|
|
39
|
+
let Registry = class Registry {
|
|
36
40
|
constructor() {
|
|
37
41
|
this.elements = new Map();
|
|
38
42
|
}
|
|
@@ -44,11 +48,12 @@ let Registry = exports.Registry = class Registry {
|
|
|
44
48
|
* @returns `true` if the pair was registered successfully, `false` if another pair with the same key is already
|
|
45
49
|
* registered.
|
|
46
50
|
*/
|
|
47
|
-
register(key,
|
|
51
|
+
register(key, value) {
|
|
48
52
|
if (!this.hasKey(key)) {
|
|
49
|
-
this.elements.set(key,
|
|
53
|
+
this.elements.set(key, value);
|
|
50
54
|
return true;
|
|
51
55
|
}
|
|
56
|
+
this.logger.warn('Could not register key-value pair. Key is already registered', { key, value });
|
|
52
57
|
return false;
|
|
53
58
|
}
|
|
54
59
|
/**
|
|
@@ -95,6 +100,11 @@ let Registry = exports.Registry = class Registry {
|
|
|
95
100
|
return [...new Set(this.elements.keys())];
|
|
96
101
|
}
|
|
97
102
|
};
|
|
103
|
+
exports.Registry = Registry;
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, inversify_1.inject)(logger_1.Logger),
|
|
106
|
+
__metadata("design:type", logger_1.Logger)
|
|
107
|
+
], Registry.prototype, "logger", void 0);
|
|
98
108
|
exports.Registry = Registry = __decorate([
|
|
99
109
|
(0, inversify_1.injectable)()
|
|
100
110
|
], Registry);
|
|
@@ -107,7 +117,7 @@ exports.Registry = Registry = __decorate([
|
|
|
107
117
|
* @typeParam K Type of the key
|
|
108
118
|
* @param V Type of the values
|
|
109
119
|
*/
|
|
110
|
-
let MultiRegistry =
|
|
120
|
+
let MultiRegistry = class MultiRegistry {
|
|
111
121
|
constructor() {
|
|
112
122
|
this.elements = new Map();
|
|
113
123
|
}
|
|
@@ -152,6 +162,7 @@ let MultiRegistry = exports.MultiRegistry = class MultiRegistry {
|
|
|
152
162
|
return [...new Set(this.elements.keys())];
|
|
153
163
|
}
|
|
154
164
|
};
|
|
165
|
+
exports.MultiRegistry = MultiRegistry;
|
|
155
166
|
exports.MultiRegistry = MultiRegistry = __decorate([
|
|
156
167
|
(0, inversify_1.injectable)()
|
|
157
168
|
], MultiRegistry);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/common/utils/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/common/utils/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,4EAAqE;AACrE,yCAA+C;AAC/C,qCAAkC;AAElC;;;;;;;GAOG;AAGI,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAAd;QAIO,aAAQ,GAAc,IAAI,GAAG,EAAE,CAAC;IAkE9C,CAAC;IAjEG;;;;;;;OAOG;IACH,QAAQ,CAAC,GAAM,EAAE,KAAQ;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YACnB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC9B,OAAO,IAAI,CAAC;SACf;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,8DAA8D,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;QACjG,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;OAKG;IACH,UAAU,CAAC,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/abstract-json-model-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"abstract-json-model-storage.d.ts","sourceRoot":"","sources":["../../src/node/abstract-json-model-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKtG,OAAO,EAAE,UAAU,EAAkB,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAGnF;;;GAGG;AACH,8BACsB,wBAAyB,YAAW,kBAAkB;IAExE,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAEjC,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CAAC,IAAI,CAAC;IAExE,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC;IAErE,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM;IAQ1D,SAAS,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAClD,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;IAoBpE;;;;;;OAMG;IACH,SAAS,CAAC,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAIpE,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAYrD,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAI9C,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAS3C,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM;IAQrD,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAM1D,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;CAG7C"}
|
|
@@ -10,8 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.AbstractJsonModelStorage = void 0;
|
|
13
|
-
const fs = require("fs
|
|
13
|
+
const fs = require("fs");
|
|
14
14
|
const inversify_1 = require("inversify");
|
|
15
|
+
const os = require("os");
|
|
15
16
|
const url_1 = require("url");
|
|
16
17
|
const model_state_1 = require("../common/features/model/model-state");
|
|
17
18
|
const glsp_server_error_1 = require("../common/utils/glsp-server-error");
|
|
@@ -19,7 +20,7 @@ const glsp_server_error_1 = require("../common/utils/glsp-server-error");
|
|
|
19
20
|
* An abstract implementation of {@link SourceModelStorage} that provides utility methods for loading and saving JSON source models
|
|
20
21
|
* from/into a file.
|
|
21
22
|
*/
|
|
22
|
-
let AbstractJsonModelStorage =
|
|
23
|
+
let AbstractJsonModelStorage = class AbstractJsonModelStorage {
|
|
23
24
|
getSourceUri(action) {
|
|
24
25
|
var _a;
|
|
25
26
|
const sourceUri = (_a = action.options) === null || _a === void 0 ? void 0 : _a[model_state_1.SOURCE_URI_ARG];
|
|
@@ -73,7 +74,12 @@ let AbstractJsonModelStorage = exports.AbstractJsonModelStorage = class Abstract
|
|
|
73
74
|
return JSON.parse(fileContent);
|
|
74
75
|
}
|
|
75
76
|
toPath(sourceUri) {
|
|
76
|
-
|
|
77
|
+
let path = sourceUri.startsWith('file://') ? (0, url_1.fileURLToPath)(sourceUri) : sourceUri;
|
|
78
|
+
if (os.platform() === 'win32') {
|
|
79
|
+
// Remove the leading slash if it exists (Windows paths don't have it)
|
|
80
|
+
path = path.replace(/^\//, '');
|
|
81
|
+
}
|
|
82
|
+
return path;
|
|
77
83
|
}
|
|
78
84
|
getFileUri(action) {
|
|
79
85
|
var _a;
|
|
@@ -92,6 +98,7 @@ let AbstractJsonModelStorage = exports.AbstractJsonModelStorage = class Abstract
|
|
|
92
98
|
return JSON.stringify(model, undefined, 2);
|
|
93
99
|
}
|
|
94
100
|
};
|
|
101
|
+
exports.AbstractJsonModelStorage = AbstractJsonModelStorage;
|
|
95
102
|
__decorate([
|
|
96
103
|
(0, inversify_1.inject)(model_state_1.ModelState),
|
|
97
104
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-json-model-storage.js","sourceRoot":"","sources":["../../src/node/abstract-json-model-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA
|
|
1
|
+
{"version":3,"file":"abstract-json-model-storage.js","sourceRoot":"","sources":["../../src/node/abstract-json-model-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,yBAAyB;AACzB,yCAA+C;AAC/C,yBAAyB;AACzB,6BAAoC;AACpC,sEAAkF;AAElF,yEAAoE;AAEpE;;;GAGG;AAEI,IAAe,wBAAwB,GAAvC,MAAe,wBAAwB;IAQhC,YAAY,CAAC,MAA0B;;QAC7C,MAAM,SAAS,GAAG,MAAA,MAAM,CAAC,OAAO,0CAAG,4BAAc,CAAC,CAAC;QACnD,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;YAC/B,MAAM,IAAI,mCAAe,CAAC,0DAA0D,4BAAc,GAAG,CAAC,CAAC;SAC1G;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAIS,YAAY,CAAI,SAAiB,EAAE,KAAoB;QAC7D,IAAI;YACA,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACpC,IAAI,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CA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IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,EAAE;YAC3B,sEAAsE;YACtE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;SAClC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAES,UAAU,CAAC,MAAuB;;QACxC,MAAM,GAAG,GAAG,MAAA,MAAM,CAAC,OAAO,mCAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,4BAAc,CAAC,CAAC;QAClE,IAAI,CAAC,GAAG,EAAE;YACN,MAAM,IAAI,mCAAe,CAAC,8DAA8D,CAAC,CAAC;SAC7F;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IAES,SAAS,CAAC,OAAe,EAAE,KAAc;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACrC,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAES,QAAQ,CAAC,KAAc;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC;CACJ,CAAA;AA1FqB,4DAAwB;AAEhC;IADT,IAAA,kBAAM,EAAC,wBAAU,CAAC;;4DACc;mCAFf,wBAAwB;IAD7C,IAAA,sBAAU,GAAE;GACS,wBAAwB,CA0F7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmodel-storage.d.ts","sourceRoot":"","sources":["../../../src/node/gmodel/gmodel-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"gmodel-storage.d.ts","sourceRoot":"","sources":["../../../src/node/gmodel/gmodel-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAyB,MAAM,wBAAwB,CAAC;AAElH,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,UAAU,QAAuC,CAAC;AAE/D;;;GAGG;AACH,qBACa,aAAc,SAAQ,wBAAwB;IAEvD,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAGzB,SAAS,CAAC,eAAe,EAAE,gBAAgB,CAAC;IAE5C,UACmB,UAAU,EAAE,UAAU,CAAC;IAE1C,eAAe,CAAC,MAAM,EAAE,kBAAkB,GAAG,YAAY,CAAC,IAAI,CAAC;IAO/D,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC;CAK/D"}
|
|
@@ -26,6 +26,7 @@ exports.GModelStorage = exports.EMPTY_ROOT = void 0;
|
|
|
26
26
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
27
27
|
********************************************************************************/
|
|
28
28
|
const graph_1 = require("@eclipse-glsp/graph");
|
|
29
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
29
30
|
const inversify_1 = require("inversify");
|
|
30
31
|
const gmodel_serializer_1 = require("../../common/features/model/gmodel-serializer");
|
|
31
32
|
const model_state_1 = require("../../common/features/model/model-state");
|
|
@@ -36,10 +37,10 @@ exports.EMPTY_ROOT = graph_1.GGraph.builder().id('empty').build();
|
|
|
36
37
|
* A {@link SourceModelStorage} that reads and writes the graph model directly from / into
|
|
37
38
|
* a JSON file and uses it as source model.
|
|
38
39
|
*/
|
|
39
|
-
let GModelStorage =
|
|
40
|
+
let GModelStorage = class GModelStorage extends abstract_json_model_storage_1.AbstractJsonModelStorage {
|
|
40
41
|
loadSourceModel(action) {
|
|
41
42
|
const sourceUri = this.getSourceUri(action);
|
|
42
|
-
const rootSchema = this.loadFromFile(sourceUri,
|
|
43
|
+
const rootSchema = this.loadFromFile(sourceUri, protocol_1.isGModelElementSchema);
|
|
43
44
|
const root = this.modelSerializer.createRoot(rootSchema);
|
|
44
45
|
this.modelState.updateRoot(root);
|
|
45
46
|
}
|
|
@@ -49,6 +50,7 @@ let GModelStorage = exports.GModelStorage = class GModelStorage extends abstract
|
|
|
49
50
|
this.writeFile(fileUri, schema);
|
|
50
51
|
}
|
|
51
52
|
};
|
|
53
|
+
exports.GModelStorage = GModelStorage;
|
|
52
54
|
__decorate([
|
|
53
55
|
(0, inversify_1.inject)(logger_1.Logger),
|
|
54
56
|
__metadata("design:type", logger_1.Logger)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmodel-storage.js","sourceRoot":"","sources":["../../../src/node/gmodel/gmodel-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+
|
|
1
|
+
{"version":3,"file":"gmodel-storage.js","sourceRoot":"","sources":["../../../src/node/gmodel/gmodel-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+CAA6C;AAC7C,qDAAkH;AAClH,yCAA+C;AAC/C,qFAAiF;AACjF,yEAAqE;AACrE,sDAAmD;AACnD,gFAA0E;AAE7D,QAAA,UAAU,GAAG,cAAM,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;AAE/D;;;GAGG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,sDAAwB;IAUvD,eAAe,CAAC,MAA0B;QACtC,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,gCAAqB,CAAC,CAAC;QACvE,MAAM,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACzD,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,eAAe,CAAC,MAAuB;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;CACJ,CAAA;AAtBY,sCAAa;AAEZ;IADT,IAAA,kBAAM,EAAC,eAAM,CAAC;8BACG,eAAM;6CAAC;AAGf;IADT,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;sDACmB;AAGzB;IADlB,IAAA,kBAAM,EAAC,wBAAU,CAAC;;iDACuB;wBARjC,aAAa;IADzB,IAAA,sBAAU,GAAE;GACA,aAAa,CAsBzB"}
|
|
@@ -17,7 +17,7 @@ exports.isDirectory = exports.processLogDir = exports.processLogLevel = exports.
|
|
|
17
17
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
18
|
********************************************************************************/
|
|
19
19
|
const cmd = require("commander");
|
|
20
|
-
const fs = require("fs
|
|
20
|
+
const fs = require("fs");
|
|
21
21
|
const path = require("path");
|
|
22
22
|
const logger_1 = require("../../common/utils/logger");
|
|
23
23
|
exports.defaultLaunchOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-parser.js","sourceRoot":"","sources":["../../../src/node/launch/cli-parser.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iCA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,mBAAU,EAAC,KAAK,CAAC,CAAC;IAChC,IAAI,CAAC,KAAK,EAAE;QACR,MAAM,IAAI,GAAG,CAAC,oBAAoB,CAAC,0DAA0D,CAAC,CAAC;KAClG;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAND,0CAMC;AAED,SAAgB,aAAa,CAAC,KAAa;IACvC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE;QACzE,MAAM,IAAI,GAAG,CAAC,oBAAoB,CAAC,oCAAoC,CAAC,CAAC;KAC5E;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAPD,sCAOC;AAED,SAAgB,WAAW,CAAC,KAAa;IACrC,IAAI;QACA,OAAO,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;KAC3C;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,KAAK,CAAC;KAChB;AACL,CAAC;AAND,kCAMC"}
|
|
@@ -32,7 +32,7 @@ const jsonrpc = require("vscode-jsonrpc/node");
|
|
|
32
32
|
const jsonrpc_server_launcher_1 = require("../../common/launch/jsonrpc-server-launcher");
|
|
33
33
|
const logger_1 = require("../../common/utils/logger");
|
|
34
34
|
exports.START_UP_COMPLETE_MSG = '[GLSP-Server]:Startup completed. Accepting requests on port:';
|
|
35
|
-
let SocketServerLauncher =
|
|
35
|
+
let SocketServerLauncher = class SocketServerLauncher extends jsonrpc_server_launcher_1.JsonRpcGLSPServerLauncher {
|
|
36
36
|
constructor() {
|
|
37
37
|
super();
|
|
38
38
|
this.toDispose.push(protocol_1.Disposable.create(() => {
|
|
@@ -73,6 +73,7 @@ let SocketServerLauncher = exports.SocketServerLauncher = class SocketServerLaun
|
|
|
73
73
|
return jsonrpc.createMessageConnection(new jsonrpc.SocketMessageReader(socket), new jsonrpc.SocketMessageWriter(socket), console);
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
+
exports.SocketServerLauncher = SocketServerLauncher;
|
|
76
77
|
__decorate([
|
|
77
78
|
(0, inversify_1.inject)(logger_1.Logger),
|
|
78
79
|
__metadata("design:type", logger_1.Logger)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket-server-launcher.js","sourceRoot":"","sources":["../../../src/node/launch/socket-server-launcher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAoD;AACpD,yCAA+C;AAC/C,2BAA2B;AAC3B,+CAA+C;AAC/C,yFAAwF;AACxF,sDAAmD;AAEtC,QAAA,qBAAqB,GAAG,8DAA8D,CAAC;AAG7F,IAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"socket-server-launcher.js","sourceRoot":"","sources":["../../../src/node/launch/socket-server-launcher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAoD;AACpD,yCAA+C;AAC/C,2BAA2B;AAC3B,+CAA+C;AAC/C,yFAAwF;AACxF,sDAAmD;AAEtC,QAAA,qBAAqB,GAAG,8DAA8D,CAAC;AAG7F,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,mDAAmD;IAKzF;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,CAAC,IAAI,CACf,qBAAU,CAAC,MAAM,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QAC3B,CAAC,CAAC,CACL,CAAC;IACN,CAAC;IAES,GAAG,CAAC,IAA8B;QACxC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;YACvC,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;YAC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C,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACP,CAAC;IAES,gBAAgB,CAAC,MAAkB;QACzC,OAAO,OAAO,CAAC,uBAAuB,CAAC,IAAI,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,IAAI,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IACtI,CAAC;CACJ,CAAA;AAhDY,oDAAoB;AACM;IAAlC,IAAA,kBAAM,EAAC,eAAM,CAAC;8BAA4B,eAAM;oDAAC;+BADzC,oBAAoB;IADhC,IAAA,sBAAU,GAAE;;GACA,oBAAoB,CAgDhC"}
|
|
@@ -33,7 +33,7 @@ const ws_1 = require("ws");
|
|
|
33
33
|
const jsonrpc_server_launcher_1 = require("../../common/launch/jsonrpc-server-launcher");
|
|
34
34
|
const logger_1 = require("../../common/utils/logger");
|
|
35
35
|
const STATUS_UPGRADE_REQUIRED = 426;
|
|
36
|
-
let WebSocketServerLauncher =
|
|
36
|
+
let WebSocketServerLauncher = class WebSocketServerLauncher extends jsonrpc_server_launcher_1.JsonRpcGLSPServerLauncher {
|
|
37
37
|
constructor() {
|
|
38
38
|
super();
|
|
39
39
|
this.toDispose.push(protocol_1.Disposable.create(() => {
|
|
@@ -82,6 +82,7 @@ let WebSocketServerLauncher = exports.WebSocketServerLauncher = class WebSocketS
|
|
|
82
82
|
super.start(options);
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
+
exports.WebSocketServerLauncher = WebSocketServerLauncher;
|
|
85
86
|
__decorate([
|
|
86
87
|
(0, inversify_1.inject)(logger_1.Logger),
|
|
87
88
|
__metadata("design:type", logger_1.Logger)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket-server-launcher.js","sourceRoot":"","sources":["../../../src/node/launch/websocket-server-launcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,qDAA+G;AAC/G,6BAA6B;AAC7B,yCAA+C;AAC/C,2BAA2B;AAE3B,2BAAuC;AACvC,yFAAwF;AACxF,sDAAmD;AAoBnD,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAG7B,IAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"websocket-server-launcher.js","sourceRoot":"","sources":["../../../src/node/launch/websocket-server-launcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,qDAA+G;AAC/G,6BAA6B;AAC7B,yCAA+C;AAC/C,2BAA2B;AAE3B,2BAAuC;AACvC,yFAAwF;AACxF,sDAAmD;AAoBnD,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAG7B,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,mDAAiD;IAM1F;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,CAAC,IAAI,CACf,qBAAU,CAAC,MAAM,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC,CAAC,CACL,CAAC;IACN,CAAC;IAES,KAAK,CAAC,GAAG,CAAC,OAA+B;QAC/C,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC3D,IAAI,CAAC,MAAM,GAAG,IAAI,WAAM,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;QACzF,MAAM,QAAQ,GAAG,QAAQ,eAAe,CAAC,IAAI,IAAI,eAAe,CAAC,IAAI,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC;QAChG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mFAAmF,QAAQ,GAAG,CAAC,CAAC;QACjH,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAA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C;gBAC9D,OAAO;aACV;YACD,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AACD;;;GAGG;AACH,SAAgB,aAAa,CAAC,MAAiB;IAC3C,OAAO;QACH,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACrC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC;QACzC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QACrC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;KAChC,CAAC;AACN,CAAC;AARD,sCAQC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/server",
|
|
3
|
-
"version": "1.1.0-
|
|
3
|
+
"version": "1.1.0-next.231d53b.69+231d53b",
|
|
4
4
|
"description": "A js server framework for Eclipse GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"watch": "tsc -w"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@eclipse-glsp/graph": "1.1.0-
|
|
63
|
-
"@eclipse-glsp/protocol": "
|
|
62
|
+
"@eclipse-glsp/graph": "1.1.0-next.231d53b.69+231d53b",
|
|
63
|
+
"@eclipse-glsp/protocol": "next",
|
|
64
64
|
"@types/uuid": "8.3.1",
|
|
65
65
|
"commander": "^8.3.0",
|
|
66
66
|
"fast-json-patch": "^3.1.0",
|
|
@@ -68,7 +68,6 @@
|
|
|
68
68
|
"ws": "^8.12.1"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@types/fs-extra": "^9.0.13",
|
|
72
71
|
"@types/ws": "^8.5.4"
|
|
73
72
|
},
|
|
74
73
|
"peerDependencies": {
|
|
@@ -77,5 +76,5 @@
|
|
|
77
76
|
"publishConfig": {
|
|
78
77
|
"access": "public"
|
|
79
78
|
},
|
|
80
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "231d53bfe5d4720f834dcc68bbdbb5b2a639f243"
|
|
81
80
|
}
|
|
@@ -24,7 +24,7 @@ import { Logger } from '../utils/logger';
|
|
|
24
24
|
import { DefaultActionDispatcher } from './action-dispatcher';
|
|
25
25
|
import { ActionHandler } from './action-handler';
|
|
26
26
|
import { ActionHandlerRegistry } from './action-handler-registry';
|
|
27
|
-
import
|
|
27
|
+
import { ClientActionForwarder } from './client-action-handler';
|
|
28
28
|
|
|
29
29
|
function waitSync(timeInMillis: number): void {
|
|
30
30
|
const start = Date.now();
|
|
@@ -48,6 +48,7 @@ describe('test DefaultActionDispatcher', () => {
|
|
|
48
48
|
bind(ClientId).toConstantValue(clientId);
|
|
49
49
|
bind(ActionHandlerRegistry).toConstantValue(actionHandlerRegistry);
|
|
50
50
|
bind(ClientActionKinds).toConstantValue(['response', 'response1', 'response2']);
|
|
51
|
+
bind(ClientActionForwarder).toConstantValue(sinon.createStubInstance(ClientActionForwarder));
|
|
51
52
|
})
|
|
52
53
|
);
|
|
53
54
|
const actionDispatcher = container.resolve(DefaultActionDispatcher);
|
|
@@ -62,7 +63,7 @@ describe('test DefaultActionDispatcher', () => {
|
|
|
62
63
|
|
|
63
64
|
describe('test with one-way actions (no response actions)', () => {
|
|
64
65
|
it('dispatch- unhandled action', async () => {
|
|
65
|
-
|
|
66
|
+
mock.expectToThrowAsync(() => actionDispatcher.dispatch({ kind: 'unhandled' }));
|
|
66
67
|
});
|
|
67
68
|
|
|
68
69
|
it('dispatch - one action', async () => {
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { Action, Disposable, flatPush, MaybeArray, RequestAction, ResponseAction, UpdateModelAction } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { inject, injectable } from 'inversify';
|
|
18
|
-
import {
|
|
18
|
+
import { ClientId } from '../di/service-identifiers';
|
|
19
19
|
import { GLSPServerError } from '../utils/glsp-server-error';
|
|
20
20
|
import { Logger } from '../utils/logger';
|
|
21
21
|
import { PromiseQueue } from '../utils/promise-queue';
|
|
22
22
|
import { ActionHandler } from './action-handler';
|
|
23
23
|
import { ActionHandlerRegistry } from './action-handler-registry';
|
|
24
|
+
import { ClientActionForwarder } from './client-action-handler';
|
|
24
25
|
|
|
25
26
|
export const ActionDispatcher = Symbol('ActionDispatcher');
|
|
26
27
|
|
|
@@ -62,8 +63,8 @@ export class DefaultActionDispatcher implements ActionDispatcher, Disposable {
|
|
|
62
63
|
@inject(ActionHandlerRegistry)
|
|
63
64
|
protected actionHandlerRegistry: ActionHandlerRegistry;
|
|
64
65
|
|
|
65
|
-
@inject(
|
|
66
|
-
protected
|
|
66
|
+
@inject(ClientActionForwarder)
|
|
67
|
+
protected clientActionForwarder: ClientActionForwarder;
|
|
67
68
|
|
|
68
69
|
@inject(Logger)
|
|
69
70
|
private logger: Logger;
|
|
@@ -76,7 +77,7 @@ export class DefaultActionDispatcher implements ActionDispatcher, Disposable {
|
|
|
76
77
|
|
|
77
78
|
dispatch(action: Action): Promise<void> {
|
|
78
79
|
// Dont queue actions that are just delegated to the client
|
|
79
|
-
if (this.
|
|
80
|
+
if (this.clientActionForwarder.shouldForwardToClient(action)) {
|
|
80
81
|
return this.doDispatch(action);
|
|
81
82
|
}
|
|
82
83
|
return this.actionQueue.enqueue(() => this.doDispatch(action));
|
|
@@ -84,8 +85,10 @@ export class DefaultActionDispatcher implements ActionDispatcher, Disposable {
|
|
|
84
85
|
|
|
85
86
|
protected async doDispatch(action: Action): Promise<void> {
|
|
86
87
|
this.logger.debug('Dispatch action:', action.kind);
|
|
88
|
+
const handledOnClient = this.clientActionForwarder.handle(action);
|
|
89
|
+
|
|
87
90
|
const actionHandlers = this.actionHandlerRegistry.get(action.kind);
|
|
88
|
-
if (actionHandlers.length === 0) {
|
|
91
|
+
if (!handledOnClient && actionHandlers.length === 0) {
|
|
89
92
|
throw new GLSPServerError(`No handler registered for action kind: ${action.kind}`);
|
|
90
93
|
}
|
|
91
94
|
|
|
@@ -13,37 +13,47 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Action, ActionMessage, GLSPClientProxy } from '@eclipse-glsp/protocol';
|
|
17
|
-
import { inject, injectable
|
|
16
|
+
import { Action, ActionMessage, GLSPClientProxy, ResponseAction } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { inject, injectable } from 'inversify';
|
|
18
18
|
import { ClientActionKinds, ClientId } from '../di/service-identifiers';
|
|
19
|
+
import { ClientAction } from '../protocol/client-action';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
22
|
+
* Component responsible for forwarding actions that are (also) handled by the
|
|
23
|
+
* client
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
25
|
@injectable()
|
|
26
|
-
export class
|
|
26
|
+
export class ClientActionForwarder {
|
|
27
27
|
@inject(GLSPClientProxy)
|
|
28
|
-
|
|
29
|
-
protected glspClient?: GLSPClientProxy;
|
|
28
|
+
protected glspClient: GLSPClientProxy;
|
|
30
29
|
|
|
31
30
|
@inject(ClientId)
|
|
32
31
|
protected readonly clientId: string;
|
|
33
32
|
|
|
34
|
-
constructor(@inject(ClientActionKinds)
|
|
33
|
+
constructor(@inject(ClientActionKinds) public actionKinds: Set<string>) {}
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Processes the given action and checks wether it is a
|
|
37
|
+
* `clientAction` i.e. an action that should be forwarded to
|
|
38
|
+
* the client to be handled there. If the check is successful
|
|
39
|
+
* the action is wrapped in an {@link ActionMessage} and sent to the client.
|
|
40
|
+
*
|
|
41
|
+
* @param action The action to check and forward
|
|
42
|
+
* @return `true` if the action was forwarded to the client, `false` otherwise
|
|
43
|
+
*/
|
|
44
|
+
handle(action: Action): boolean {
|
|
45
|
+
if (this.shouldForwardToClient(action)) {
|
|
46
|
+
const message: ActionMessage = { action, clientId: this.clientId };
|
|
47
|
+
this.glspClient.process(message);
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
39
51
|
}
|
|
40
52
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.glspClient.process(message);
|
|
45
|
-
return;
|
|
53
|
+
shouldForwardToClient(action: Action): boolean {
|
|
54
|
+
if (ClientAction.is(action)) {
|
|
55
|
+
return false;
|
|
46
56
|
}
|
|
47
|
-
|
|
57
|
+
return this.actionKinds.has(action.kind) || ResponseAction.is(action);
|
|
48
58
|
}
|
|
49
59
|
}
|
|
@@ -13,21 +13,20 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
+
import { expect } from 'chai';
|
|
16
17
|
import { Container, ContainerModule } from 'inversify';
|
|
17
|
-
import
|
|
18
|
+
import * as sinon from 'sinon';
|
|
19
|
+
import { DiagramModules, InjectionContainer } from '../di/service-identifiers';
|
|
18
20
|
import { ClientSessionInitializer } from '../session/client-session-initializer';
|
|
19
21
|
import * as mock from '../test/mock-util';
|
|
20
22
|
import { Logger } from '../utils/logger';
|
|
21
23
|
import { ActionHandler } from './action-handler';
|
|
22
24
|
import { ActionHandlerRegistry } from './action-handler-registry';
|
|
23
25
|
import { DefaultGlobalActionProvider } from './global-action-provider';
|
|
24
|
-
import * as sinon from 'sinon';
|
|
25
|
-
import { expect } from 'chai';
|
|
26
26
|
|
|
27
27
|
describe('test DefaultGlobalActionProvider', () => {
|
|
28
28
|
const container = new Container();
|
|
29
29
|
const serverActions = ['A1', 'A2', 'A3'];
|
|
30
|
-
const clientActions = ['C1', 'C2'];
|
|
31
30
|
const diagramType = 'myDiagramType';
|
|
32
31
|
|
|
33
32
|
const handler1Actions = ['A1', 'A2'];
|
|
@@ -44,8 +43,6 @@ describe('test DefaultGlobalActionProvider', () => {
|
|
|
44
43
|
bind(ActionHandler).toConstantValue(new mock.StubActionHandler(handler1Actions));
|
|
45
44
|
bind(ActionHandler).toConstantValue(new mock.StubActionHandler(handler2Actions));
|
|
46
45
|
bind(ActionHandlerRegistry).toConstantValue(handlerRegistry);
|
|
47
|
-
bind(ClientActionKinds).toConstantValue(clientActions[0]);
|
|
48
|
-
bind(ClientActionKinds).toConstantValue(clientActions[1]);
|
|
49
46
|
});
|
|
50
47
|
|
|
51
48
|
const diagramModules = new Map<string, ContainerModule[]>();
|
|
@@ -62,18 +59,10 @@ describe('test DefaultGlobalActionProvider', () => {
|
|
|
62
59
|
const actionProvider = container.resolve(DefaultGlobalActionProvider);
|
|
63
60
|
|
|
64
61
|
it('serverActionsKinds', () => {
|
|
65
|
-
const result = actionProvider.
|
|
62
|
+
const result = actionProvider.actionKinds;
|
|
66
63
|
expect(result.size).to.be.equal(1);
|
|
67
64
|
const resultServerActions = result.get(diagramType);
|
|
68
65
|
expect(resultServerActions).to.not.be.undefined;
|
|
69
66
|
expect(serverActions.every(action => resultServerActions!.includes(action))).true;
|
|
70
67
|
});
|
|
71
|
-
|
|
72
|
-
it('clientActionKinds', () => {
|
|
73
|
-
const result = actionProvider.clientActionKinds;
|
|
74
|
-
expect(result.size).to.be.equal(1);
|
|
75
|
-
const resultClientActions = result.get(diagramType);
|
|
76
|
-
expect(resultClientActions).to.not.be.undefined;
|
|
77
|
-
expect(clientActions.every(action => resultClientActions!.includes(action))).true;
|
|
78
|
-
});
|
|
79
68
|
});
|
|
@@ -13,60 +13,56 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
+
import { distinctAdd } from '@eclipse-glsp/protocol';
|
|
16
17
|
import { Container, ContainerModule, inject, injectable } from 'inversify';
|
|
17
|
-
import {
|
|
18
|
+
import { createClientSessionModule } from '../di/client-session-module';
|
|
19
|
+
import { DiagramModules, InjectionContainer } from '../di/service-identifiers';
|
|
18
20
|
import { ClientSessionInitializer } from '../session/client-session-initializer';
|
|
19
21
|
import { ActionHandlerRegistry } from './action-handler-registry';
|
|
20
|
-
import { ClientActionHandler } from './client-action-handler';
|
|
21
22
|
|
|
22
23
|
export const GlobalActionProvider = Symbol('GlobalActionProvider');
|
|
23
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Provides a map of handled action kinds grouped by `diagramType`
|
|
27
|
+
*/
|
|
24
28
|
export interface GlobalActionProvider {
|
|
25
|
-
readonly
|
|
26
|
-
readonly clientActionKinds: Map<string, string[]>;
|
|
29
|
+
readonly actionKinds: Map<string, string[]>;
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
@injectable()
|
|
30
33
|
export class DefaultGlobalActionProvider implements GlobalActionProvider {
|
|
31
|
-
public readonly
|
|
32
|
-
public readonly clientActionKinds: Map<string, string[]>;
|
|
34
|
+
public readonly actionKinds: Map<string, string[]>;
|
|
33
35
|
|
|
34
36
|
constructor(
|
|
35
37
|
@inject(InjectionContainer) serverContainer: Container,
|
|
36
38
|
@inject(DiagramModules) diagramModules: Map<string, ContainerModule[]>
|
|
37
39
|
) {
|
|
38
|
-
this.
|
|
39
|
-
this.clientActionKinds = new Map();
|
|
40
|
+
this.actionKinds = new Map();
|
|
40
41
|
diagramModules.forEach((modules, diagramType) => {
|
|
41
42
|
const container = this.createDiagramContainer(serverContainer, modules);
|
|
42
43
|
const initializers = container.getAll<ClientSessionInitializer>(ClientSessionInitializer);
|
|
43
44
|
initializers.forEach(service => service.initialize());
|
|
44
|
-
this.
|
|
45
|
-
this.loadClientActionKinds(diagramType, container);
|
|
45
|
+
this.loadActionKinds(diagramType, container);
|
|
46
46
|
container.unbindAll();
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
createDiagramContainer(serverContainer: Container, modules: ContainerModule[]): Container {
|
|
51
51
|
const container = serverContainer.createChild();
|
|
52
|
-
|
|
52
|
+
const clientSessionModule = createClientSessionModule({
|
|
53
|
+
clientId: 'tempId',
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
55
|
+
glspClient: { process: () => {} },
|
|
56
|
+
clientActionKinds: []
|
|
57
|
+
});
|
|
58
|
+
container.load(...modules, clientSessionModule);
|
|
53
59
|
return container;
|
|
54
60
|
}
|
|
55
61
|
|
|
56
|
-
|
|
62
|
+
loadActionKinds(diagramType: string, diagramContainer: Container): void {
|
|
57
63
|
const handlerRegistry = diagramContainer.get<ActionHandlerRegistry>(ActionHandlerRegistry);
|
|
58
|
-
const diagramServerActions = this.
|
|
59
|
-
handlerRegistry
|
|
60
|
-
|
|
61
|
-
.filter(handler => !(handler instanceof ClientActionHandler))
|
|
62
|
-
.forEach(handler => diagramServerActions.push(...handler.actionKinds));
|
|
63
|
-
this.serverActionKinds.set(diagramType, [...new Set(diagramServerActions)]);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
loadClientActionKinds(diagramType: string, diagramContainer: Container): void {
|
|
67
|
-
const clientActionKinds = diagramContainer.getAll<string>(ClientActionKinds);
|
|
68
|
-
const diagramClientActions = this.clientActionKinds.get(diagramType) ?? [];
|
|
69
|
-
diagramClientActions.push(...clientActionKinds);
|
|
70
|
-
this.clientActionKinds.set(diagramType, diagramClientActions);
|
|
64
|
+
const diagramServerActions = this.actionKinds.get(diagramType) ?? [];
|
|
65
|
+
handlerRegistry.getAll().forEach(handler => distinctAdd(diagramServerActions, ...handler.actionKinds));
|
|
66
|
+
this.actionKinds.set(diagramType, diagramServerActions);
|
|
71
67
|
}
|
|
72
68
|
}
|