@eclipse-glsp/server 1.1.0-RC07 → 1.1.0-next.146ae06.49
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/di/app-module.d.ts +2 -7
- package/lib/browser/di/app-module.d.ts.map +1 -1
- package/lib/browser/di/app-module.js +5 -30
- package/lib/browser/di/app-module.js.map +1 -1
- package/lib/browser/index.d.ts +0 -1
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +0 -1
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/launch/worker-server-launcher.d.ts +4 -4
- package/lib/browser/launch/worker-server-launcher.d.ts.map +1 -1
- package/lib/browser/launch/worker-server-launcher.js +5 -11
- package/lib/browser/launch/worker-server-launcher.js.map +1 -1
- package/lib/common/actions/client-action-handler.d.ts +1 -2
- package/lib/common/actions/client-action-handler.d.ts.map +1 -1
- package/lib/common/actions/client-action-handler.js +17 -2
- package/lib/common/actions/client-action-handler.js.map +1 -1
- package/lib/common/command/command-stack.d.ts +16 -1
- package/lib/common/command/command-stack.d.ts.map +1 -1
- package/lib/common/command/command-stack.js +0 -15
- package/lib/common/command/command-stack.js.map +1 -1
- package/lib/common/di/client-session-module.d.ts +1 -1
- package/lib/common/di/client-session-module.d.ts.map +1 -1
- package/lib/common/di/client-session-module.js +2 -2
- package/lib/common/di/client-session-module.js.map +1 -1
- package/lib/common/di/glsp-module.d.ts +3 -1
- package/lib/common/di/glsp-module.d.ts.map +1 -1
- package/lib/common/di/glsp-module.js +0 -15
- package/lib/common/di/glsp-module.js.map +1 -1
- package/lib/common/di/multi-binding.d.ts +19 -4
- package/lib/common/di/multi-binding.d.ts.map +1 -1
- package/lib/common/di/multi-binding.js.map +1 -1
- package/lib/common/di/server-module.d.ts +1 -6
- package/lib/common/di/server-module.d.ts.map +1 -1
- package/lib/common/di/server-module.js +21 -17
- package/lib/common/di/server-module.js.map +1 -1
- package/lib/common/features/model/model-submission-handler.d.ts +2 -0
- package/lib/common/features/model/model-submission-handler.d.ts.map +1 -1
- package/lib/common/features/model/model-submission-handler.js +10 -0
- package/lib/common/features/model/model-submission-handler.js.map +1 -1
- 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 +3 -9
- package/lib/common/features/validation/request-markers-handler.js.map +1 -1
- package/lib/common/index.d.ts +1 -2
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +1 -2
- package/lib/common/index.js.map +1 -1
- package/lib/common/launch/glsp-server-launcher.d.ts +1 -1
- package/lib/common/launch/glsp-server-launcher.d.ts.map +1 -1
- package/lib/common/launch/glsp-server-launcher.js +2 -2
- package/lib/common/launch/glsp-server-launcher.js.map +1 -1
- package/lib/common/launch/jsonrpc-server-launcher.d.ts +38 -0
- package/lib/common/launch/jsonrpc-server-launcher.d.ts.map +1 -0
- package/lib/common/launch/jsonrpc-server-launcher.js +84 -0
- package/lib/common/launch/jsonrpc-server-launcher.js.map +1 -0
- package/lib/common/protocol/glsp-server.d.ts +4 -104
- package/lib/common/protocol/glsp-server.d.ts.map +1 -1
- package/lib/common/protocol/glsp-server.js +13 -20
- package/lib/common/protocol/glsp-server.js.map +1 -1
- package/lib/common/protocol/glsp-server.spec.js +18 -5
- package/lib/common/protocol/glsp-server.spec.js.map +1 -1
- package/lib/common/session/client-session-factory.d.ts +1 -2
- package/lib/common/session/client-session-factory.d.ts.map +1 -1
- package/lib/common/session/client-session-factory.js +17 -2
- package/lib/common/session/client-session-factory.js.map +1 -1
- package/lib/common/session/client-session-factory.spec.js +2 -2
- package/lib/common/session/client-session-factory.spec.js.map +1 -1
- package/lib/common/session/client-session-manager.d.ts +1 -3
- package/lib/common/session/client-session-manager.d.ts.map +1 -1
- package/lib/common/session/client-session-manager.js.map +1 -1
- package/lib/common/test/mock-util.d.ts +3 -6
- package/lib/common/test/mock-util.d.ts.map +1 -1
- package/lib/common/test/mock-util.js.map +1 -1
- package/lib/{browser/di → common/utils}/console-logger.d.ts +8 -2
- package/lib/common/utils/console-logger.d.ts.map +1 -0
- package/lib/{browser/di → common/utils}/console-logger.js +27 -9
- package/lib/common/utils/console-logger.js.map +1 -0
- package/lib/common/utils/logger.d.ts +21 -0
- package/lib/common/utils/logger.d.ts.map +1 -1
- package/lib/common/utils/logger.js +12 -1
- package/lib/common/utils/logger.js.map +1 -1
- package/lib/node/di/app-module.d.ts +2 -2
- package/lib/node/di/app-module.d.ts.map +1 -1
- package/lib/node/di/app-module.js +10 -35
- package/lib/node/di/app-module.js.map +1 -1
- package/lib/node/launch/cli-parser.d.ts +2 -3
- package/lib/node/launch/cli-parser.d.ts.map +1 -1
- package/lib/node/launch/cli-parser.js.map +1 -1
- package/lib/node/launch/socket-cli-parser.js +1 -1
- package/lib/node/launch/socket-cli-parser.js.map +1 -1
- package/lib/node/launch/socket-server-launcher.d.ts +2 -23
- package/lib/node/launch/socket-server-launcher.d.ts.map +1 -1
- package/lib/node/launch/socket-server-launcher.js +8 -28
- package/lib/node/launch/socket-server-launcher.js.map +1 -1
- package/lib/node/launch/socket-server-launcher.spec.js +5 -0
- package/lib/node/launch/socket-server-launcher.spec.js.map +1 -1
- package/lib/node/launch/websocket-server-launcher.d.ts +2 -8
- package/lib/node/launch/websocket-server-launcher.d.ts.map +1 -1
- package/lib/node/launch/websocket-server-launcher.js +4 -28
- package/lib/node/launch/websocket-server-launcher.js.map +1 -1
- package/package.json +4 -4
- package/src/browser/di/app-module.ts +4 -32
- package/src/browser/index.ts +0 -1
- package/src/browser/launch/worker-server-launcher.ts +7 -13
- package/src/common/actions/client-action-handler.ts +1 -2
- package/src/common/command/command-stack.ts +1 -1
- package/src/common/di/client-session-module.ts +1 -1
- package/src/common/di/glsp-module.ts +3 -1
- package/src/common/di/multi-binding.ts +4 -5
- package/src/common/di/server-module.ts +6 -21
- package/src/common/features/model/model-submission-handler.ts +12 -0
- package/src/common/features/validation/model-validator.ts +75 -3
- package/src/common/features/validation/request-markers-handler.ts +4 -10
- package/src/common/index.ts +1 -2
- package/src/common/launch/glsp-server-launcher.ts +2 -2
- package/src/common/launch/jsonrpc-server-launcher.ts +95 -0
- package/src/common/protocol/glsp-server.spec.ts +7 -4
- package/src/common/protocol/glsp-server.ts +17 -132
- package/src/common/session/client-session-factory.spec.ts +1 -1
- package/src/common/session/client-session-factory.ts +1 -2
- package/src/common/session/client-session-manager.ts +1 -3
- package/src/common/test/mock-util.ts +5 -5
- package/src/{browser/di → common/utils}/console-logger.ts +20 -2
- package/src/common/utils/logger.ts +16 -1
- package/src/node/di/app-module.ts +4 -13
- package/src/node/launch/cli-parser.ts +2 -3
- package/src/node/launch/socket-cli-parser.ts +1 -1
- package/src/node/launch/socket-server-launcher.spec.ts +6 -0
- package/src/node/launch/socket-server-launcher.ts +8 -30
- package/src/node/launch/websocket-server-launcher.ts +5 -31
- package/lib/browser/di/console-logger.d.ts.map +0 -1
- package/lib/browser/di/console-logger.js.map +0 -1
- package/lib/common/protocol/glsp-client-proxy.d.ts +0 -45
- package/lib/common/protocol/glsp-client-proxy.d.ts.map +0 -1
- package/lib/common/protocol/glsp-client-proxy.js +0 -53
- package/lib/common/protocol/glsp-client-proxy.js.map +0 -1
- package/lib/common/protocol/glsp-server-listener.d.ts +0 -37
- package/lib/common/protocol/glsp-server-listener.d.ts.map +0 -1
- package/lib/common/protocol/glsp-server-listener.js +0 -5
- package/lib/common/protocol/glsp-server-listener.js.map +0 -1
- package/src/common/protocol/glsp-client-proxy.ts +0 -65
- package/src/common/protocol/glsp-server-listener.ts +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-module.js","sourceRoot":"","sources":["../../../src/common/di/server-module.ts"],"names":[],"mappings":";;;
|
|
1
|
+
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oB,EAAE,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACtG,IAAI,CAAC,qBAAqB,CAAC,IAAI,4BAAY,CAAqB,6BAAkB,CAAC,EAAE,OAAO,CAAC,EAAE,CAC3F,IAAI,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAC7C,CAAC;QAEF,IAAA,mCAAkB,EAAC,OAAO,EAAE,6CAAoB,EAAE,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC,gBAAgB,EAAE,CAAC;QAEtG,IAAI,CAAC,OAAO,CAAC,wCAAkB,CAAC,EAAE;YAC9B,IAAA,mCAAkB,EAAC,OAAO,EAAE,wCAAkB,EAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC;SAClF;IACL,CAAC;IAES,kBAAkB;QACxB,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC;IAClD,CAAC;IAES,cAAc;QACpB,OAAO,+BAAiB,CAAC;IAC7B,CAAC;IAES,wBAAwB;QAC9B,OAAO,oDAA2B,CAAC;IACvC,CAAC;IAES,wBAAwB;QAC9B,OAAO,oDAA2B,CAAC;IACvC,CAAC;IAES,wBAAwB;QAC9B,OAAO,oDAA2B,CAAC;IACvC,CAAC;IAES,sBAAsB;QAC5B,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;IAC1D,CAAC;IAES,4BAA4B,CAAC,OAAyC;QAC5E,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,6CAAoB,EAAE,CAAC,CAAC;IACnD,CAAC;;AApEL,oCAqEC;AApEiB,4BAAe,GAAG,iBAAiB,CAAC"}
|
|
@@ -18,6 +18,7 @@ import { Action, DirtyStateChangeReason, MaybePromise } from '@eclipse-glsp/prot
|
|
|
18
18
|
import { CommandStack } from '../../command/command-stack';
|
|
19
19
|
import { DiagramConfiguration } from '../../diagram/diagram-configuration';
|
|
20
20
|
import { LayoutEngine } from '../layout/layout-engine';
|
|
21
|
+
import { ModelValidator } from '../validation/model-validator';
|
|
21
22
|
import { GModelFactory } from './gmodel-factory';
|
|
22
23
|
import { GModelSerializer } from './gmodel-serializer';
|
|
23
24
|
import { ModelState } from './model-state';
|
|
@@ -28,6 +29,7 @@ export declare class ModelSubmissionHandler {
|
|
|
28
29
|
protected modelState: ModelState;
|
|
29
30
|
protected layoutEngine: LayoutEngine;
|
|
30
31
|
protected commandStack: CommandStack;
|
|
32
|
+
protected validator?: ModelValidator;
|
|
31
33
|
/**
|
|
32
34
|
* Returns a list of actions to update the client-side model, based on the specified <code>modelState</code>.
|
|
33
35
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-submission-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/model/model-submission-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACH,MAAM,EACN,sBAAsB,
|
|
1
|
+
{"version":3,"file":"model-submission-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/model/model-submission-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACH,MAAM,EACN,sBAAsB,EAEtB,YAAY,EAMf,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAoB,MAAM,qCAAqC,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,qBACa,sBAAsB;IAE/B,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAGrD,SAAS,CAAC,UAAU,EAAE,gBAAgB,CAAC;IAGvC,SAAS,CAAC,YAAY,EAAE,aAAa,CAAC;IAGtC,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAIjC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAGrC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAIrC,SAAS,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC;IAErC;;;;;;;;OAQG;IACH,WAAW,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;IAWpE;;;;;;;;;;;;;OAaG;IACG,mBAAmB,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAsB7E,SAAS,CAAC,eAAe,IAAI,gBAAgB;CAGhD"}
|
|
@@ -15,6 +15,7 @@ const inversify_1 = require("inversify");
|
|
|
15
15
|
const command_stack_1 = require("../../command/command-stack");
|
|
16
16
|
const diagram_configuration_1 = require("../../diagram/diagram-configuration");
|
|
17
17
|
const layout_engine_1 = require("../layout/layout-engine");
|
|
18
|
+
const model_validator_1 = require("../validation/model-validator");
|
|
18
19
|
const gmodel_factory_1 = require("./gmodel-factory");
|
|
19
20
|
const gmodel_serializer_1 = require("./gmodel-serializer");
|
|
20
21
|
const model_state_1 = require("./model-state");
|
|
@@ -64,6 +65,10 @@ let ModelSubmissionHandler = class ModelSubmissionHandler {
|
|
|
64
65
|
if (!this.diagramConfiguration.needsClientLayout) {
|
|
65
66
|
result.push(protocol_1.SetDirtyStateAction.create(this.commandStack.isDirty, { reason }));
|
|
66
67
|
}
|
|
68
|
+
if (this.validator) {
|
|
69
|
+
const markers = await this.validator.validate([this.modelState.root], protocol_1.MarkersReason.LIVE);
|
|
70
|
+
result.push(protocol_1.SetMarkersAction.create(markers, { reason: protocol_1.MarkersReason.LIVE }));
|
|
71
|
+
}
|
|
67
72
|
return result;
|
|
68
73
|
}
|
|
69
74
|
serializeGModel() {
|
|
@@ -95,6 +100,11 @@ __decorate([
|
|
|
95
100
|
(0, inversify_1.inject)(command_stack_1.CommandStack),
|
|
96
101
|
__metadata("design:type", Object)
|
|
97
102
|
], ModelSubmissionHandler.prototype, "commandStack", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, inversify_1.inject)(model_validator_1.ModelValidator),
|
|
105
|
+
(0, inversify_1.optional)(),
|
|
106
|
+
__metadata("design:type", Object)
|
|
107
|
+
], ModelSubmissionHandler.prototype, "validator", void 0);
|
|
98
108
|
ModelSubmissionHandler = __decorate([
|
|
99
109
|
(0, inversify_1.injectable)()
|
|
100
110
|
], ModelSubmissionHandler);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-submission-handler.js","sourceRoot":"","sources":["../../../../src/common/features/model/model-submission-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,
|
|
1
|
+
{"version":3,"file":"model-submission-handler.js","sourceRoot":"","sources":["../../../../src/common/features/model/model-submission-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,qDAUgC;AAEhC,yCAAyD;AACzD,+DAA2D;AAC3D,+EAA6F;AAC7F,2DAAuD;AACvD,mEAA+D;AAC/D,qDAAiD;AACjD,2DAAuD;AACvD,+CAA2C;AAGpC,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAwB/B;;;;;;;;OAQG;IACH,WAAW,CAAC,MAA+B;;QACvC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACzE,MAAM,IAAI,GAAG,IAAI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AE,wBAAa,CAAC,IAAI,CAAC,CAAC;YAC1F,MAAM,CAAC,IAAI,CAAC,2BAAgB,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,wBAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;SACjF;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAES,eAAe;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;CACJ,CAAA;AAlFG;IAAC,IAAA,kBAAM,EAAC,4CAAoB,CAAC;;oEACwB;AAErD;IAAC,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;0DACc;AAEvC;IAAC,IAAA,kBAAM,EAAC,8BAAa,CAAC;;4DACgB;AAEtC;IAAC,IAAA,kBAAM,EAAC,wBAAU,CAAC;;0DACc;AAEjC;IAAC,IAAA,kBAAM,EAAC,4BAAY,CAAC;IACpB,IAAA,oBAAQ,GAAE;;4DAC0B;AAErC;IAAC,IAAA,kBAAM,EAAC,4BAAY,CAAC;;4DACgB;AAErC;IAAC,IAAA,kBAAM,EAAC,gCAAc,CAAC;IACtB,IAAA,oBAAQ,GAAE;;yDAC0B;AAtB5B,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAmFlC;AAnFY,wDAAsB"}
|
|
@@ -26,8 +26,53 @@ export interface ModelValidator {
|
|
|
26
26
|
* Validates the given list of {@link GModelElement}s and returns a list of {@link Marker}s.
|
|
27
27
|
*
|
|
28
28
|
* @param elements The list of {@link GModelElement} to validate.
|
|
29
|
-
* @
|
|
29
|
+
* @param reason The reason for a validation request, such as "batch" or "live" validation.
|
|
30
|
+
* @return A list of {@link Marker}s for the validated {@link GModelElement}s.
|
|
30
31
|
*/
|
|
31
|
-
validate(elements: GModelElement[]): MaybePromise<Marker[]>;
|
|
32
|
+
validate(elements: GModelElement[], reason?: string): MaybePromise<Marker[]>;
|
|
33
|
+
}
|
|
34
|
+
export declare abstract class AbstractModelValidator implements ModelValidator {
|
|
35
|
+
validate(elements: GModelElement[], reason: string): Marker[];
|
|
36
|
+
/**
|
|
37
|
+
* Perform the live validation rules for the given <code>element</code>.
|
|
38
|
+
*
|
|
39
|
+
* This will be invoked on start and after each operation for all elements.
|
|
40
|
+
* Thus, the validation should be rather inexpensive.
|
|
41
|
+
* There is no need to traverse through the children in this method as {@link #validate(List, String)} will invoke
|
|
42
|
+
* this method for all children anyway.
|
|
43
|
+
*
|
|
44
|
+
* @param element The element to validate.
|
|
45
|
+
* @return A list of {@link Marker}s for the validated {@link GModelElement}.
|
|
46
|
+
*/
|
|
47
|
+
doLiveValidation(element: GModelElement): Marker[];
|
|
48
|
+
/**
|
|
49
|
+
* Perform the batch validation rules for the given <code>element</code>.
|
|
50
|
+
*
|
|
51
|
+
* <p>
|
|
52
|
+
* This will be invoked on demand by the client.
|
|
53
|
+
* Thus, the validation can include more expensive validation rules.
|
|
54
|
+
* There is no need to traverse through the children in this method as {@link #validate(List, String)} will invoke
|
|
55
|
+
* this method for all children anyway.
|
|
56
|
+
* </p>
|
|
57
|
+
*
|
|
58
|
+
* @param element The element to validate.
|
|
59
|
+
* @return A list of {@link Marker}s for the validated {@link GModelElement}.
|
|
60
|
+
*/
|
|
61
|
+
doBatchValidation(element: GModelElement): Marker[];
|
|
62
|
+
/**
|
|
63
|
+
* Perform a validation for a custom <code>reason</code> with the given <code>element</code>.
|
|
64
|
+
*
|
|
65
|
+
* <p>
|
|
66
|
+
* GLSP editors may add custom reasons for triggering a validation, other than <code>live</code> and
|
|
67
|
+
* <code>batch</code>.
|
|
68
|
+
* Validation requests that are not live or batch validations will be handled by this method.
|
|
69
|
+
* There is no need to traverse through the children in this method as {@link #validate(List, String)} will invoke
|
|
70
|
+
* this method for all children anyway.
|
|
71
|
+
* </p>
|
|
72
|
+
*
|
|
73
|
+
* @param element The element to validate.
|
|
74
|
+
* @return A list of {@link Marker}s for the validated {@link GModelElement}.
|
|
75
|
+
*/
|
|
76
|
+
doValidationForCustomReason(element: GModelElement): Marker[];
|
|
32
77
|
}
|
|
33
78
|
//# sourceMappingURL=model-validator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-validator.d.ts","sourceRoot":"","sources":["../../../../src/common/features/validation/model-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"model-validator.d.ts","sourceRoot":"","sources":["../../../../src/common/features/validation/model-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAiB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG7E,eAAO,MAAM,cAAc,eAA2B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC3B;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;CAChF;AAED,8BACsB,sBAAuB,YAAW,cAAc;IAClE,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE;IAiB7D;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,EAAE;IAIlD;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,EAAE;IAInD;;;;;;;;;;;;;OAaG;IACH,2BAA2B,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,EAAE;CAGhE"}
|
|
@@ -1,5 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ModelValidator = void 0;
|
|
9
|
+
exports.AbstractModelValidator = exports.ModelValidator = void 0;
|
|
10
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
11
|
+
const inversify_1 = require("inversify");
|
|
4
12
|
exports.ModelValidator = Symbol('ModelValidator');
|
|
13
|
+
let AbstractModelValidator = class AbstractModelValidator {
|
|
14
|
+
validate(elements, reason) {
|
|
15
|
+
const markers = [];
|
|
16
|
+
for (const element of elements) {
|
|
17
|
+
if (protocol_1.MarkersReason.LIVE === reason) {
|
|
18
|
+
markers.push(...this.doLiveValidation(element));
|
|
19
|
+
}
|
|
20
|
+
else if (protocol_1.MarkersReason.BATCH === reason) {
|
|
21
|
+
markers.push(...this.doBatchValidation(element));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
markers.push(...this.doValidationForCustomReason(element));
|
|
25
|
+
}
|
|
26
|
+
if (element.children) {
|
|
27
|
+
markers.push(...this.validate(element.children, reason));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return markers;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Perform the live validation rules for the given <code>element</code>.
|
|
34
|
+
*
|
|
35
|
+
* This will be invoked on start and after each operation for all elements.
|
|
36
|
+
* Thus, the validation should be rather inexpensive.
|
|
37
|
+
* There is no need to traverse through the children in this method as {@link #validate(List, String)} will invoke
|
|
38
|
+
* this method for all children anyway.
|
|
39
|
+
*
|
|
40
|
+
* @param element The element to validate.
|
|
41
|
+
* @return A list of {@link Marker}s for the validated {@link GModelElement}.
|
|
42
|
+
*/
|
|
43
|
+
doLiveValidation(element) {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Perform the batch validation rules for the given <code>element</code>.
|
|
48
|
+
*
|
|
49
|
+
* <p>
|
|
50
|
+
* This will be invoked on demand by the client.
|
|
51
|
+
* Thus, the validation can include more expensive validation rules.
|
|
52
|
+
* There is no need to traverse through the children in this method as {@link #validate(List, String)} will invoke
|
|
53
|
+
* this method for all children anyway.
|
|
54
|
+
* </p>
|
|
55
|
+
*
|
|
56
|
+
* @param element The element to validate.
|
|
57
|
+
* @return A list of {@link Marker}s for the validated {@link GModelElement}.
|
|
58
|
+
*/
|
|
59
|
+
doBatchValidation(element) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Perform a validation for a custom <code>reason</code> with the given <code>element</code>.
|
|
64
|
+
*
|
|
65
|
+
* <p>
|
|
66
|
+
* GLSP editors may add custom reasons for triggering a validation, other than <code>live</code> and
|
|
67
|
+
* <code>batch</code>.
|
|
68
|
+
* Validation requests that are not live or batch validations will be handled by this method.
|
|
69
|
+
* There is no need to traverse through the children in this method as {@link #validate(List, String)} will invoke
|
|
70
|
+
* this method for all children anyway.
|
|
71
|
+
* </p>
|
|
72
|
+
*
|
|
73
|
+
* @param element The element to validate.
|
|
74
|
+
* @return A list of {@link Marker}s for the validated {@link GModelElement}.
|
|
75
|
+
*/
|
|
76
|
+
doValidationForCustomReason(element) {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
AbstractModelValidator = __decorate([
|
|
81
|
+
(0, inversify_1.injectable)()
|
|
82
|
+
], AbstractModelValidator);
|
|
83
|
+
exports.AbstractModelValidator = AbstractModelValidator;
|
|
5
84
|
//# sourceMappingURL=model-validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-validator.js","sourceRoot":"","sources":["../../../../src/common/features/validation/model-validator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"model-validator.js","sourceRoot":"","sources":["../../../../src/common/features/validation/model-validator.ts"],"names":[],"mappings":";;;;;;;;;AAgBA,qDAA6E;AAC7E,yCAAuC;AAE1B,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAmBhD,IAAe,sBAAsB,GAArC,MAAe,sBAAsB;IACxC,QAAQ,CAAC,QAAyB,EAAE,MAAc;QAC9C,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC5B,IAAI,wBAAa,CAAC,IAAI,KAAK,MAAM,EAAE;gBAC/B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;aACnD;iBAAM,IAAI,wBAAa,CAAC,KAAK,KAAK,MAAM,EAAE;gBACvC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;aACpD;iBAAM;gBACH,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC,CAAC;aAC9D;YACD,IAAI,OAAO,CAAC,QAAQ,EAAE;gBAClB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;aAC5D;SACJ;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,OAAsB;QACnC,OAAO,EAAE,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,iBAAiB,CAAC,OAAsB;QACpC,OAAO,EAAE,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,2BAA2B,CAAC,OAAsB;QAC9C,OAAO,EAAE,CAAC;IACd,CAAC;CACJ,CAAA;AAnEqB,sBAAsB;IAD3C,IAAA,sBAAU,GAAE;GACS,sBAAsB,CAmE3C;AAnEqB,wDAAsB"}
|
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
********************************************************************************/
|
|
1
16
|
import { Action, RequestMarkersAction } from '@eclipse-glsp/protocol';
|
|
2
17
|
import { ActionHandler } from '../../actions/action-handler';
|
|
3
18
|
import { ModelState } from '../model/model-state';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-markers-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/validation/request-markers-handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"request-markers-handler.d.ts","sourceRoot":"","sources":["../../../../src/common/features/validation/request-markers-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAiB,oBAAoB,EAAoB,MAAM,wBAAwB,CAAC;AAEvG,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,qBACa,qBAAsB,YAAW,aAAa;IACvD,WAAW,WAA+B;IAEN,SAAS,EAAE,cAAc,CAAC;IAC1C,UAAU,EAAE,UAAU,CAAC;IAErC,OAAO,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAejE"}
|
|
@@ -25,7 +25,6 @@ exports.RequestMarkersHandler = void 0;
|
|
|
25
25
|
*
|
|
26
26
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
27
27
|
********************************************************************************/
|
|
28
|
-
const graph_1 = require("@eclipse-glsp/graph");
|
|
29
28
|
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
30
29
|
const inversify_1 = require("inversify");
|
|
31
30
|
const glsp_server_error_1 = require("../../utils/glsp-server-error");
|
|
@@ -36,6 +35,7 @@ let RequestMarkersHandler = class RequestMarkersHandler {
|
|
|
36
35
|
this.actionKinds = [protocol_1.RequestMarkersAction.KIND];
|
|
37
36
|
}
|
|
38
37
|
async execute(action) {
|
|
38
|
+
var _a;
|
|
39
39
|
let elementIDs = action.elementsIDs;
|
|
40
40
|
if (!this.validator) {
|
|
41
41
|
throw new glsp_server_error_1.GLSPServerError('Cannot compute markers! No implementation for ModelValidator has been bound');
|
|
@@ -43,14 +43,8 @@ let RequestMarkersHandler = class RequestMarkersHandler {
|
|
|
43
43
|
if (!elementIDs || elementIDs.length === 0 || (elementIDs.length === 1 && elementIDs[0] === 'EMPTY')) {
|
|
44
44
|
elementIDs = [this.modelState.root.id];
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
for (const elementID of elementIDs) {
|
|
49
|
-
const modelElement = currentModelIndex.findByClass(elementID, graph_1.GGraph);
|
|
50
|
-
if (modelElement) {
|
|
51
|
-
markers = markers.concat(await this.validator.validate([modelElement]));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
46
|
+
const modelElements = this.modelState.index.getAll(elementIDs);
|
|
47
|
+
const markers = await this.validator.validate(modelElements, (_a = action.reason) !== null && _a !== void 0 ? _a : protocol_1.MarkersReason.BATCH);
|
|
54
48
|
return [protocol_1.SetMarkersAction.create(markers)];
|
|
55
49
|
}
|
|
56
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-markers-handler.js","sourceRoot":"","sources":["../../../../src/common/features/validation/request-markers-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF
|
|
1
|
+
{"version":3,"file":"request-markers-handler.js","sourceRoot":"","sources":["../../../../src/common/features/validation/request-markers-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAuG;AACvG,yCAAyD;AAEzD,qEAAgE;AAChE,sDAAkD;AAClD,uDAAmD;AAG5C,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAA3B;QACH,gBAAW,GAAG,CAAC,+BAAoB,CAAC,IAAI,CAAC,CAAC;IAoB9C,CAAC;IAfG,KAAK,CAAC,OAAO,CAAC,MAA4B;;QACtC,IAAI,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACjB,MAAM,IAAI,mCAAe,CAAC,6EAA6E,CAAC,CAAC;SAC5G;QAED,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,EAAE;YAClG,UAAU,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SAC1C;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC/D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAA,MAAM,CAAC,MAAM,mCAAI,wBAAa,CAAC,KAAK,CAAC,CAAC;QAEnG,OAAO,CAAC,2BAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,CAAC;CACJ,CAAA;AAlBG;IAAC,IAAA,kBAAM,EAAC,gCAAc,CAAC;IAAE,IAAA,oBAAQ,GAAE;;wDAA2B;AAC9D;IAAC,IAAA,kBAAM,EAAC,wBAAU,CAAC;;yDAAwB;AAJlC,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CAqBjC;AArBY,sDAAqB"}
|
package/lib/common/index.d.ts
CHANGED
|
@@ -73,9 +73,7 @@ export * from './operations/create-operation-handler';
|
|
|
73
73
|
export * from './operations/operation-action-handler';
|
|
74
74
|
export * from './operations/operation-handler';
|
|
75
75
|
export * from './operations/operation-handler-registry';
|
|
76
|
-
export * from './protocol/glsp-client-proxy';
|
|
77
76
|
export * from './protocol/glsp-server';
|
|
78
|
-
export * from './protocol/glsp-server-listener';
|
|
79
77
|
export * from './session/client-session';
|
|
80
78
|
export * from './session/client-session-factory';
|
|
81
79
|
export * from './session/client-session-initializer';
|
|
@@ -83,6 +81,7 @@ export * from './session/client-session-listener';
|
|
|
83
81
|
export * from './session/client-session-manager';
|
|
84
82
|
export * from './utils/args-util';
|
|
85
83
|
export * from './utils/client-options-util';
|
|
84
|
+
export * from './utils/console-logger';
|
|
86
85
|
export * from './utils/glsp-server-error';
|
|
87
86
|
export * from './utils/layout-util';
|
|
88
87
|
export * from './utils/logger';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;A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-89,9 +89,7 @@ __exportStar(require("./operations/create-operation-handler"), exports);
|
|
|
89
89
|
__exportStar(require("./operations/operation-action-handler"), exports);
|
|
90
90
|
__exportStar(require("./operations/operation-handler"), exports);
|
|
91
91
|
__exportStar(require("./operations/operation-handler-registry"), exports);
|
|
92
|
-
__exportStar(require("./protocol/glsp-client-proxy"), exports);
|
|
93
92
|
__exportStar(require("./protocol/glsp-server"), exports);
|
|
94
|
-
__exportStar(require("./protocol/glsp-server-listener"), exports);
|
|
95
93
|
__exportStar(require("./session/client-session"), exports);
|
|
96
94
|
__exportStar(require("./session/client-session-factory"), exports);
|
|
97
95
|
__exportStar(require("./session/client-session-initializer"), exports);
|
|
@@ -99,6 +97,7 @@ __exportStar(require("./session/client-session-listener"), exports);
|
|
|
99
97
|
__exportStar(require("./session/client-session-manager"), exports);
|
|
100
98
|
__exportStar(require("./utils/args-util"), exports);
|
|
101
99
|
__exportStar(require("./utils/client-options-util"), exports);
|
|
100
|
+
__exportStar(require("./utils/console-logger"), exports);
|
|
102
101
|
__exportStar(require("./utils/glsp-server-error"), exports);
|
|
103
102
|
__exportStar(require("./utils/layout-util"), exports);
|
|
104
103
|
__exportStar(require("./utils/logger"), exports);
|
package/lib/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;AAElF,sDAAoC;AACpC,yDAAuC;AACvC,8DAA4C;AAC5C,2DAAyC;AACzC,oEAAkD;AAClD,kEAAgD;AAChD,mEAAiD;AACjD,oDAAkC;AAClC,0DAAwC;AACxC,8DAA4C;AAC5C,qEAAmD;AACnD,sDAAoC;AACpC,6DAA2C;AAC3C,sDAAoC;AACpC,mDAAiC;AACjC,qDAAmC;AACnC,qDAAmC;AACnC,2DAAyC;AACzC,kEAAgD;AAChD,8EAA4D;AAC5D,6FAA2E;AAC3E,4FAA0E;AAC1E,qFAAmE;AACnE,8FAA4E;AAC5E,uFAAqE;AACrE,4FAA0E;AAC1E,uFAAqE;AACrE,kFAAgE;AAChE,2FAAyE;AACzE,gFAA8D;AAC9D,2FAAyE;AACzE,mFAAiE;AACjE,kEAAgD;AAChD,6EAA2D;AAC3D,kEAAgD;AAChD,gEAA8C;AAC9C,qEAAmD;AACnD,+DAA6C;AAC7C,4EAA0D;AAC1D,gFAA8D;AAC9D,6EAA2D;AAC3D,wEAAsD;AACtD,4EAA0D;AAC1D,mFAAiE;AACjE,4FAA0E;AAC1E,qFAAmE;AACnE,mFAAiE;AACjE,kGAAgF;AAChF,kGAAgF;AAChF,uEAAqD;AACrD,sFAAoE;AACpE,wEAAsD;AACtD,gFAA8D;AAC9D,iDAA+B;AAC/B,gEAA8C;AAC9C,0EAAwD;AACxD,wEAAsD;AACtD,wEAAsD;AACtD,iEAA+C;AAC/C,0EAAwD;AACxD
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;AAElF,sDAAoC;AACpC,yDAAuC;AACvC,8DAA4C;AAC5C,2DAAyC;AACzC,oEAAkD;AAClD,kEAAgD;AAChD,mEAAiD;AACjD,oDAAkC;AAClC,0DAAwC;AACxC,8DAA4C;AAC5C,qEAAmD;AACnD,sDAAoC;AACpC,6DAA2C;AAC3C,sDAAoC;AACpC,mDAAiC;AACjC,qDAAmC;AACnC,qDAAmC;AACnC,2DAAyC;AACzC,kEAAgD;AAChD,8EAA4D;AAC5D,6FAA2E;AAC3E,4FAA0E;AAC1E,qFAAmE;AACnE,8FAA4E;AAC5E,uFAAqE;AACrE,4FAA0E;AAC1E,uFAAqE;AACrE,kFAAgE;AAChE,2FAAyE;AACzE,gFAA8D;AAC9D,2FAAyE;AACzE,mFAAiE;AACjE,kEAAgD;AAChD,6EAA2D;AAC3D,kEAAgD;AAChD,gEAA8C;AAC9C,qEAAmD;AACnD,+DAA6C;AAC7C,4EAA0D;AAC1D,gFAA8D;AAC9D,6EAA2D;AAC3D,wEAAsD;AACtD,4EAA0D;AAC1D,mFAAiE;AACjE,4FAA0E;AAC1E,qFAAmE;AACnE,mFAAiE;AACjE,kGAAgF;AAChF,kGAAgF;AAChF,uEAAqD;AACrD,sFAAoE;AACpE,wEAAsD;AACtD,gFAA8D;AAC9D,iDAA+B;AAC/B,gEAA8C;AAC9C,0EAAwD;AACxD,wEAAsD;AACtD,wEAAsD;AACtD,iEAA+C;AAC/C,0EAAwD;AACxD,yDAAuC;AACvC,2DAAyC;AACzC,mEAAiD;AACjD,uEAAqD;AACrD,oEAAkD;AAClD,mEAAiD;AACjD,oDAAkC;AAClC,8DAA4C;AAC5C,yDAAuC;AACvC,4DAA0C;AAC1C,sDAAoC;AACpC,iDAA+B;AAC/B,wDAAsC;AACtC,mDAAiC"}
|
|
@@ -24,7 +24,7 @@ export declare abstract class GLSPServerLauncher<T> implements Disposable {
|
|
|
24
24
|
protected toDispose: DisposableCollection;
|
|
25
25
|
protected parentContainer?: Container;
|
|
26
26
|
configure(serverModule: ServerModule, ...additionalModules: ContainerModule[]): void;
|
|
27
|
-
createContainer(): Container;
|
|
27
|
+
createContainer(...additionalModules: ContainerModule[]): Container;
|
|
28
28
|
start(startParams: T): MaybePromise<void>;
|
|
29
29
|
protected abstract run(startParams: T): MaybePromise<void>;
|
|
30
30
|
shutdown(): MaybePromise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-server-launcher.d.ts","sourceRoot":"","sources":["../../../src/common/launch/glsp-server-launcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAgC,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAA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;IAMnE,KAAK,CAAC,WAAW,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC;IAQzC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC;IAE1D,QAAQ,IAAI,YAAY,CAAC,IAAI,CAAC;IAU9B,SAAS,CAAC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC;IAIpC,OAAO,IAAI,IAAI;IAIf,IAAI,OAAO,IAAI,eAAe,EAAE,CAK/B;CACJ"}
|
|
@@ -37,9 +37,9 @@ let GLSPServerLauncher = class GLSPServerLauncher {
|
|
|
37
37
|
configure(serverModule, ...additionalModules) {
|
|
38
38
|
this._modules.push(serverModule, ...additionalModules);
|
|
39
39
|
}
|
|
40
|
-
createContainer() {
|
|
40
|
+
createContainer(...additionalModules) {
|
|
41
41
|
const container = this.parentContainer ? this.parentContainer.createChild() : new inversify_1.Container();
|
|
42
|
-
container.load(...this._modules);
|
|
42
|
+
container.load(...this._modules, ...additionalModules);
|
|
43
43
|
return container;
|
|
44
44
|
}
|
|
45
45
|
start(startParams) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-server-launcher.js","sourceRoot":"","sources":["../../../src/common/launch/glsp-server-launcher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAwF;AACxF,yCAAqF;AAErF,mEAA+D;AAC/D,4CAAyC;AAGlC,IAAe,kBAAkB,GAAjC,MAAe,kBAAkB;IAAjC;QAGO,aAAQ,GAAsB,EAAE,CAAC;QAEjC,cAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAgDrD,CAAC;IA5CG,SAAS,CAAC,YAA0B,EAAE,GAAG,iBAAoC;QACzE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,iBAAiB,CAAC,CAAC;IAC3D,CAAC;IAED,eAAe;
|
|
1
|
+
{"version":3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SACjB;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;IAC1E,CAAC;IAES,IAAI;QACV,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,OAAO;QACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,OAAO;QACP,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;SACzE;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;CACJ,CAAA;AApDG;IAAC,IAAA,kBAAM,EAAC,eAAM,CAAC;8BAAmB,eAAM;kDAAC;AAMzC;IAAC,IAAA,kBAAM,EAAC,wCAAkB,CAAC;IAAE,IAAA,oBAAQ,GAAE;8BAA6B,qBAAS;2DAAC;AAP5D,kBAAkB;IADvC,IAAA,sBAAU,GAAE;GACS,kBAAkB,CAqDvC;AArDqB,gDAAkB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 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 { GLSPClientProxy, GLSPServer } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { Container, ContainerModule } from 'inversify';
|
|
18
|
+
import * as jsonrpc from 'vscode-jsonrpc';
|
|
19
|
+
import { Logger } from '../utils/logger';
|
|
20
|
+
import { GLSPServerLauncher } from './glsp-server-launcher';
|
|
21
|
+
export declare const START_UP_COMPLETE_MSG = "[GLSP-Server]:Startup completed. Accepting requests on port:";
|
|
22
|
+
export interface JsonRpcServerInstance {
|
|
23
|
+
server: GLSPServer;
|
|
24
|
+
clientConnection: jsonrpc.MessageConnection;
|
|
25
|
+
container: Container;
|
|
26
|
+
}
|
|
27
|
+
export declare abstract class JsonRpcGLSPServerLauncher<T> extends GLSPServerLauncher<T> {
|
|
28
|
+
protected logger: Logger;
|
|
29
|
+
protected serverInstances: Map<jsonrpc.MessageConnection, JsonRpcServerInstance>;
|
|
30
|
+
protected startupCompleteMessage: string;
|
|
31
|
+
constructor();
|
|
32
|
+
protected disposeServerInstance(instance: JsonRpcServerInstance): void;
|
|
33
|
+
protected createServerInstance(clientConnection: jsonrpc.MessageConnection): void;
|
|
34
|
+
protected createJsonRpcModule(clientConnection: jsonrpc.MessageConnection): ContainerModule;
|
|
35
|
+
protected configureClientConnection(serverInstance: JsonRpcServerInstance): void;
|
|
36
|
+
protected createClientProxy(serverInstance: JsonRpcServerInstance): GLSPClientProxy;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=jsonrpc-server-launcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonrpc-server-launcher.d.ts","sourceRoot":"","sources":["../../../src/common/launch/jsonrpc-server-launcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAEH,eAAe,EACf,UAAU,EAIb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAsB,MAAM,WAAW,CAAC;AAC3E,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,eAAO,MAAM,qBAAqB,iEAAiE,CAAC;AAEpG,MAAM,WAAW,qBAAqB;IAClC,MAAM,EAAE,UAAU,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC,iBAAiB,CAAC;IAC5C,SAAS,EAAE,SAAS,CAAC;CACxB;AAED,8BACsB,yBAAyB,CAAC,CAAC,CAAE,SAAQ,kBAAkB,CAAC,CAAC,CAAC;IAC5E,UACmB,MAAM,EAAE,MAAM,CAAC;IAElC,SAAS,CAAC,eAAe,wDAA+D;IACxF,SAAS,CAAC,sBAAsB,SAAyB;;IAWzD,SAAS,CAAC,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAOtE,SAAS,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,OAAO,CAAC,iBAAiB,GAAG,IAAI;IAQjF,SAAS,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,OAAO,CAAC,iBAAiB,GAAG,eAAe;IAU3F,SAAS,CAAC,yBAAyB,CAAC,cAAc,EAAE,qBAAqB,GAAG,IAAI;IAUhF,SAAS,CAAC,iBAAiB,CAAC,cAAc,EAAE,qBAAqB,GAAG,eAAe;CAKtF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2023 EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
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;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.JsonRpcGLSPServerLauncher = exports.START_UP_COMPLETE_MSG = void 0;
|
|
28
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
29
|
+
const inversify_1 = require("inversify");
|
|
30
|
+
const logger_1 = require("../utils/logger");
|
|
31
|
+
const glsp_server_launcher_1 = require("./glsp-server-launcher");
|
|
32
|
+
exports.START_UP_COMPLETE_MSG = '[GLSP-Server]:Startup completed. Accepting requests on port:';
|
|
33
|
+
let JsonRpcGLSPServerLauncher = class JsonRpcGLSPServerLauncher extends glsp_server_launcher_1.GLSPServerLauncher {
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
this.serverInstances = new Map();
|
|
37
|
+
this.startupCompleteMessage = exports.START_UP_COMPLETE_MSG;
|
|
38
|
+
this.toDispose.push(protocol_1.Disposable.create(() => {
|
|
39
|
+
this.serverInstances.forEach(instance => this.disposeServerInstance(instance));
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
disposeServerInstance(instance) {
|
|
43
|
+
this.serverInstances.delete(instance.clientConnection);
|
|
44
|
+
instance.server.shutdown();
|
|
45
|
+
instance.container.unbindAll();
|
|
46
|
+
instance.clientConnection.dispose();
|
|
47
|
+
}
|
|
48
|
+
createServerInstance(clientConnection) {
|
|
49
|
+
const container = this.createContainer(this.createJsonRpcModule(clientConnection));
|
|
50
|
+
const server = container.get(protocol_1.GLSPServer);
|
|
51
|
+
const instance = { container, clientConnection, server };
|
|
52
|
+
this.serverInstances.set(clientConnection, instance);
|
|
53
|
+
this.configureClientConnection(instance);
|
|
54
|
+
}
|
|
55
|
+
createJsonRpcModule(clientConnection) {
|
|
56
|
+
return new inversify_1.ContainerModule(bind => {
|
|
57
|
+
bind(protocol_1.GLSPClientProxy).toDynamicValue(ctx => {
|
|
58
|
+
const proxy = ctx.container.resolve(protocol_1.JsonrpcClientProxy);
|
|
59
|
+
proxy.initialize(clientConnection);
|
|
60
|
+
return proxy;
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
configureClientConnection(serverInstance) {
|
|
65
|
+
(0, protocol_1.configureClientConnection)(serverInstance.clientConnection, serverInstance.server);
|
|
66
|
+
serverInstance.clientConnection.onNotification(protocol_1.JsonrpcGLSPClient.ShutdownNotification, () => this.disposeServerInstance(serverInstance));
|
|
67
|
+
this.logger.info('Starting GLSP server connection');
|
|
68
|
+
}
|
|
69
|
+
createClientProxy(serverInstance) {
|
|
70
|
+
const proxy = serverInstance.container.resolve(protocol_1.JsonrpcClientProxy);
|
|
71
|
+
proxy.initialize(serverInstance.clientConnection);
|
|
72
|
+
return proxy;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, inversify_1.inject)(logger_1.Logger),
|
|
77
|
+
__metadata("design:type", logger_1.Logger)
|
|
78
|
+
], JsonRpcGLSPServerLauncher.prototype, "logger", void 0);
|
|
79
|
+
JsonRpcGLSPServerLauncher = __decorate([
|
|
80
|
+
(0, inversify_1.injectable)(),
|
|
81
|
+
__metadata("design:paramtypes", [])
|
|
82
|
+
], JsonRpcGLSPServerLauncher);
|
|
83
|
+
exports.JsonRpcGLSPServerLauncher = JsonRpcGLSPServerLauncher;
|
|
84
|
+
//# sourceMappingURL=jsonrpc-server-launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonrpc-server-launcher.js","sourceRoot":"","sources":["../../../src/common/launch/jsonrpc-server-launcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,qDAOgC;AAChC,yCAA2E;AAE3E,4CAAyC;AACzC,iEAA4D;AAE/C,QAAA,qBAAqB,GAAG,8DAA8D,CAAC;AAS7F,IAAe,yBAAyB,GAAxC,MAAe,yBAA6B,SAAQ,yCAAqB;IAO5E;QACI,KAAK,EAAE,CAAC;QAJF,oBAAe,GAAG,IAAI,GAAG,EAAoD,CAAC;QAC9E,2BAAsB,GAAG,6BAAqB,CAAC;QAIrD,IAAI,CAAC,SAAS,CAAC,IAAI,CACf,qBAAU,CAAC,MAAM,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC;QACnF,CAAC,CAAC,CACL,CAAC;IACN,CAAC;IAES,qBAAqB,CAAC,QAA+B;QAC3D,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QACvD,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC3B,QAAQ,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;QAC/B,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;IACxC,CAAC;IAES,oBAAoB,CAAC,gBAA2C;QACtE,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,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