@eclipse-glsp/server 2.8.0-next.3 → 2.8.0-next.6
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 +3 -5
- package/lib/browser/launch/worker-server-launcher.js.map +1 -1
- package/lib/common/actions/action-dispatcher.js +5 -8
- package/lib/common/actions/action-dispatcher.js.map +1 -1
- package/lib/common/actions/action-handler-registry.js +1 -1
- package/lib/common/actions/action-handler-registry.js.map +1 -1
- package/lib/common/actions/global-action-provider.js +1 -2
- package/lib/common/actions/global-action-provider.js.map +1 -1
- package/lib/common/command/command.js +1 -2
- package/lib/common/command/command.js.map +1 -1
- package/lib/common/command/recording-command.js +3 -6
- package/lib/common/command/recording-command.js.map +1 -1
- package/lib/common/di/diagram-module.js +5 -6
- package/lib/common/di/diagram-module.js.map +1 -1
- package/lib/common/di/glsp-module.js +1 -1
- package/lib/common/di/glsp-module.js.map +1 -1
- package/lib/common/di/server-module.js +1 -1
- package/lib/common/di/server-module.js.map +1 -1
- package/lib/common/features/directediting/context-edit-validator.js +3 -3
- package/lib/common/features/directediting/context-edit-validator.js.map +1 -1
- package/lib/common/features/directediting/label-edit-validator.js +1 -1
- package/lib/common/features/directediting/label-edit-validator.js.map +1 -1
- package/lib/common/features/layout/computed-bounds-action-handler.js +2 -3
- package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -1
- package/lib/common/features/layout/layout-operation-handler.js +1 -2
- package/lib/common/features/layout/layout-operation-handler.js.map +1 -1
- package/lib/common/features/model/gmodel-index.js +3 -5
- package/lib/common/features/model/gmodel-index.js.map +1 -1
- package/lib/common/features/model/gmodel-serializer.js +1 -2
- package/lib/common/features/model/gmodel-serializer.js.map +1 -1
- package/lib/common/features/model/model-submission-handler.d.ts +1 -2
- package/lib/common/features/model/model-submission-handler.d.ts.map +1 -1
- package/lib/common/features/model/model-submission-handler.js +3 -6
- package/lib/common/features/model/model-submission-handler.js.map +1 -1
- package/lib/common/features/model/request-model-action-handler.js +4 -6
- package/lib/common/features/model/request-model-action-handler.js.map +1 -1
- package/lib/common/features/navigation/navigation-target-resolution.js +1 -1
- package/lib/common/features/navigation/navigation-target-resolution.js.map +1 -1
- package/lib/common/features/progress/progress-service.d.ts.map +1 -1
- package/lib/common/features/progress/progress-service.js +1 -2
- package/lib/common/features/progress/progress-service.js.map +1 -1
- package/lib/common/features/validation/request-markers-handler.js +1 -2
- package/lib/common/features/validation/request-markers-handler.js.map +1 -1
- package/lib/common/gmodel/change-routing-points-operation-handler.js +1 -2
- package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -1
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js +3 -5
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -1
- package/lib/common/gmodel/paste-operation-handler.d.ts +1 -1
- package/lib/common/gmodel/paste-operation-handler.d.ts.map +1 -1
- package/lib/common/gmodel/paste-operation-handler.js +8 -11
- package/lib/common/gmodel/paste-operation-handler.js.map +1 -1
- package/lib/common/operations/compound-operation-handler.js +1 -1
- package/lib/common/operations/compound-operation-handler.js.map +1 -1
- package/lib/common/operations/json-operation-handler.js +2 -3
- package/lib/common/operations/json-operation-handler.js.map +1 -1
- package/lib/common/protocol/glsp-server.js +6 -7
- package/lib/common/protocol/glsp-server.js.map +1 -1
- package/lib/common/session/client-session-manager.js +3 -5
- package/lib/common/session/client-session-manager.js.map +1 -1
- package/lib/common/utils/action-queue.js +2 -4
- package/lib/common/utils/action-queue.js.map +1 -1
- package/lib/common/utils/client-options-util.js +2 -2
- package/lib/common/utils/client-options-util.js.map +1 -1
- package/lib/common/utils/glsp-server-error.d.ts +2 -3
- package/lib/common/utils/glsp-server-error.d.ts.map +1 -1
- package/lib/common/utils/glsp-server-error.js +1 -1
- package/lib/common/utils/glsp-server-error.js.map +1 -1
- package/lib/common/utils/layout-util.js +5 -8
- package/lib/common/utils/layout-util.js.map +1 -1
- package/lib/common/utils/logger.js +1 -2
- package/lib/common/utils/logger.js.map +1 -1
- package/lib/node/abstract-json-model-storage.js +2 -4
- package/lib/node/abstract-json-model-storage.js.map +1 -1
- package/lib/node/launch/websocket-server-launcher.js +1 -1
- package/lib/node/launch/websocket-server-launcher.js.map +1 -1
- package/package.json +17 -21
- package/src/common/features/directediting/context-edit-validator.ts +2 -2
- package/src/common/features/model/model-submission-handler.ts +3 -2
- package/src/common/features/progress/progress-service.ts +2 -3
- package/src/common/gmodel/paste-operation-handler.ts +6 -6
- package/src/common/utils/glsp-server-error.ts +3 -5
- package/src/browser/di/browser-action-dispatch-scope.spec.ts +0 -75
- package/src/common/actions/action-handler-registry.spec.ts +0 -52
- package/src/common/actions/global-action-provider.spec.ts +0 -68
- package/src/common/command/command-stack.spec.ts +0 -239
- package/src/common/command/command.spec.ts +0 -92
- package/src/common/command/recording-command.spec.ts +0 -86
- package/src/common/di/binding-target.spec.ts +0 -147
- package/src/common/di/multi-bindings.spec.ts +0 -133
- package/src/common/features/contextactions/context-actions-provider-registry.spec.ts +0 -69
- package/src/common/features/contextactions/request-context-actions-handler.spec.ts +0 -75
- package/src/common/features/contextactions/tool-palette-item-provider.spec.ts +0 -46
- package/src/common/features/directediting/context-edit-validator-registry.spec.ts +0 -54
- package/src/common/features/directediting/request-edit-validation-handler.spec.ts +0 -131
- package/src/common/features/model/gmodel-serializer.spec.ts +0 -141
- package/src/common/features/type-hints/request-type-hints-action-handler.spec.ts +0 -59
- package/src/common/operations/operation-handler-registry.spec.ts +0 -50
- package/src/common/protocol/glsp-server.spec.ts +0 -154
- package/src/common/session/client-session-factory.spec.ts +0 -60
- package/src/common/session/client-session-manager.spec.ts +0 -83
- package/src/common/test/mock-util.ts +0 -281
- package/src/common/utils/action-queue.spec.ts +0 -133
- package/src/common/utils/promise-queue.spec.ts +0 -142
- package/src/common/utils/registry.spec.ts +0 -225
- package/src/node/actions/action-dispatcher.spec.ts +0 -678
- package/src/node/launch/cli-parser.spec.ts +0 -61
- package/src/node/launch/socket-cli-parser.spec.ts +0 -73
- package/src/node/launch/socket-server-launcher.spec.ts +0 -74
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-2026 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
export declare class GLSPServerError extends Error {
|
|
17
|
-
|
|
18
|
-
constructor(message: string, cause?: unknown | undefined);
|
|
17
|
+
constructor(message: string, cause?: unknown);
|
|
19
18
|
}
|
|
20
19
|
export declare function getOrThrow<T>(optional: undefined | T, errorMsg: string): T;
|
|
21
20
|
//# sourceMappingURL=glsp-server-error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-server-error.d.ts","sourceRoot":"","sources":["../../../src/common/utils/glsp-server-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qBAAa,eAAgB,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"glsp-server-error.d.ts","sourceRoot":"","sources":["../../../src/common/utils/glsp-server-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qBAAa,eAAgB,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAI/C;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,CAK1E"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GLSPServerError = void 0;
|
|
4
4
|
exports.getOrThrow = getOrThrow;
|
|
5
5
|
/********************************************************************************
|
|
6
|
-
* Copyright (c) 2022-
|
|
6
|
+
* Copyright (c) 2022-2026 STMicroelectronics and others.
|
|
7
7
|
*
|
|
8
8
|
* This program and the accompanying materials are made available under the
|
|
9
9
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-server-error.js","sourceRoot":"","sources":["../../../src/common/utils/glsp-server-error.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"glsp-server-error.js","sourceRoot":"","sources":["../../../src/common/utils/glsp-server-error.ts"],"names":[],"mappings":";;;AAsBA,gCAKC;AA3BD;;;;;;;;;;;;;;kFAckF;AAClF,MAAa,eAAgB,SAAQ,KAAK;IACtC,YAAY,OAAe,EAAE,KAAe;QACxC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;CACJ;AALD,0CAKC;AAED,SAAgB,UAAU,CAAI,QAAuB,EAAE,QAAgB;IACnE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,QAAQ,CAAC;IACpB,CAAC;IACD,MAAM,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -66,15 +66,14 @@ function applyAlignment(alignment, index) {
|
|
|
66
66
|
* @returns The changed element.
|
|
67
67
|
*/
|
|
68
68
|
function applyRoute(route, index) {
|
|
69
|
-
|
|
70
|
-
const routingPoints = (_a = route.newRoutingPoints) !== null && _a !== void 0 ? _a : [];
|
|
69
|
+
const routingPoints = route.newRoutingPoints ?? [];
|
|
71
70
|
if (routingPoints.length < 2) {
|
|
72
71
|
throw new glsp_server_error_1.GLSPServerError('Invalid Route!');
|
|
73
72
|
}
|
|
74
73
|
// first and last point mark the source and target point
|
|
75
74
|
const edge = applyRoutingPoints(route, index);
|
|
76
75
|
const edgeRoutingPoints = edge.routingPoints;
|
|
77
|
-
const args =
|
|
76
|
+
const args = edge.args ?? {};
|
|
78
77
|
const source = edgeRoutingPoints.shift();
|
|
79
78
|
const target = edgeRoutingPoints.pop();
|
|
80
79
|
args[args_util_1.ArgsUtil.KEY_EDGE_SOURCE_POINT_X] = source.x;
|
|
@@ -109,9 +108,8 @@ function getRoute(edge) {
|
|
|
109
108
|
return { elementId: edge.id, newRoutingPoints: route };
|
|
110
109
|
}
|
|
111
110
|
function applyRoutingPoints(routingPoints, index) {
|
|
112
|
-
var _a;
|
|
113
111
|
const edge = (0, glsp_server_error_1.getOrThrow)(index.findByClass(routingPoints.elementId, graph_1.GEdge), 'Model element not found! ID: ' + routingPoints.elementId);
|
|
114
|
-
edge.routingPoints =
|
|
112
|
+
edge.routingPoints = routingPoints.newRoutingPoints ?? [];
|
|
115
113
|
return edge;
|
|
116
114
|
}
|
|
117
115
|
/**
|
|
@@ -146,7 +144,6 @@ function getRelativeLocation(absoluteLocation, container) {
|
|
|
146
144
|
* @throws Error if the modelElement is not part of a {@link GBoundsAware} hierarchy
|
|
147
145
|
*/
|
|
148
146
|
function absoluteToRelative(absolutePoint, modelElement) {
|
|
149
|
-
var _a, _b, _c, _d;
|
|
150
147
|
let parentElement;
|
|
151
148
|
if (!(modelElement instanceof graph_1.GModelRoot)) {
|
|
152
149
|
parentElement = modelElement.parent;
|
|
@@ -161,8 +158,8 @@ function absoluteToRelative(absolutePoint, modelElement) {
|
|
|
161
158
|
}
|
|
162
159
|
relativeToParent = absoluteToRelative(absolutePoint, parentElement);
|
|
163
160
|
}
|
|
164
|
-
const x =
|
|
165
|
-
const y =
|
|
161
|
+
const x = modelElement.position?.x ?? 0;
|
|
162
|
+
const y = modelElement.position?.y ?? 0;
|
|
166
163
|
return { x: relativeToParent.x - x, y: relativeToParent.y - y };
|
|
167
164
|
}
|
|
168
165
|
//# sourceMappingURL=layout-util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-util.js","sourceRoot":"","sources":["../../../src/common/utils/layout-util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAelF,sDAUC;AASD,wCAOC;AASD,gCAoBC;AASD,4BAcC;AAED,gDAIC;AASD,kDAUC;AAcD,gDAoBC;AAtJD,+CAAuI;AAGvI,2CAAuC;AACvC,2DAAkE;AAElE;;;;;;GAMG;AACH,SAAgB,qBAAqB,CAAC,MAAwB,EAAE,KAAkB;IAC9E,MAAM,OAAO,GAAG,IAAA,8BAAU,EAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,+BAA+B,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC5G,IAAI,IAAA,sBAAc,EAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACnC,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC;QAC1C,CAAC;QACD,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,SAA8B,EAAE,KAAkB;IAC7E,MAAM,OAAO,GAAG,IAAA,8BAAU,EAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,+BAA+B,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IAClH,IAAI,IAAA,oBAAY,EAAC,OAAO,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC;QAC3C,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,KAA8B,EAAE,KAAkB
|
|
1
|
+
{"version":3,"file":"layout-util.js","sourceRoot":"","sources":["../../../src/common/utils/layout-util.ts"],"names":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AgB,kBAAkB,CAAC,aAAoB,EAAE,YAA0C;IAC/F,IAAI,aAAa,CAAC;IAClB,IAAI,CAAC,CAAC,YAAY,YAAY,kBAAU,CAAC,EAAE,CAAC;QACxC,aAAa,GAAG,YAAY,CAAC,MAAM,CAAC;IACxC,CAAC;IAED,IAAI,gBAAuB,CAAC;IAC5B,IAAI,CAAC,aAAa,EAAE,CAAC;QACjB,gBAAgB,GAAG,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC;IAClE,CAAC;SAAM,CAAC;QACJ,IAAI,CAAC,IAAA,sBAAc,EAAC,aAAa,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,wDAAwD,YAAY,EAAE,CAAC,CAAC;QAC5F,CAAC;QACD,gBAAgB,GAAG,kBAAkB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,CAAC,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,CAAC,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;IAExC,OAAO,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;AACpE,CAAC"}
|
|
@@ -66,12 +66,11 @@ function asLogLevel(level) {
|
|
|
66
66
|
return undefined;
|
|
67
67
|
}
|
|
68
68
|
function getRequestParentName(context) {
|
|
69
|
-
var _a;
|
|
70
69
|
if (context.currentRequest.parentRequest) {
|
|
71
70
|
const bindings = context.currentRequest.parentRequest.bindings;
|
|
72
71
|
if (bindings.length > 0) {
|
|
73
72
|
const binding = bindings[0];
|
|
74
|
-
return
|
|
73
|
+
return binding.implementationType?.name;
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
76
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/common/utils/logger.ts"],"names":[],"mappings":";;;;;;;;;AA6DA,gCAUC;AAOD,oDASC;AAvFD;;;;;;;;;;;;;;kFAckF;AAClF,yCAAmD;AAG5C,IAAe,MAAM,GAArB,MAAe,MAAM;CAY3B,CAAA;AAZqB,wBAAM;iBAAN,MAAM;IAD3B,IAAA,sBAAU,GAAE;GACS,MAAM,CAY3B;AAED,MAAa,UAAW,SAAQ,MAAM;IAGlC,IAAI,CAAC,OAAe,EAAE,GAAG,MAAa;QAClC,QAAQ;IACZ,CAAC;IACD,IAAI,CAAC,OAAe,EAAE,GAAG,MAAa;QAClC,QAAQ;IACZ,CAAC;IACD,KAAK,CAAC,OAAe,EAAE,GAAG,MAAa;QACnC,QAAQ;IACZ,CAAC;IACD,KAAK,CAAC,OAAe,EAAE,GAAG,MAAa;QACnC,QAAQ;IACZ,CAAC;CACJ;AAfD,gCAeC;AAEY,QAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAIrD,IAAY,QAMX;AAND,WAAY,QAAQ;IAChB,uCAAQ,CAAA;IACR,yCAAS,CAAA;IACT,uCAAQ,CAAA;IACR,uCAAQ,CAAA;IACR,yCAAS,CAAA;AACb,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB;AAED,SAAgB,UAAU,CAAC,KAAsB;IAC7C,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC/B,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;IAED,IAAI,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACvB,OAAQ,QAAgB,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAOD,SAAgB,oBAAoB,CAAC,OAA2B
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src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CAAC,aAAa,CAAC,QAAQ,CAAC;QAC/D,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAA0C,CAAC;YACrE,OAAO,OAAO,CAAC,kBAAkB,EAAE,IAAI,CAAC;QAC5C,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -22,8 +22,7 @@ const glsp_server_error_1 = require("../common/utils/glsp-server-error");
|
|
|
22
22
|
*/
|
|
23
23
|
let AbstractJsonModelStorage = class AbstractJsonModelStorage {
|
|
24
24
|
getSourceUri(action) {
|
|
25
|
-
|
|
26
|
-
const sourceUri = (_a = action.options) === null || _a === void 0 ? void 0 : _a[model_state_1.SOURCE_URI_ARG];
|
|
25
|
+
const sourceUri = action.options?.[model_state_1.SOURCE_URI_ARG];
|
|
27
26
|
if (typeof sourceUri !== 'string') {
|
|
28
27
|
throw new glsp_server_error_1.GLSPServerError(`Invalid RequestModelAction! Missing argument with key '${model_state_1.SOURCE_URI_ARG}'`);
|
|
29
28
|
}
|
|
@@ -82,8 +81,7 @@ let AbstractJsonModelStorage = class AbstractJsonModelStorage {
|
|
|
82
81
|
return path;
|
|
83
82
|
}
|
|
84
83
|
getFileUri(action) {
|
|
85
|
-
|
|
86
|
-
const uri = (_a = action.fileUri) !== null && _a !== void 0 ? _a : this.modelState.get(model_state_1.SOURCE_URI_ARG);
|
|
84
|
+
const uri = action.fileUri ?? this.modelState.get(model_state_1.SOURCE_URI_ARG);
|
|
87
85
|
if (!uri) {
|
|
88
86
|
throw new glsp_server_error_1.GLSPServerError('Could not derive fileUri for saving the current source model');
|
|
89
87
|
}
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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,MAAM,CAAC,OAAO,EAAE,CAAC,4BAAc,CAAC,CAAC;QACnD,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YAChC,MAAM,IAAI,mCAAe,CAAC,0DAA0D,4BAAc,GAAG,CAAC,CAAC;QAC3G,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAIS,YAAY,CAAI,SAAiB,EAAE,KAAoB;QAC7D,IAAI,CAAC;YACD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACpC,IAAI,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtC,IAAI,CAAC,WAAW,EAAE,CAAC;gBACf,WAAW,GAAG,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;gBACjD,IAAI,CAAC,WAAW,EAAE,CAAC;oBACf,MAAM,IAAI,mCAAe,CAAC,8CAA8C,IAAI,cAAc,CAAC,CAAC;gBAChG,CAAC;YACL,CAAC;YACD,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;YAC3E,CAAC;YACD,OAAO,WAAW,CAAC;QACvB,CAAC;QAAC,OA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,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,MAAM,IAAI,mCAAe,CAAC,8DAA8D,CAAC,CAAC;QAC9F,CAAC;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"}
|
|
@@ -69,7 +69,7 @@ let WebSocketServerLauncher = class WebSocketServerLauncher extends jsonrpc_serv
|
|
|
69
69
|
const server = http.createServer((req, res) => {
|
|
70
70
|
const body = http.STATUS_CODES[STATUS_UPGRADE_REQUIRED];
|
|
71
71
|
res.writeHead(426, {
|
|
72
|
-
'Content-Length': body
|
|
72
|
+
'Content-Length': body?.length,
|
|
73
73
|
'Content-Type': 'text/plain'
|
|
74
74
|
});
|
|
75
75
|
res.end(body);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket-server-launcher.js","sourceRoot":"","sources":["../../../src/node/launch/websocket-server-launcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAmHlF,sCAQC;AAzHD,qDAA+G;AAC/G,6BAA6B;AAC7B,yCAA+C;AAC/C,2BAA2B;AAE3B,2BAAuC;AACvC,yFAAwF;AACxF,sDAAmD;AAoBnD,MAAM,uBAA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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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/server",
|
|
3
|
-
"version": "2.8.0-next.
|
|
3
|
+
"version": "2.8.0-next.6",
|
|
4
4
|
"description": "A js server framework for Eclipse GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -45,38 +45,34 @@
|
|
|
45
45
|
"browser.d.ts",
|
|
46
46
|
"browser.js",
|
|
47
47
|
"common.d.ts",
|
|
48
|
-
"common.js"
|
|
48
|
+
"common.js",
|
|
49
|
+
"!**/*.spec.ts",
|
|
50
|
+
"!**/*.spec.tsx",
|
|
51
|
+
"!**/test/**"
|
|
49
52
|
],
|
|
50
|
-
"scripts": {
|
|
51
|
-
"build": "tsc -b",
|
|
52
|
-
"clean": "rimraf lib *.tsbuildinfo coverage .nyc_output",
|
|
53
|
-
"generate:index": "glsp generateIndex src/browser src/common src/node -s -f",
|
|
54
|
-
"lint": "eslint ./src",
|
|
55
|
-
"test": "mocha --config ../../.mocharc \"./src/**/*.spec.?(ts|tsx)\"",
|
|
56
|
-
"test:ci": "yarn test --reporter mocha-ctrf-json-reporter",
|
|
57
|
-
"test:coverage": "nyc yarn test:ci",
|
|
58
|
-
"watch": "tsc -w"
|
|
59
|
-
},
|
|
60
53
|
"dependencies": {
|
|
61
|
-
"@eclipse-glsp/graph": "2.8.0-next.3+a2fc072",
|
|
62
54
|
"@eclipse-glsp/protocol": "next",
|
|
63
|
-
"
|
|
64
|
-
"commander": "^8.3.0",
|
|
55
|
+
"commander": "^14.0.0",
|
|
65
56
|
"fast-json-patch": "^3.1.0",
|
|
66
|
-
"lodash": "4.17.21",
|
|
67
57
|
"vscode-jsonrpc": "8.2.0",
|
|
68
58
|
"winston": "^3.3.3",
|
|
69
|
-
"ws": "^8.12.1"
|
|
59
|
+
"ws": "^8.12.1",
|
|
60
|
+
"@eclipse-glsp/graph": "2.8.0-next.6"
|
|
70
61
|
},
|
|
71
62
|
"devDependencies": {
|
|
72
|
-
"@types/lodash": "4.14.191",
|
|
73
63
|
"@types/ws": "^8.5.4"
|
|
74
64
|
},
|
|
75
65
|
"peerDependencies": {
|
|
76
|
-
"inversify": "^6.1.3"
|
|
66
|
+
"inversify": "^6.1.3",
|
|
67
|
+
"reflect-metadata": "^0.2.2"
|
|
77
68
|
},
|
|
78
69
|
"publishConfig": {
|
|
79
70
|
"access": "public"
|
|
80
71
|
},
|
|
81
|
-
"
|
|
82
|
-
|
|
72
|
+
"scripts": {
|
|
73
|
+
"build": "tsc -b",
|
|
74
|
+
"clean": "rimraf lib *.tsbuildinfo coverage",
|
|
75
|
+
"generate:index": "glsp generateIndex src/browser src/common src/node -s -f",
|
|
76
|
+
"lint": "eslint ./src"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-2026 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { GModelElement } from '@eclipse-glsp/graph
|
|
16
|
+
import { GModelElement } from '@eclipse-glsp/graph';
|
|
17
17
|
import { RequestEditValidationAction, ValidationStatus } from '@eclipse-glsp/protocol';
|
|
18
18
|
import { ModelState } from '../model/model-state';
|
|
19
19
|
import { LabelEditValidator } from './label-edit-validator';
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import {
|
|
17
17
|
Action,
|
|
18
|
+
DebouncedFunc,
|
|
18
19
|
DirtyStateChangeReason,
|
|
19
20
|
GModelRootSchema,
|
|
20
21
|
LayoutOperation,
|
|
@@ -26,9 +27,9 @@ import {
|
|
|
26
27
|
SetMarkersAction,
|
|
27
28
|
SetModelAction,
|
|
28
29
|
StatusAction,
|
|
29
|
-
UpdateModelAction
|
|
30
|
+
UpdateModelAction,
|
|
31
|
+
debounce
|
|
30
32
|
} from '@eclipse-glsp/protocol';
|
|
31
|
-
import { DebouncedFunc, debounce } from 'lodash';
|
|
32
33
|
|
|
33
34
|
import { inject, injectable, optional } from 'inversify';
|
|
34
35
|
import { ActionDispatcher } from '../../actions/action-dispatcher';
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { EndProgressAction, StartProgressAction, UpdateProgressAction } from '@eclipse-glsp/protocol';
|
|
16
|
+
import { EndProgressAction, StartProgressAction, UpdateProgressAction, generateUuid } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { inject, injectable } from 'inversify';
|
|
18
|
-
import * as uuid from 'uuid';
|
|
19
18
|
import { ActionDispatcher } from '../../actions/action-dispatcher';
|
|
20
19
|
|
|
21
20
|
export const ProgressService = Symbol('ProgressService');
|
|
@@ -64,7 +63,7 @@ export class DefaultProgressService implements ProgressService {
|
|
|
64
63
|
protected actionDispatcher: ActionDispatcher;
|
|
65
64
|
|
|
66
65
|
start(title: string, options?: ProgressOptions): ProgressMonitor {
|
|
67
|
-
const progressId =
|
|
66
|
+
const progressId = generateUuid();
|
|
68
67
|
this.actionDispatcher.dispatch(StartProgressAction.create({ progressId, title, ...options }));
|
|
69
68
|
return {
|
|
70
69
|
update: updateOptions => this.actionDispatcher.dispatch(UpdateProgressAction.create(progressId, updateOptions)),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-2026 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { GBoundsAware, GEdge, GModelElement, isGBoundsAware } from '@eclipse-glsp/graph';
|
|
17
|
-
import { EditorContext, GModelElementSchema, MaybePromise, PasteOperation, Point } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { EditorContext, GModelElementSchema, MaybePromise, PasteOperation, Point, generateUuid } from '@eclipse-glsp/protocol';
|
|
18
18
|
import { inject, injectable } from 'inversify';
|
|
19
|
-
import * as uuid from 'uuid';
|
|
20
19
|
import { Command } from '../command/command';
|
|
21
20
|
import { GModelSerializer } from '../features/model/gmodel-serializer';
|
|
22
21
|
import { GModelOperationHandler } from './gmodel-operation-handler';
|
|
@@ -67,22 +66,23 @@ export class GModelPasteOperationHandler extends GModelOperationHandler {
|
|
|
67
66
|
|
|
68
67
|
protected getReferenceElementForPasteOffset(elements: GModelElement[]): GBoundsAware | undefined {
|
|
69
68
|
let minY = Number.MAX_VALUE;
|
|
69
|
+
let referenceElement: GBoundsAware | undefined;
|
|
70
70
|
for (const element of elements) {
|
|
71
71
|
if (isGBoundsAware(element)) {
|
|
72
72
|
const position = element.position ?? Point.ORIGIN;
|
|
73
73
|
if (minY > position.y) {
|
|
74
74
|
minY = position.y;
|
|
75
|
-
|
|
75
|
+
referenceElement = element;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
return
|
|
79
|
+
return referenceElement;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
protected reassignIds(elements: GModelElement[]): Map<string, string> {
|
|
83
83
|
const idMap = new Map<string, string>();
|
|
84
84
|
elements.forEach(element => {
|
|
85
|
-
const newId =
|
|
85
|
+
const newId = generateUuid();
|
|
86
86
|
idMap.set(element.id, newId);
|
|
87
87
|
element.id = newId;
|
|
88
88
|
const childMap = this.reassignIds(element.children);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-2026 STMicroelectronics and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -14,11 +14,9 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
export class GLSPServerError extends Error {
|
|
17
|
-
constructor(
|
|
18
|
-
message: string,
|
|
19
|
-
readonly cause?: unknown
|
|
20
|
-
) {
|
|
17
|
+
constructor(message: string, cause?: unknown) {
|
|
21
18
|
super(message);
|
|
19
|
+
this.cause = cause;
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
22
|
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
import { Action } from '@eclipse-glsp/protocol';
|
|
17
|
-
import { expect } from 'chai';
|
|
18
|
-
import { ClientAction } from '../../common/protocol/client-action';
|
|
19
|
-
import * as mock from '../../common/test/mock-util';
|
|
20
|
-
import { BrowserActionDispatchScope } from './browser-action-dispatch-scope';
|
|
21
|
-
|
|
22
|
-
describe('BrowserActionDispatchScope', () => {
|
|
23
|
-
const action: Action = { kind: 'foo' };
|
|
24
|
-
const markedClientAction = ((): Action => {
|
|
25
|
-
const a: Action = { kind: 'bar' };
|
|
26
|
-
ClientAction.mark(a);
|
|
27
|
-
return a;
|
|
28
|
-
})();
|
|
29
|
-
|
|
30
|
-
let scope: BrowserActionDispatchScope;
|
|
31
|
-
beforeEach(() => {
|
|
32
|
-
scope = new BrowserActionDispatchScope();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('isReentrant is false outside enter()', () => {
|
|
36
|
-
expect(scope.isReentrant(action)).to.be.false;
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('isReentrant is true during a synchronous enter()', () => {
|
|
40
|
-
scope.enter(() => {
|
|
41
|
-
expect(scope.isReentrant(action)).to.be.true;
|
|
42
|
-
});
|
|
43
|
-
expect(scope.isReentrant(action)).to.be.false;
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('isReentrant is true during an async enter() and false after settle', async () => {
|
|
47
|
-
const probe: Promise<boolean> = scope.enter(async () => {
|
|
48
|
-
await Promise.resolve();
|
|
49
|
-
return scope.isReentrant(action);
|
|
50
|
-
});
|
|
51
|
-
expect(await probe).to.be.true;
|
|
52
|
-
expect(scope.isReentrant(action)).to.be.false;
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('resets active flag when callback throws synchronously', () => {
|
|
56
|
-
expect(() =>
|
|
57
|
-
scope.enter(() => {
|
|
58
|
-
throw new Error('boom');
|
|
59
|
-
})
|
|
60
|
-
).to.throw('boom');
|
|
61
|
-
expect(scope.isReentrant(action)).to.be.false;
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it('resets active flag when async callback rejects', async () => {
|
|
65
|
-
await mock.expectToThrowAsync(() => scope.enter(() => Promise.reject(new Error('boom'))), 'boom');
|
|
66
|
-
expect(scope.isReentrant(action)).to.be.false;
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it('isReentrant is false for client-originated actions even when scope is active', () => {
|
|
70
|
-
scope.enter(() => {
|
|
71
|
-
expect(scope.isReentrant(markedClientAction)).to.be.false;
|
|
72
|
-
expect(scope.isReentrant(action)).to.be.true;
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
});
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
import * as mock from '../test/mock-util';
|
|
17
|
-
import { ActionHandlerRegistry } from './action-handler-registry';
|
|
18
|
-
import { expect } from 'chai';
|
|
19
|
-
|
|
20
|
-
describe('Test ActionHandlerRegistry (only functionality that is not covered by "registry.spec.ts"', () => {
|
|
21
|
-
const singleAction = 'singleHandledAction';
|
|
22
|
-
const multiAction = 'multiHandledAction';
|
|
23
|
-
|
|
24
|
-
const h1 = new mock.StubActionHandler([singleAction]);
|
|
25
|
-
const h2 = new mock.StubActionHandler([multiAction]);
|
|
26
|
-
const h3 = new mock.StubActionHandler([multiAction]);
|
|
27
|
-
const h4 = new mock.StubActionHandler([multiAction]);
|
|
28
|
-
const registry: ActionHandlerRegistry = new ActionHandlerRegistry();
|
|
29
|
-
|
|
30
|
-
it('registerHandler - should register given handlers', () => {
|
|
31
|
-
// setup
|
|
32
|
-
registry.registerHandler(h1);
|
|
33
|
-
registry.registerHandler(h2);
|
|
34
|
-
registry.registerHandler(h3);
|
|
35
|
-
registry.registerHandler(h4);
|
|
36
|
-
|
|
37
|
-
const result = registry.getAll();
|
|
38
|
-
expect(result).to.have.length(4);
|
|
39
|
-
expect(result.includes(h1)).true;
|
|
40
|
-
expect(result.includes(h2)).true;
|
|
41
|
-
expect(result.includes(h3)).true;
|
|
42
|
-
expect(result.includes(h4)).true;
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it('get - should return three handlers sorted by priority', () => {
|
|
46
|
-
const result = registry.get(multiAction);
|
|
47
|
-
expect(result.length).to.be.equal(3);
|
|
48
|
-
expect(result[0]).to.be.deep.equal(h4);
|
|
49
|
-
expect(result[1]).to.be.deep.equal(h2);
|
|
50
|
-
expect(result[2]).to.be.deep.equal(h3);
|
|
51
|
-
});
|
|
52
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
import { expect } from 'chai';
|
|
17
|
-
import { Container, ContainerModule } from 'inversify';
|
|
18
|
-
import * as sinon from 'sinon';
|
|
19
|
-
import { DiagramModules, InjectionContainer } from '../di/service-identifiers';
|
|
20
|
-
import { ClientSessionInitializer } from '../session/client-session-initializer';
|
|
21
|
-
import * as mock from '../test/mock-util';
|
|
22
|
-
import { Logger } from '../utils/logger';
|
|
23
|
-
import { ActionHandler } from './action-handler';
|
|
24
|
-
import { ActionHandlerRegistry } from './action-handler-registry';
|
|
25
|
-
import { DefaultGlobalActionProvider } from './global-action-provider';
|
|
26
|
-
|
|
27
|
-
describe('test DefaultGlobalActionProvider', () => {
|
|
28
|
-
const container = new Container();
|
|
29
|
-
const serverActions = ['A1', 'A2', 'A3'];
|
|
30
|
-
const diagramType = 'myDiagramType';
|
|
31
|
-
|
|
32
|
-
const handler1Actions = ['A1', 'A2'];
|
|
33
|
-
const handler2Actions = ['A2', 'A3'];
|
|
34
|
-
|
|
35
|
-
const h1 = new mock.StubActionHandler(handler1Actions);
|
|
36
|
-
const h2 = new mock.StubActionHandler(handler2Actions);
|
|
37
|
-
|
|
38
|
-
const handlerRegistry = new ActionHandlerRegistry();
|
|
39
|
-
sinon.stub(handlerRegistry, 'getAll').returns([h1, h2]);
|
|
40
|
-
|
|
41
|
-
const diagramModule1 = new ContainerModule(bind => {
|
|
42
|
-
bind(ClientSessionInitializer).toConstantValue(new mock.StubClientSessionInitializer());
|
|
43
|
-
bind(ActionHandler).toConstantValue(new mock.StubActionHandler(handler1Actions));
|
|
44
|
-
bind(ActionHandler).toConstantValue(new mock.StubActionHandler(handler2Actions));
|
|
45
|
-
bind(ActionHandlerRegistry).toConstantValue(handlerRegistry);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const diagramModules = new Map<string, ContainerModule[]>();
|
|
49
|
-
diagramModules.set(diagramType, [diagramModule1]);
|
|
50
|
-
|
|
51
|
-
container.load(
|
|
52
|
-
new ContainerModule(bind => {
|
|
53
|
-
bind(Logger).toConstantValue(new mock.StubLogger());
|
|
54
|
-
bind(InjectionContainer).toConstantValue(container);
|
|
55
|
-
bind(DiagramModules).toConstantValue(diagramModules);
|
|
56
|
-
})
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
const actionProvider = container.resolve(DefaultGlobalActionProvider);
|
|
60
|
-
|
|
61
|
-
it('serverActionsKinds', () => {
|
|
62
|
-
const result = actionProvider.actionKinds;
|
|
63
|
-
expect(result.size).to.be.equal(1);
|
|
64
|
-
const resultServerActions = result.get(diagramType);
|
|
65
|
-
expect(resultServerActions).to.not.be.undefined;
|
|
66
|
-
expect(serverActions.every(action => resultServerActions!.includes(action))).true;
|
|
67
|
-
});
|
|
68
|
-
});
|