@eclipse-glsp/server 1.1.0-RC08 → 1.1.0-RC09
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/package.json +4 -4
- package/lib/common/actions/action-dispatcher.spec.d.ts +0 -2
- package/lib/common/actions/action-dispatcher.spec.d.ts.map +0 -1
- package/lib/common/actions/action-dispatcher.spec.js +0 -264
- package/lib/common/actions/action-dispatcher.spec.js.map +0 -1
- package/lib/common/actions/action-handler-registry.spec.d.ts +0 -2
- package/lib/common/actions/action-handler-registry.spec.d.ts.map +0 -1
- package/lib/common/actions/action-handler-registry.spec.js +0 -50
- package/lib/common/actions/action-handler-registry.spec.js.map +0 -1
- package/lib/common/actions/global-action-provider.spec.d.ts +0 -2
- package/lib/common/actions/global-action-provider.spec.d.ts.map +0 -1
- package/lib/common/actions/global-action-provider.spec.js +0 -70
- package/lib/common/actions/global-action-provider.spec.js.map +0 -1
- package/lib/common/command/command-stack.spec.d.ts +0 -2
- package/lib/common/command/command-stack.spec.d.ts.map +0 -1
- package/lib/common/command/command-stack.spec.js +0 -207
- package/lib/common/command/command-stack.spec.js.map +0 -1
- package/lib/common/command/command.spec.d.ts +0 -2
- package/lib/common/command/command.spec.d.ts.map +0 -1
- package/lib/common/command/command.spec.js +0 -86
- package/lib/common/command/command.spec.js.map +0 -1
- package/lib/common/command/recording-command.spec.d.ts +0 -17
- package/lib/common/command/recording-command.spec.d.ts.map +0 -1
- package/lib/common/command/recording-command.spec.js +0 -62
- package/lib/common/command/recording-command.spec.js.map +0 -1
- package/lib/common/di/binding-target.spec.d.ts +0 -2
- package/lib/common/di/binding-target.spec.d.ts.map +0 -1
- package/lib/common/di/binding-target.spec.js +0 -121
- package/lib/common/di/binding-target.spec.js.map +0 -1
- package/lib/common/di/multi-bindings.spec.d.ts +0 -2
- package/lib/common/di/multi-bindings.spec.d.ts.map +0 -1
- package/lib/common/di/multi-bindings.spec.js +0 -137
- package/lib/common/di/multi-bindings.spec.js.map +0 -1
- package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts +0 -2
- package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts.map +0 -1
- package/lib/common/diagram/request-type-hints-action-handler.spec.js +0 -57
- package/lib/common/diagram/request-type-hints-action-handler.spec.js.map +0 -1
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts +0 -2
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts.map +0 -1
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.js +0 -34
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.js.map +0 -1
- package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts +0 -2
- package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts.map +0 -1
- package/lib/common/features/contextactions/request-context-actions-handler.spec.js +0 -63
- package/lib/common/features/contextactions/request-context-actions-handler.spec.js.map +0 -1
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts +0 -2
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts.map +0 -1
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.js +0 -48
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.js.map +0 -1
- package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts +0 -2
- package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts.map +0 -1
- package/lib/common/features/directediting/context-edit-validator-registry.spec.js +0 -44
- package/lib/common/features/directediting/context-edit-validator-registry.spec.js.map +0 -1
- package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts +0 -2
- package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts.map +0 -1
- package/lib/common/features/directediting/request-edit-validation-handler.spec.js +0 -97
- package/lib/common/features/directediting/request-edit-validation-handler.spec.js.map +0 -1
- package/lib/common/features/model/gmodel-serializer.spec.d.ts +0 -2
- package/lib/common/features/model/gmodel-serializer.spec.d.ts.map +0 -1
- package/lib/common/features/model/gmodel-serializer.spec.js +0 -124
- package/lib/common/features/model/gmodel-serializer.spec.js.map +0 -1
- package/lib/common/operations/operation-handler-registry.spec.d.ts +0 -2
- package/lib/common/operations/operation-handler-registry.spec.d.ts.map +0 -1
- package/lib/common/operations/operation-handler-registry.spec.js +0 -50
- package/lib/common/operations/operation-handler-registry.spec.js.map +0 -1
- package/lib/common/protocol/glsp-server.spec.d.ts +0 -2
- package/lib/common/protocol/glsp-server.spec.d.ts.map +0 -1
- package/lib/common/protocol/glsp-server.spec.js +0 -132
- package/lib/common/protocol/glsp-server.spec.js.map +0 -1
- package/lib/common/session/client-session-factory.spec.d.ts +0 -2
- package/lib/common/session/client-session-factory.spec.d.ts.map +0 -1
- package/lib/common/session/client-session-factory.spec.js +0 -56
- package/lib/common/session/client-session-factory.spec.js.map +0 -1
- package/lib/common/session/client-session-manager.spec.d.ts +0 -2
- package/lib/common/session/client-session-manager.spec.d.ts.map +0 -1
- package/lib/common/session/client-session-manager.spec.js +0 -74
- package/lib/common/session/client-session-manager.spec.js.map +0 -1
- package/lib/common/test/mock-util.d.ts +0 -120
- package/lib/common/test/mock-util.d.ts.map +0 -1
- package/lib/common/test/mock-util.js +0 -216
- package/lib/common/test/mock-util.js.map +0 -1
- package/lib/common/utils/promise-queue.spec.d.ts +0 -2
- package/lib/common/utils/promise-queue.spec.d.ts.map +0 -1
- package/lib/common/utils/promise-queue.spec.js +0 -117
- package/lib/common/utils/promise-queue.spec.js.map +0 -1
- package/lib/common/utils/registry.spec.d.ts +0 -2
- package/lib/common/utils/registry.spec.d.ts.map +0 -1
- package/lib/common/utils/registry.spec.js +0 -199
- package/lib/common/utils/registry.spec.js.map +0 -1
- package/lib/node/launch/cli-parser.spec.d.ts +0 -2
- package/lib/node/launch/cli-parser.spec.d.ts.map +0 -1
- package/lib/node/launch/cli-parser.spec.js +0 -56
- package/lib/node/launch/cli-parser.spec.js.map +0 -1
- package/lib/node/launch/socket-cli-parser.spec.d.ts +0 -2
- package/lib/node/launch/socket-cli-parser.spec.d.ts.map +0 -1
- package/lib/node/launch/socket-cli-parser.spec.js +0 -66
- package/lib/node/launch/socket-cli-parser.spec.js.map +0 -1
- package/lib/node/launch/socket-server-launcher.spec.d.ts +0 -17
- package/lib/node/launch/socket-server-launcher.spec.d.ts.map +0 -1
- package/lib/node/launch/socket-server-launcher.spec.js +0 -75
- package/lib/node/launch/socket-server-launcher.spec.js.map +0 -1
|
@@ -1,137 +0,0 @@
|
|
|
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
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
/********************************************************************************
|
|
10
|
-
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
11
|
-
*
|
|
12
|
-
* This program and the accompanying materials are made available under the
|
|
13
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
14
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
15
|
-
*
|
|
16
|
-
* This Source Code may also be made available under the following Secondary
|
|
17
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
18
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
19
|
-
* with the GNU Classpath Exception which is available at
|
|
20
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
21
|
-
*
|
|
22
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
23
|
-
********************************************************************************/
|
|
24
|
-
const chai_1 = require("chai");
|
|
25
|
-
const inversify_1 = require("inversify");
|
|
26
|
-
const multi_binding_1 = require("./multi-binding");
|
|
27
|
-
let TestClass = class TestClass {
|
|
28
|
-
};
|
|
29
|
-
TestClass = __decorate([
|
|
30
|
-
(0, inversify_1.injectable)()
|
|
31
|
-
], TestClass);
|
|
32
|
-
let TestClass1 = class TestClass1 extends TestClass {
|
|
33
|
-
};
|
|
34
|
-
TestClass1 = __decorate([
|
|
35
|
-
(0, inversify_1.injectable)()
|
|
36
|
-
], TestClass1);
|
|
37
|
-
let TestClass2 = class TestClass2 extends TestClass {
|
|
38
|
-
};
|
|
39
|
-
TestClass2 = __decorate([
|
|
40
|
-
(0, inversify_1.injectable)()
|
|
41
|
-
], TestClass2);
|
|
42
|
-
let TestClass3 = class TestClass3 extends TestClass {
|
|
43
|
-
};
|
|
44
|
-
TestClass3 = __decorate([
|
|
45
|
-
(0, inversify_1.injectable)()
|
|
46
|
-
], TestClass3);
|
|
47
|
-
describe('test implementations of MultiBinding', () => {
|
|
48
|
-
describe('test basic functionaly (ClassMultiBinding) ', () => {
|
|
49
|
-
const binding = new multi_binding_1.MultiBinding('TestClass');
|
|
50
|
-
it('add - new binding', () => {
|
|
51
|
-
binding.add(TestClass1);
|
|
52
|
-
(0, chai_1.expect)(binding.contains(TestClass1)).true;
|
|
53
|
-
const result = binding.getAll();
|
|
54
|
-
(0, chai_1.expect)(result.length).to.be.equal(1);
|
|
55
|
-
(0, chai_1.expect)(result[0]).to.be.equal(TestClass1);
|
|
56
|
-
});
|
|
57
|
-
it('add - existing binding', () => {
|
|
58
|
-
binding.add(TestClass1);
|
|
59
|
-
(0, chai_1.expect)(binding.getAll().length).to.be.equal(1);
|
|
60
|
-
(0, chai_1.expect)(binding.getAll()[0]).to.be.equal(TestClass1);
|
|
61
|
-
});
|
|
62
|
-
it('remove - existing binding', () => {
|
|
63
|
-
(0, chai_1.expect)(binding.contains(TestClass1)).true;
|
|
64
|
-
binding.remove(TestClass1);
|
|
65
|
-
(0, chai_1.expect)(binding.contains(TestClass1)).false;
|
|
66
|
-
(0, chai_1.expect)(binding.getAll()).to.have.length(0);
|
|
67
|
-
});
|
|
68
|
-
it('remove - non-existing binding', () => {
|
|
69
|
-
const previousSize = binding.getAll().length;
|
|
70
|
-
binding.remove(TestClass2);
|
|
71
|
-
(0, chai_1.expect)(binding.getAll()).to.have.length(previousSize);
|
|
72
|
-
});
|
|
73
|
-
it('addAll - TestClass1 & TestClass2', () => {
|
|
74
|
-
binding.addAll([TestClass1, TestClass2]);
|
|
75
|
-
const result = binding.getAll();
|
|
76
|
-
(0, chai_1.expect)(result.length).to.be.equal(2);
|
|
77
|
-
(0, chai_1.expect)(result.includes(TestClass1)).true;
|
|
78
|
-
(0, chai_1.expect)(result.includes(TestClass2)).true;
|
|
79
|
-
});
|
|
80
|
-
it('rebind- TestClass2 to TestClass3', () => {
|
|
81
|
-
binding.rebind(TestClass2, TestClass3);
|
|
82
|
-
const result = binding.getAll();
|
|
83
|
-
(0, chai_1.expect)(result.length).to.be.equal(2);
|
|
84
|
-
(0, chai_1.expect)(result.includes(TestClass1)).true;
|
|
85
|
-
(0, chai_1.expect)(result.includes(TestClass3)).true;
|
|
86
|
-
});
|
|
87
|
-
it('rebind- TestClass2 to TestClass3- should fail', () => {
|
|
88
|
-
binding.rebind(TestClass2, TestClass3);
|
|
89
|
-
const result = binding.getAll();
|
|
90
|
-
(0, chai_1.expect)(result.length).to.be.equal(2);
|
|
91
|
-
(0, chai_1.expect)(result.includes(TestClass1)).true;
|
|
92
|
-
(0, chai_1.expect)(result.includes(TestClass3)).true;
|
|
93
|
-
});
|
|
94
|
-
it('removeAll- TestClass1 & TestClass3', () => {
|
|
95
|
-
binding.removeAll([TestClass1, TestClass3]);
|
|
96
|
-
const result = binding.getAll();
|
|
97
|
-
(0, chai_1.expect)(result).to.have.length(0);
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
describe('test applyBinding', () => {
|
|
101
|
-
it('apply binding of ClassMultiBinding', () => {
|
|
102
|
-
const testContainer = new inversify_1.Container();
|
|
103
|
-
const testModule = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
104
|
-
const context = { bind, unbind, isBound, rebind };
|
|
105
|
-
const binding = new multi_binding_1.MultiBinding('TestClass');
|
|
106
|
-
binding.addAll([TestClass1, TestClass2, TestClass3]);
|
|
107
|
-
binding.applyBindings(context);
|
|
108
|
-
});
|
|
109
|
-
testContainer.load(testModule);
|
|
110
|
-
const result = testContainer.getAll('TestClass');
|
|
111
|
-
(0, chai_1.expect)(result).to.have.length(3);
|
|
112
|
-
(0, chai_1.expect)(result.find(instance => instance instanceof TestClass1)).to.not.be.undefined;
|
|
113
|
-
(0, chai_1.expect)(result.find(instance => instance instanceof TestClass2)).to.not.be.undefined;
|
|
114
|
-
(0, chai_1.expect)(result.find(instance => instance instanceof TestClass3)).to.not.be.undefined;
|
|
115
|
-
});
|
|
116
|
-
it('apply binding of InstanceMultiBinding', () => {
|
|
117
|
-
const t1 = 't1';
|
|
118
|
-
const t2 = 't2';
|
|
119
|
-
const t3 = 't3';
|
|
120
|
-
const identifier = 'myStrings';
|
|
121
|
-
const testContainer = new inversify_1.Container();
|
|
122
|
-
const testModule = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
123
|
-
const context = { bind, unbind, isBound, rebind };
|
|
124
|
-
const binding = new multi_binding_1.InstanceMultiBinding(identifier);
|
|
125
|
-
binding.addAll([t1, t2, t3]);
|
|
126
|
-
binding.applyBindings(context);
|
|
127
|
-
});
|
|
128
|
-
testContainer.load(testModule);
|
|
129
|
-
const result = testContainer.get(identifier);
|
|
130
|
-
(0, chai_1.expect)(result).to.have.length(3);
|
|
131
|
-
(0, chai_1.expect)(result.includes(t1)).true;
|
|
132
|
-
(0, chai_1.expect)(result.includes(t2)).true;
|
|
133
|
-
(0, chai_1.expect)(result.includes(t3)).true;
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
//# sourceMappingURL=multi-bindings.sp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EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACjC,IAAA,aAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YACjC,IAAA,aAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YACjC,IAAA,aAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-type-hints-action-handler.spec.d.ts","sourceRoot":"","sources":["../../../src/common/diagram/request-type-hints-action-handler.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/********************************************************************************
|
|
4
|
-
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
5
|
-
*
|
|
6
|
-
* This program and the accompanying materials are made available under the
|
|
7
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
-
*
|
|
10
|
-
* This Source Code may also be made available under the following Secondary
|
|
11
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
-
* with the GNU Classpath Exception which is available at
|
|
14
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
15
|
-
*
|
|
16
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
17
|
-
********************************************************************************/
|
|
18
|
-
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
19
|
-
const chai_1 = require("chai");
|
|
20
|
-
const inversify_1 = require("inversify");
|
|
21
|
-
const mock = require("../test/mock-util");
|
|
22
|
-
const diagram_configuration_1 = require("./diagram-configuration");
|
|
23
|
-
const request_type_hints_action_handler_1 = require("./request-type-hints-action-handler");
|
|
24
|
-
describe('test RequestTypeHintsActionHandler', () => {
|
|
25
|
-
const container = new inversify_1.Container();
|
|
26
|
-
const diagramConfiguration = new mock.StubDiagramConfiguration();
|
|
27
|
-
const shapeTypeHint = {
|
|
28
|
-
elementTypeId: 'test',
|
|
29
|
-
deletable: true,
|
|
30
|
-
resizable: true,
|
|
31
|
-
repositionable: true,
|
|
32
|
-
reparentable: true
|
|
33
|
-
};
|
|
34
|
-
const edgeTypeHint = {
|
|
35
|
-
elementTypeId: 'test',
|
|
36
|
-
deletable: true,
|
|
37
|
-
repositionable: true,
|
|
38
|
-
routable: true,
|
|
39
|
-
sourceElementTypeIds: [],
|
|
40
|
-
targetElementTypeIds: []
|
|
41
|
-
};
|
|
42
|
-
diagramConfiguration.shapeTypeHints = [shapeTypeHint];
|
|
43
|
-
diagramConfiguration.edgeTypeHints = [edgeTypeHint];
|
|
44
|
-
container.load(new inversify_1.ContainerModule(bind => {
|
|
45
|
-
bind(diagram_configuration_1.DiagramConfiguration).toConstantValue(diagramConfiguration);
|
|
46
|
-
}));
|
|
47
|
-
const handler = container.resolve(request_type_hints_action_handler_1.RequestTypeHintsActionHandler);
|
|
48
|
-
it('execute with correct action', async () => {
|
|
49
|
-
const result = await handler.execute(protocol_1.RequestTypeHintsAction.create());
|
|
50
|
-
(0, chai_1.expect)(result).to.have.length(1);
|
|
51
|
-
(0, chai_1.expect)(protocol_1.SetTypeHintsAction.is(result[0])).true;
|
|
52
|
-
(0, chai_1.expect)(result).to.be.deep.equal([
|
|
53
|
-
{ edgeHints: [edgeTypeHint], kind: 'setTypeHints', shapeHints: [shapeTypeHint], responseId: '' }
|
|
54
|
-
]);
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
//# sourceMappingURL=request-type-hints-action-handler.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-type-hints-action-handler.spec.js","sourceRoot":"","sources":["../../../src/common/diagram/request-type-hints-action-handler.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAiH;AACjH,+BAA8B;AAC9B,yCAAuD;AACvD,0CAA0C;AAC1C,mEAA+D;AAC/D,2FAAoF;AAEpF,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAChD,MAAM,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;IAClC,MAAM,oBAAoB,GAAG,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACjE,MAAM,aAAa,GAAkB;QACjC,aAAa,EAAE,MAAM;QACrB,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,IAAI;QACf,cAAc,EAAE,IAAI;QACpB,YAAY,EAAE,IAAI;KACrB,CAAC;IACF,MAAM,YAAY,GAAiB;QAC/B,aAAa,EAAE,MAAM;QACrB,SAAS,EAAE,IAAI;QACf,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE,IAAI;QACd,oBAAoB,EAAE,EAAE;QACxB,oBAAoB,EAAE,EAAE;KAC3B,CAAC;IACF,oBAAoB,CAAC,cAAc,GAAG,CAAC,aAAa,CAAC,CAAC;IACtD,oBAAoB,CAAC,aAAa,GAAG,CAAC,YAAY,CAAC,CAAC;IACpD,SAAS,CAAC,IAAI,CACV,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;QACvB,IAAI,CAAC,4CAAoB,CAAC,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC;IACrE,CAAC,CAAC,CACL,CAAC;IACF,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,iEAA6B,CAAC,CAAC;IAEjE,EAAE,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,iCAAsB,CAAC,MAAM,EAAE,CAAC,CAAC;QAEtE,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACjC,IAAA,aAAM,EAAC,6BAAkB,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;YAC5B,EAAE,SAAS,EAAE,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,aAAa,CAAC,EAAE,UAAU,EAAE,EAAE,EAAwB;SACzH,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-actions-provider-registry.spec.d.ts","sourceRoot":"","sources":["../../../../src/common/features/contextactions/context-actions-provider-registry.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const command_palette_action_provider_1 = require("./command-palette-action-provider");
|
|
4
|
-
const context_actions_provider_registry_1 = require("./context-actions-provider-registry");
|
|
5
|
-
const tool_palette_item_provider_1 = require("./tool-palette-item-provider");
|
|
6
|
-
const chai_1 = require("chai");
|
|
7
|
-
describe('Test DefaultContextActionsProviderRegistry', () => {
|
|
8
|
-
it('check if default registry is empty', () => {
|
|
9
|
-
const contextActionsProvider = [];
|
|
10
|
-
const contextActionsProviderRegistry = new context_actions_provider_registry_1.ContextActionsProviderRegistry(contextActionsProvider);
|
|
11
|
-
(0, chai_1.expect)(contextActionsProviderRegistry.keys()).to.have.length(0);
|
|
12
|
-
});
|
|
13
|
-
it('register DefaultToolPaletteItemProvider via ContextActionsProviders list', () => {
|
|
14
|
-
const contextActionsProvider = [new tool_palette_item_provider_1.DefaultToolPaletteItemProvider()];
|
|
15
|
-
const contextActionsProviderRegistry = new context_actions_provider_registry_1.ContextActionsProviderRegistry(contextActionsProvider);
|
|
16
|
-
(0, chai_1.expect)(contextActionsProviderRegistry.keys()).to.have.length(1);
|
|
17
|
-
});
|
|
18
|
-
it('register DefaultToolPaletteItemProvider via ToolPaletteItemProvider', () => {
|
|
19
|
-
const contextActionsProvider = [];
|
|
20
|
-
const contextActionsProviderRegistry = new context_actions_provider_registry_1.ContextActionsProviderRegistry(contextActionsProvider, undefined, undefined, new tool_palette_item_provider_1.DefaultToolPaletteItemProvider());
|
|
21
|
-
(0, chai_1.expect)(contextActionsProviderRegistry.keys()).to.have.length(1);
|
|
22
|
-
});
|
|
23
|
-
it('register CustomCommandPaletteActionProvider via CommandPaletteActionProvider', () => {
|
|
24
|
-
class CustomCommandPaletteActionProvider extends command_palette_action_provider_1.CommandPaletteActionProvider {
|
|
25
|
-
getPaletteActions(_selectedElementIds, _selectedElements, _position, _args) {
|
|
26
|
-
return [];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const contextActionsProvider = [];
|
|
30
|
-
const contextActionsProviderRegistry = new context_actions_provider_registry_1.ContextActionsProviderRegistry(contextActionsProvider, undefined, new CustomCommandPaletteActionProvider(), undefined);
|
|
31
|
-
(0, chai_1.expect)(contextActionsProviderRegistry.keys()).to.have.length(1);
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=context-actions-provider-registry.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-actions-provider-registry.spec.js","sourceRoot":"","sources":["../../../../src/common/features/contextactions/context-actions-provider-registry.spec.ts"],"names":[],"mappings":";;AAiBA,uFAAiF;AAEjF,2FAAqF;AACrF,6EAA8E;AAC9E,+BAA8B;AAE9B,QAAQ,CAAC,4CAA4C,EAAE,GAAG,EAAE;IACxD,EAAE,CAAC,oCAAoC,EAAE,G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kCAAkC,EAAE,EACxC,SAAS,CACZ,CAAC;QACF,IAAA,aAAM,EAAC,8BAA8B,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-context-actions-handler.spec.d.ts","sourceRoot":"","sources":["../../../../src/common/features/contextactions/request-context-actions-handler.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/********************************************************************************
|
|
4
|
-
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
5
|
-
*
|
|
6
|
-
* This program and the accompanying materials are made available under the
|
|
7
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
-
*
|
|
10
|
-
* This Source Code may also be made available under the following Secondary
|
|
11
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
-
* with the GNU Classpath Exception which is available at
|
|
14
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
15
|
-
*
|
|
16
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
17
|
-
********************************************************************************/
|
|
18
|
-
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
19
|
-
const chai_1 = require("chai");
|
|
20
|
-
const operation_handler_registry_1 = require("../../operations/operation-handler-registry");
|
|
21
|
-
const mock = require("../../test/mock-util");
|
|
22
|
-
const context_actions_provider_registry_1 = require("./context-actions-provider-registry");
|
|
23
|
-
const request_context_actions_handler_1 = require("./request-context-actions-handler");
|
|
24
|
-
const tool_palette_item_provider_1 = require("./tool-palette-item-provider");
|
|
25
|
-
describe('Test RequestContextActionsHandler', () => {
|
|
26
|
-
const operationHandlerRegistry = new operation_handler_registry_1.OperationHandlerRegistry();
|
|
27
|
-
const stubANode = new mock.StubCreateNodeOperationHandler('ANode');
|
|
28
|
-
const stubBNode = new mock.StubCreateNodeOperationHandler('BNode');
|
|
29
|
-
const stubAEdge = new mock.StubCreateEdgeOperationHandler('AEdge');
|
|
30
|
-
const stubBEdge = new mock.StubCreateEdgeOperationHandler('BEdge');
|
|
31
|
-
operationHandlerRegistry.registerHandler(stubBNode);
|
|
32
|
-
operationHandlerRegistry.registerHandler(stubANode);
|
|
33
|
-
operationHandlerRegistry.registerHandler(stubBEdge);
|
|
34
|
-
operationHandlerRegistry.registerHandler(stubAEdge);
|
|
35
|
-
const contextActionsProvider = [];
|
|
36
|
-
const toolPaletteItemProvider = new tool_palette_item_provider_1.DefaultToolPaletteItemProvider();
|
|
37
|
-
toolPaletteItemProvider.operationHandlerRegistry = operationHandlerRegistry;
|
|
38
|
-
const contextActionsProviderRegistry = new context_actions_provider_registry_1.ContextActionsProviderRegistry(contextActionsProvider, undefined, undefined, toolPaletteItemProvider);
|
|
39
|
-
const requestContextActionsHandler = new request_context_actions_handler_1.RequestContextActionsHandler();
|
|
40
|
-
requestContextActionsHandler['contextActionsProviderRegistry'] = contextActionsProviderRegistry;
|
|
41
|
-
it('request ToolPaletteContextActions', async () => {
|
|
42
|
-
var _a, _b, _c, _d;
|
|
43
|
-
const actions = await requestContextActionsHandler.execute(protocol_1.RequestContextActions.create({ contextId: 'tool-palette', editorContext: { selectedElementIds: [] } }));
|
|
44
|
-
(0, chai_1.expect)(actions).to.have.length(1);
|
|
45
|
-
const action = actions[0];
|
|
46
|
-
(0, chai_1.expect)(protocol_1.SetContextActions.is(action)).to.be.true;
|
|
47
|
-
const setContextActions = action;
|
|
48
|
-
(0, chai_1.expect)(setContextActions.actions).to.have.length(2);
|
|
49
|
-
(0, chai_1.expect)(protocol_1.PaletteItem.is(setContextActions.actions[0])).to.be.true;
|
|
50
|
-
const firstPaletteItem = setContextActions.actions[0];
|
|
51
|
-
(0, chai_1.expect)(firstPaletteItem.label).to.be.equal('Nodes');
|
|
52
|
-
(0, chai_1.expect)(firstPaletteItem.children).to.have.length(2);
|
|
53
|
-
(0, chai_1.expect)((_a = firstPaletteItem.children) === null || _a === void 0 ? void 0 : _a[0].label).to.be.equal('ANode');
|
|
54
|
-
(0, chai_1.expect)((_b = firstPaletteItem.children) === null || _b === void 0 ? void 0 : _b[1].label).to.be.equal('BNode');
|
|
55
|
-
(0, chai_1.expect)(protocol_1.PaletteItem.is(setContextActions.actions[1])).to.be.true;
|
|
56
|
-
const secondPaletteItem = setContextActions.actions[1];
|
|
57
|
-
(0, chai_1.expect)(secondPaletteItem.label).to.be.equal('Edges');
|
|
58
|
-
(0, chai_1.expect)(secondPaletteItem.children).to.have.length(2);
|
|
59
|
-
(0, chai_1.expect)((_c = secondPaletteItem.children) === null || _c === void 0 ? void 0 : _c[0].label).to.be.equal('AEdge');
|
|
60
|
-
(0, chai_1.expect)((_d = secondPaletteItem.children) === null || _d === void 0 ? void 0 : _d[1].label).to.be.equal('BEdge');
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
//# sourceMappingURL=request-context-actions-handler.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-context-actions-handler.spec.js","sourceRoot":"","sources":["../../../../src/common/features/contextactions/request-context-actions-handler.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA+F;AAC/F,+BAA8B;AAC9B,4FAAuF;AACvF,6CAA6C;AAE7C,2FAAqF;AACrF,uFAAiF;AACjF,6EAA8E;AAE9E,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;IAC/C,MAAM,wBAAwB,GAAG,IAAI,qDAAwB,EAAE,CAAC;IAChE,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAA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,OAAO,CAAC,CAAC;QACrD,IAAA,aAAM,EAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACrD,IAAA,aAAM,EAAC,MAAA,iBAAiB,CAAC,QAAQ,0CAAG,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACnE,IAAA,aAAM,EAAC,MAAA,iBAAiB,CAAC,QAAQ,0CAAG,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-palette-item-provider.spec.d.ts","sourceRoot":"","sources":["../../../../src/common/features/contextactions/tool-palette-item-provider.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/********************************************************************************
|
|
4
|
-
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
5
|
-
*
|
|
6
|
-
* This program and the accompanying materials are made available under the
|
|
7
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
-
*
|
|
10
|
-
* This Source Code may also be made available under the following Secondary
|
|
11
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
-
* with the GNU Classpath Exception which is available at
|
|
14
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
15
|
-
*
|
|
16
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
17
|
-
********************************************************************************/
|
|
18
|
-
const operation_handler_registry_1 = require("../../operations/operation-handler-registry");
|
|
19
|
-
const mock = require("../../test/mock-util");
|
|
20
|
-
const tool_palette_item_provider_1 = require("./tool-palette-item-provider");
|
|
21
|
-
const chai_1 = require("chai");
|
|
22
|
-
describe('Test DefaultToolPaletteItemProvider', () => {
|
|
23
|
-
const operationHandlerRegistry = new operation_handler_registry_1.OperationHandlerRegistry();
|
|
24
|
-
const stubANode = new mock.StubCreateNodeOperationHandler('ANode');
|
|
25
|
-
const stubBNode = new mock.StubCreateNodeOperationHandler('BNode');
|
|
26
|
-
const stubAEdge = new mock.StubCreateEdgeOperationHandler('AEdge');
|
|
27
|
-
const stubBEdge = new mock.StubCreateEdgeOperationHandler('BEdge');
|
|
28
|
-
operationHandlerRegistry.registerHandler(stubBNode);
|
|
29
|
-
operationHandlerRegistry.registerHandler(stubANode);
|
|
30
|
-
operationHandlerRegistry.registerHandler(stubBEdge);
|
|
31
|
-
operationHandlerRegistry.registerHandler(stubAEdge);
|
|
32
|
-
it('test getItems', () => {
|
|
33
|
-
var _a, _b, _c, _d;
|
|
34
|
-
const toolPaletteItemProvider = new tool_palette_item_provider_1.DefaultToolPaletteItemProvider();
|
|
35
|
-
toolPaletteItemProvider.operationHandlerRegistry = operationHandlerRegistry;
|
|
36
|
-
const items = toolPaletteItemProvider.getItems();
|
|
37
|
-
(0, chai_1.expect)(items).to.have.length(2);
|
|
38
|
-
(0, chai_1.expect)(items[0].label).to.be.equal('Nodes');
|
|
39
|
-
(0, chai_1.expect)(items[0].children).to.have.length(2);
|
|
40
|
-
(0, chai_1.expect)((_a = items[0].children) === null || _a === void 0 ? void 0 : _a[0].label).to.be.equal('ANode');
|
|
41
|
-
(0, chai_1.expect)((_b = items[0].children) === null || _b === void 0 ? void 0 : _b[1].label).to.be.equal('BNode');
|
|
42
|
-
(0, chai_1.expect)(items[1].label).to.be.equal('Edges');
|
|
43
|
-
(0, chai_1.expect)(items[1].children).to.have.length(2);
|
|
44
|
-
(0, chai_1.expect)((_c = items[1].children) === null || _c === void 0 ? void 0 : _c[0].label).to.be.equal('AEdge');
|
|
45
|
-
(0, chai_1.expect)((_d = items[1].children) === null || _d === void 0 ? void 0 : _d[1].label).to.be.equal('BEdge');
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=tool-palette-item-provider.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-palette-item-provider.spec.js","sourceRoot":"","sources":["../../../../src/common/features/contextactions/tool-palette-item-provider.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,4FAAuF;AACvF,6CAA6C;AAC7C,6EAA8E;AAC9E,+BAA8B;AAE9B,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;IACjD,MAAM,wBAAwB,GAAG,IAAI,qDAAwB,EAAE,CAAC;IAChE,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC;IACnE,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC;IACnE,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC;IACnE,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC;IACnE,wBAAwB,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACpD,wBAAwB,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACpD,wBAAwB,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACpD,wBAAwB,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAEpD,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;;QACrB,MAAM,uBAAuB,GAAG,IAAI,2DAA8B,EAAE,CAAC;QACrE,uBAAuB,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;QAC5E,MAAM,KAAK,GAAG,uBAAuB,CAAC,QAAQ,EAAE,CAAC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AAO,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-edit-validator-registry.spec.d.ts","sourceRoot":"","sources":["../../../../src/common/features/directediting/context-edit-validator-registry.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/********************************************************************************
|
|
4
|
-
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
5
|
-
*
|
|
6
|
-
* This program and the accompanying materials are made available under the
|
|
7
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
-
*
|
|
10
|
-
* This Source Code may also be made available under the following Secondary
|
|
11
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
-
* with the GNU Classpath Exception which is available at
|
|
14
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
15
|
-
*
|
|
16
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
17
|
-
********************************************************************************/
|
|
18
|
-
const chai_1 = require("chai");
|
|
19
|
-
const mock_util_1 = require("../../test/mock-util");
|
|
20
|
-
const model_state_1 = require("../model/model-state");
|
|
21
|
-
const context_edit_validator_registry_1 = require("./context-edit-validator-registry");
|
|
22
|
-
describe('Test DefaultContextEditValidatorRegistry', () => {
|
|
23
|
-
it('check if default registry is empty', () => {
|
|
24
|
-
const contextEditValidators = [];
|
|
25
|
-
const contextEditValidatorRegistry = new context_edit_validator_registry_1.DefaultContextEditValidatorRegistry(new model_state_1.DefaultModelState(), contextEditValidators);
|
|
26
|
-
(0, chai_1.expect)(contextEditValidatorRegistry.keys()).to.have.length(0);
|
|
27
|
-
});
|
|
28
|
-
it('register TestContextEditValidator via ContextEditValidators list', () => {
|
|
29
|
-
const contextEditValidators = [new mock_util_1.TestContextEditValidator()];
|
|
30
|
-
const contextEditValidatorsRegistry = new context_edit_validator_registry_1.DefaultContextEditValidatorRegistry(new model_state_1.DefaultModelState(), contextEditValidators);
|
|
31
|
-
(0, chai_1.expect)(contextEditValidatorsRegistry.keys()).to.have.length(1);
|
|
32
|
-
});
|
|
33
|
-
it('register TestLabelEditValidator via LabelEditValidator', () => {
|
|
34
|
-
const contextEditValidators = [];
|
|
35
|
-
const contextEditValidatorsRegistry = new context_edit_validator_registry_1.DefaultContextEditValidatorRegistry(new model_state_1.DefaultModelState(), contextEditValidators, new mock_util_1.TestLabelEditValidator());
|
|
36
|
-
(0, chai_1.expect)(contextEditValidatorsRegistry.keys()).to.have.length(1);
|
|
37
|
-
});
|
|
38
|
-
it('register via ContextEditValidators list and LabelEditValidator', () => {
|
|
39
|
-
const contextEditValidators = [new mock_util_1.TestContextEditValidator()];
|
|
40
|
-
const contextEditValidatorsRegistry = new context_edit_validator_registry_1.DefaultContextEditValidatorRegistry(new model_state_1.DefaultModelState(), contextEditValidators, new mock_util_1.TestLabelEditValidator());
|
|
41
|
-
(0, chai_1.expect)(contextEditValidatorsRegistry.keys()).to.have.length(2);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=context-edit-validator-registry.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-edit-validator-registry.spec.js","sourceRoot":"","sources":["../../../../src/common/features/directediting/context-edit-validator-registry.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+BAA8B;AAC9B,oDAAwF;AACxF,sDAAyD;AAEzD,uFAAwF;AAExF,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;IACtD,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC1C,MAAM,qBAAqB,GAA2B,EAAE,CAAC;QACzD,MAAM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AC,MAAM,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-edit-validation-handler.spec.d.ts","sourceRoot":"","sources":["../../../../src/common/features/directediting/request-edit-validation-handler.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/********************************************************************************
|
|
4
|
-
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
5
|
-
*
|
|
6
|
-
* This program and the accompanying materials are made available under the
|
|
7
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
-
*
|
|
10
|
-
* This Source Code may also be made available under the following Secondary
|
|
11
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
-
* with the GNU Classpath Exception which is available at
|
|
14
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
15
|
-
*
|
|
16
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
17
|
-
********************************************************************************/
|
|
18
|
-
const graph_1 = require("@eclipse-glsp/graph");
|
|
19
|
-
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
20
|
-
const chai_1 = require("chai");
|
|
21
|
-
const sinon = require("sinon");
|
|
22
|
-
const mock_util_1 = require("../../test/mock-util");
|
|
23
|
-
const gmodel_index_1 = require("../model/gmodel-index");
|
|
24
|
-
const model_state_1 = require("../model/model-state");
|
|
25
|
-
const context_edit_validator_registry_1 = require("./context-edit-validator-registry");
|
|
26
|
-
const label_edit_validator_1 = require("./label-edit-validator");
|
|
27
|
-
const request_edit_validation_handler_1 = require("./request-edit-validation-handler");
|
|
28
|
-
describe('Test RequestEditValidationHandler', () => {
|
|
29
|
-
const contextEditValidators = [new mock_util_1.TestContextEditValidator()];
|
|
30
|
-
const modelState = new model_state_1.DefaultModelState();
|
|
31
|
-
Object.defineProperty(modelState, 'index', { value: new gmodel_index_1.GModelIndex() });
|
|
32
|
-
sinon.stub(modelState.index, 'get').callsFake(() => new graph_1.GNode());
|
|
33
|
-
const contextEditValidatorsRegistry = new context_edit_validator_registry_1.DefaultContextEditValidatorRegistry(modelState, contextEditValidators, new mock_util_1.TestLabelEditValidator());
|
|
34
|
-
const requestEditValidationHandler = new request_edit_validation_handler_1.RequestEditValidationHandler();
|
|
35
|
-
requestEditValidationHandler['contextEditValidatorRegistry'] = contextEditValidatorsRegistry;
|
|
36
|
-
it('requestContextEditValidation with ok result', async () => {
|
|
37
|
-
const actions = await requestEditValidationHandler.execute(protocol_1.RequestEditValidationAction.create({ contextId: 'test', modelElementId: '', text: 'ok' }));
|
|
38
|
-
(0, chai_1.expect)(actions).to.have.length(1);
|
|
39
|
-
const action = actions[0];
|
|
40
|
-
(0, chai_1.expect)(protocol_1.SetEditValidationResultAction.is(action)).to.be.true;
|
|
41
|
-
const setEditValidationResultAction = action;
|
|
42
|
-
const status = setEditValidationResultAction.status;
|
|
43
|
-
(0, chai_1.expect)(status.severity).to.be.equal(protocol_1.ValidationStatus.Severity.OK);
|
|
44
|
-
(0, chai_1.expect)(status.message).to.be.equal('ok');
|
|
45
|
-
});
|
|
46
|
-
it('requestContextEditValidation with warning result', async () => {
|
|
47
|
-
const actions = await requestEditValidationHandler.execute(protocol_1.RequestEditValidationAction.create({ contextId: 'test', modelElementId: '', text: 'warning' }));
|
|
48
|
-
(0, chai_1.expect)(actions).to.have.length(1);
|
|
49
|
-
const action = actions[0];
|
|
50
|
-
(0, chai_1.expect)(protocol_1.SetEditValidationResultAction.is(action)).to.be.true;
|
|
51
|
-
const setEditValidationResultAction = action;
|
|
52
|
-
const status = setEditValidationResultAction.status;
|
|
53
|
-
(0, chai_1.expect)(status.severity).to.be.equal(protocol_1.ValidationStatus.Severity.WARNING);
|
|
54
|
-
(0, chai_1.expect)(status.message).to.be.equal('warning');
|
|
55
|
-
});
|
|
56
|
-
it('requestContextEditValidation with error result', async () => {
|
|
57
|
-
const actions = await requestEditValidationHandler.execute(protocol_1.RequestEditValidationAction.create({ contextId: 'test', modelElementId: '', text: 'error' }));
|
|
58
|
-
(0, chai_1.expect)(actions).to.have.length(1);
|
|
59
|
-
const action = actions[0];
|
|
60
|
-
(0, chai_1.expect)(protocol_1.SetEditValidationResultAction.is(action)).to.be.true;
|
|
61
|
-
const setEditValidationResultAction = action;
|
|
62
|
-
const status = setEditValidationResultAction.status;
|
|
63
|
-
(0, chai_1.expect)(status.severity).to.be.equal(protocol_1.ValidationStatus.Severity.ERROR);
|
|
64
|
-
(0, chai_1.expect)(status.message).to.be.equal('error');
|
|
65
|
-
});
|
|
66
|
-
it('requestLabelEditValidation with ok result', async () => {
|
|
67
|
-
const actions = await requestEditValidationHandler.execute(protocol_1.RequestEditValidationAction.create({ contextId: label_edit_validator_1.LabelEditValidator.CONTEXT_ID, modelElementId: '', text: 'ok' }));
|
|
68
|
-
(0, chai_1.expect)(actions).to.have.length(1);
|
|
69
|
-
const action = actions[0];
|
|
70
|
-
(0, chai_1.expect)(protocol_1.SetEditValidationResultAction.is(action)).to.be.true;
|
|
71
|
-
const setEditValidationResultAction = action;
|
|
72
|
-
const status = setEditValidationResultAction.status;
|
|
73
|
-
(0, chai_1.expect)(status.severity).to.be.equal(protocol_1.ValidationStatus.Severity.OK);
|
|
74
|
-
(0, chai_1.expect)(status.message).to.be.equal('ok');
|
|
75
|
-
});
|
|
76
|
-
it('requestLabelEditValidation with warning result', async () => {
|
|
77
|
-
const actions = await requestEditValidationHandler.execute(protocol_1.RequestEditValidationAction.create({ contextId: label_edit_validator_1.LabelEditValidator.CONTEXT_ID, modelElementId: '', text: 'warning' }));
|
|
78
|
-
(0, chai_1.expect)(actions).to.have.length(1);
|
|
79
|
-
const action = actions[0];
|
|
80
|
-
(0, chai_1.expect)(protocol_1.SetEditValidationResultAction.is(action)).to.be.true;
|
|
81
|
-
const setEditValidationResultAction = action;
|
|
82
|
-
const status = setEditValidationResultAction.status;
|
|
83
|
-
(0, chai_1.expect)(status.severity).to.be.equal(protocol_1.ValidationStatus.Severity.WARNING);
|
|
84
|
-
(0, chai_1.expect)(status.message).to.be.equal('warning');
|
|
85
|
-
});
|
|
86
|
-
it('requestLabelEditValidation with error result', async () => {
|
|
87
|
-
const actions = await requestEditValidationHandler.execute(protocol_1.RequestEditValidationAction.create({ contextId: label_edit_validator_1.LabelEditValidator.CONTEXT_ID, modelElementId: '', text: 'error' }));
|
|
88
|
-
(0, chai_1.expect)(actions).to.have.length(1);
|
|
89
|
-
const action = actions[0];
|
|
90
|
-
(0, chai_1.expect)(protocol_1.SetEditValidationResultAction.is(action)).to.be.true;
|
|
91
|
-
const setEditValidationResultAction = action;
|
|
92
|
-
const status = setEditValidationResultAction.status;
|
|
93
|
-
(0, chai_1.expect)(status.severity).to.be.equal(protocol_1.ValidationStatus.Severity.ERROR);
|
|
94
|
-
(0, chai_1.expect)(status.message).to.be.equal('error');
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
//# sourceMappingURL=request-edit-validation-handler.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-edit-validation-handler.spec.js","sourceRoot":"","sources":["../../../../src/common/features/directediting/request-edit-validation-handler.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+CAA4C;AAC5C,qDAAsH;AACtH,+BAA8B;AAC9B,+BAA+B;AAC/B,oDAAwF;AACxF,wDAAoD;AACpD,sDAAyD;AAEzD,uFAAwF;AACxF,iEAA4D;AAC5D,uFAAiF;AAEjF,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;IAC/C,MAAM,qBAAqB,GAA2B,CAAC,IAAI,oCAAwB,EAAE,CAAC,CAAC;IACvF,MAAM,UAA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