@eclipse-glsp/server 2.8.0-next.3 → 2.8.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/launch/worker-server-launcher.js +3 -5
- package/lib/browser/launch/worker-server-launcher.js.map +1 -1
- package/lib/common/actions/action-dispatcher.js +5 -8
- package/lib/common/actions/action-dispatcher.js.map +1 -1
- package/lib/common/actions/action-handler-registry.js +1 -1
- package/lib/common/actions/action-handler-registry.js.map +1 -1
- package/lib/common/actions/global-action-provider.js +1 -2
- package/lib/common/actions/global-action-provider.js.map +1 -1
- package/lib/common/command/command.js +1 -2
- package/lib/common/command/command.js.map +1 -1
- package/lib/common/command/recording-command.js +3 -6
- package/lib/common/command/recording-command.js.map +1 -1
- package/lib/common/di/diagram-module.js +5 -6
- package/lib/common/di/diagram-module.js.map +1 -1
- package/lib/common/di/glsp-module.js +1 -1
- package/lib/common/di/glsp-module.js.map +1 -1
- package/lib/common/di/server-module.js +1 -1
- package/lib/common/di/server-module.js.map +1 -1
- package/lib/common/features/directediting/context-edit-validator.js +3 -3
- package/lib/common/features/directediting/context-edit-validator.js.map +1 -1
- package/lib/common/features/directediting/label-edit-validator.js +1 -1
- package/lib/common/features/directediting/label-edit-validator.js.map +1 -1
- package/lib/common/features/layout/computed-bounds-action-handler.js +2 -3
- package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -1
- package/lib/common/features/layout/layout-operation-handler.js +1 -2
- package/lib/common/features/layout/layout-operation-handler.js.map +1 -1
- package/lib/common/features/model/gmodel-index.js +3 -5
- package/lib/common/features/model/gmodel-index.js.map +1 -1
- package/lib/common/features/model/gmodel-serializer.js +1 -2
- package/lib/common/features/model/gmodel-serializer.js.map +1 -1
- package/lib/common/features/model/model-submission-handler.d.ts +1 -2
- package/lib/common/features/model/model-submission-handler.d.ts.map +1 -1
- package/lib/common/features/model/model-submission-handler.js +3 -6
- package/lib/common/features/model/model-submission-handler.js.map +1 -1
- package/lib/common/features/model/request-model-action-handler.js +4 -6
- package/lib/common/features/model/request-model-action-handler.js.map +1 -1
- package/lib/common/features/navigation/navigation-target-resolution.js +1 -1
- package/lib/common/features/navigation/navigation-target-resolution.js.map +1 -1
- package/lib/common/features/progress/progress-service.d.ts.map +1 -1
- package/lib/common/features/progress/progress-service.js +1 -2
- package/lib/common/features/progress/progress-service.js.map +1 -1
- package/lib/common/features/validation/request-markers-handler.js +1 -2
- package/lib/common/features/validation/request-markers-handler.js.map +1 -1
- package/lib/common/gmodel/change-routing-points-operation-handler.js +1 -2
- package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -1
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js +3 -5
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -1
- package/lib/common/gmodel/paste-operation-handler.d.ts +1 -1
- package/lib/common/gmodel/paste-operation-handler.d.ts.map +1 -1
- package/lib/common/gmodel/paste-operation-handler.js +8 -11
- package/lib/common/gmodel/paste-operation-handler.js.map +1 -1
- package/lib/common/operations/compound-operation-handler.js +1 -1
- package/lib/common/operations/compound-operation-handler.js.map +1 -1
- package/lib/common/operations/json-operation-handler.js +2 -3
- package/lib/common/operations/json-operation-handler.js.map +1 -1
- package/lib/common/protocol/glsp-server.js +6 -7
- package/lib/common/protocol/glsp-server.js.map +1 -1
- package/lib/common/session/client-session-manager.js +3 -5
- package/lib/common/session/client-session-manager.js.map +1 -1
- package/lib/common/utils/action-queue.js +2 -4
- package/lib/common/utils/action-queue.js.map +1 -1
- package/lib/common/utils/client-options-util.js +2 -2
- package/lib/common/utils/client-options-util.js.map +1 -1
- package/lib/common/utils/glsp-server-error.d.ts +2 -3
- package/lib/common/utils/glsp-server-error.d.ts.map +1 -1
- package/lib/common/utils/glsp-server-error.js +1 -1
- package/lib/common/utils/glsp-server-error.js.map +1 -1
- package/lib/common/utils/layout-util.js +5 -8
- package/lib/common/utils/layout-util.js.map +1 -1
- package/lib/common/utils/logger.js +1 -2
- package/lib/common/utils/logger.js.map +1 -1
- package/lib/node/abstract-json-model-storage.js +2 -4
- package/lib/node/abstract-json-model-storage.js.map +1 -1
- package/lib/node/launch/websocket-server-launcher.js +1 -1
- package/lib/node/launch/websocket-server-launcher.js.map +1 -1
- package/package.json +17 -21
- package/src/common/features/directediting/context-edit-validator.ts +2 -2
- package/src/common/features/model/model-submission-handler.ts +3 -2
- package/src/common/features/progress/progress-service.ts +2 -3
- package/src/common/gmodel/paste-operation-handler.ts +6 -6
- package/src/common/utils/glsp-server-error.ts +3 -5
- package/src/browser/di/browser-action-dispatch-scope.spec.ts +0 -75
- package/src/common/actions/action-handler-registry.spec.ts +0 -52
- package/src/common/actions/global-action-provider.spec.ts +0 -68
- package/src/common/command/command-stack.spec.ts +0 -239
- package/src/common/command/command.spec.ts +0 -92
- package/src/common/command/recording-command.spec.ts +0 -86
- package/src/common/di/binding-target.spec.ts +0 -147
- package/src/common/di/multi-bindings.spec.ts +0 -133
- package/src/common/features/contextactions/context-actions-provider-registry.spec.ts +0 -69
- package/src/common/features/contextactions/request-context-actions-handler.spec.ts +0 -75
- package/src/common/features/contextactions/tool-palette-item-provider.spec.ts +0 -46
- package/src/common/features/directediting/context-edit-validator-registry.spec.ts +0 -54
- package/src/common/features/directediting/request-edit-validation-handler.spec.ts +0 -131
- package/src/common/features/model/gmodel-serializer.spec.ts +0 -141
- package/src/common/features/type-hints/request-type-hints-action-handler.spec.ts +0 -59
- package/src/common/operations/operation-handler-registry.spec.ts +0 -50
- package/src/common/protocol/glsp-server.spec.ts +0 -154
- package/src/common/session/client-session-factory.spec.ts +0 -60
- package/src/common/session/client-session-manager.spec.ts +0 -83
- package/src/common/test/mock-util.ts +0 -281
- package/src/common/utils/action-queue.spec.ts +0 -133
- package/src/common/utils/promise-queue.spec.ts +0 -142
- package/src/common/utils/registry.spec.ts +0 -225
- package/src/node/actions/action-dispatcher.spec.ts +0 -678
- package/src/node/launch/cli-parser.spec.ts +0 -61
- package/src/node/launch/socket-cli-parser.spec.ts +0 -73
- package/src/node/launch/socket-server-launcher.spec.ts +0 -74
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
import { expect } from 'chai';
|
|
17
|
-
import { NullLogger } from './logger';
|
|
18
|
-
import { MultiRegistry, Registry } from './registry';
|
|
19
|
-
|
|
20
|
-
describe('Test Registry', () => {
|
|
21
|
-
let registry: Registry<string, string>;
|
|
22
|
-
|
|
23
|
-
beforeEach(() => {
|
|
24
|
-
registry = new Registry();
|
|
25
|
-
registry['logger'] = new NullLogger();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('register - with new key-value pair', () => {
|
|
29
|
-
const key = 'key';
|
|
30
|
-
const value = 'value';
|
|
31
|
-
expect(registry.register(key, value)).true;
|
|
32
|
-
expect(registry.get(key), value);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('register - with key-value pair with a already registered key', () => {
|
|
36
|
-
// Setup
|
|
37
|
-
const key = 'key';
|
|
38
|
-
const value = 'value';
|
|
39
|
-
expect(registry.register(key, value)).true;
|
|
40
|
-
// Test execution
|
|
41
|
-
expect(registry.register(key, 'newValue')).false;
|
|
42
|
-
expect(registry.get(key), value);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it('deregister - with registered key', () => {
|
|
46
|
-
// Setup
|
|
47
|
-
const key = 'key';
|
|
48
|
-
const value = 'value';
|
|
49
|
-
expect(registry.register(key, value)).true;
|
|
50
|
-
// Test execution
|
|
51
|
-
expect(registry.deregister(key)).true;
|
|
52
|
-
expect(registry.get(key), undefined);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('deregister - with unregistered key', () => {
|
|
56
|
-
expect(registry.deregister('unregisteredKey')).false;
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('haskey - with registered key', () => {
|
|
60
|
-
// Setup
|
|
61
|
-
const key = 'key';
|
|
62
|
-
const value = 'value';
|
|
63
|
-
expect(registry.register(key, value)).true;
|
|
64
|
-
// Test execution
|
|
65
|
-
expect(registry.hasKey(key)).true;
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('haskey - with unregistered key', () => {
|
|
69
|
-
expect(registry.deregister('unregisteredKey')).false;
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('get - with registered key', () => {
|
|
73
|
-
// Setup
|
|
74
|
-
const key = 'key';
|
|
75
|
-
const value = 'value';
|
|
76
|
-
expect(registry.register(key, value)).true;
|
|
77
|
-
// Test execution
|
|
78
|
-
expect(registry.get(key), value);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it('get - with unregistered key', () => {
|
|
82
|
-
expect(registry.get('unregisteredKey'), undefined);
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('getAll - should return three values', () => {
|
|
86
|
-
// Setup
|
|
87
|
-
const e1 = { key: 'key1', value: 'value1' };
|
|
88
|
-
const e2 = { key: 'key2', value: 'value2' };
|
|
89
|
-
const e3 = { key: 'key3', value: 'value3' };
|
|
90
|
-
registry.register(e1.key, e1.value);
|
|
91
|
-
registry.register(e2.key, e2.value);
|
|
92
|
-
registry.register(e3.key, e3.value);
|
|
93
|
-
// Test execution
|
|
94
|
-
const result = registry.getAll();
|
|
95
|
-
expect(result).to.have.length(3);
|
|
96
|
-
expect(result.includes(e1.value)).true;
|
|
97
|
-
expect(result.includes(e2.value)).true;
|
|
98
|
-
expect(result.includes(e3.value)).true;
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it('keys - should return three keys', () => {
|
|
102
|
-
// Setup
|
|
103
|
-
const e1 = { key: 'key1', value: 'value1' };
|
|
104
|
-
const e2 = { key: 'key2', value: 'value2' };
|
|
105
|
-
const e3 = { key: 'key3', value: 'value3' };
|
|
106
|
-
registry.register(e1.key, e1.value);
|
|
107
|
-
registry.register(e2.key, e2.value);
|
|
108
|
-
registry.register(e3.key, e3.value);
|
|
109
|
-
// Test execution
|
|
110
|
-
const result = registry.keys();
|
|
111
|
-
expect(result).to.have.length(3);
|
|
112
|
-
expect(result.includes(e1.key)).true;
|
|
113
|
-
expect(result.includes(e2.key)).true;
|
|
114
|
-
expect(result.includes(e3.key)).true;
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
describe('Test MapMultiRegistry', () => {
|
|
119
|
-
let multiRegistry: MultiRegistry<string, string>;
|
|
120
|
-
|
|
121
|
-
beforeEach(() => {
|
|
122
|
-
multiRegistry = new MultiRegistry();
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('register - with new key-value pair', () => {
|
|
126
|
-
// Setup
|
|
127
|
-
const e1 = { key: 'key', value: 'value' };
|
|
128
|
-
const e2 = { key: e1.key, value: 'value2' };
|
|
129
|
-
|
|
130
|
-
multiRegistry.register(e1.key, e1.value);
|
|
131
|
-
multiRegistry.register(e2.key, e2.value);
|
|
132
|
-
|
|
133
|
-
const resultValue = multiRegistry.get(e1.key);
|
|
134
|
-
expect(resultValue).to.not.be.undefined;
|
|
135
|
-
expect(resultValue!.length).to.be.equal(2);
|
|
136
|
-
expect(resultValue!.includes(e1.value)).true;
|
|
137
|
-
expect(resultValue!.includes(e2.value)).true;
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
it('deregister - with registered key', () => {
|
|
141
|
-
// Setup
|
|
142
|
-
const key = 'key';
|
|
143
|
-
const existingValue = ['value', 'value2'];
|
|
144
|
-
multiRegistry.register(key, existingValue[0]);
|
|
145
|
-
multiRegistry.register(key, existingValue[1]);
|
|
146
|
-
// Test execution
|
|
147
|
-
expect(multiRegistry.deregister(key, existingValue[1])).true;
|
|
148
|
-
const result = multiRegistry.get(key);
|
|
149
|
-
expect(result.length).to.be.equal(1);
|
|
150
|
-
expect(result[0], existingValue[0]);
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it('deregister - with unregistered key', () => {
|
|
154
|
-
expect(multiRegistry.deregister('unregisteredKey', 'someValue')).false;
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
it('deregisterAll - with registered key', () => {
|
|
158
|
-
// Setup
|
|
159
|
-
const key = 'key';
|
|
160
|
-
const existingValue = ['value', 'value2'];
|
|
161
|
-
multiRegistry.register(key, existingValue[0]);
|
|
162
|
-
multiRegistry.register(key, existingValue[1]);
|
|
163
|
-
expect(multiRegistry.deregisterAll(key)).true;
|
|
164
|
-
expect(multiRegistry.get(key)).to.have.length(0);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
it('deregisterAll - with unregistered key', () => {
|
|
168
|
-
expect(multiRegistry.deregisterAll('unregisteredKey')).false;
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
it('haskey - with registered key', () => {
|
|
172
|
-
// Setup
|
|
173
|
-
const key = 'key';
|
|
174
|
-
const existingValue = 'value';
|
|
175
|
-
multiRegistry.register(key, existingValue);
|
|
176
|
-
// Test execution
|
|
177
|
-
expect(multiRegistry.hasKey(key)).true;
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
it('haskey - with unregistered key', () => {
|
|
181
|
-
expect(multiRegistry.hasKey('unregisteredKey')).false;
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
it('get - with registered key', () => {
|
|
185
|
-
// Setup
|
|
186
|
-
const key = 'key';
|
|
187
|
-
const existingValue = 'value';
|
|
188
|
-
multiRegistry.register(key, existingValue);
|
|
189
|
-
// Test execution
|
|
190
|
-
expect(multiRegistry.get(key).length).to.be.equal(1);
|
|
191
|
-
expect(multiRegistry.get(key).includes(existingValue)).true;
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
it('get - with unregistered key', () => {
|
|
195
|
-
expect(multiRegistry.get('unregisteredKey')).to.have.length(0);
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
it('getAll', () => {
|
|
199
|
-
// Setup
|
|
200
|
-
const e1 = { key: 'key1', value: ['value1', 'value2'] };
|
|
201
|
-
const e2 = { key: 'key2', value: ['value3'] };
|
|
202
|
-
multiRegistry.register(e1.key, e1.value[0]);
|
|
203
|
-
multiRegistry.register(e1.key, e1.value[1]);
|
|
204
|
-
multiRegistry.register(e2.key, e2.value[0]);
|
|
205
|
-
// Test execution
|
|
206
|
-
const result = multiRegistry.getAll();
|
|
207
|
-
expect(result).to.have.length(3);
|
|
208
|
-
expect(e1.value.every(v => result.includes(v))).true;
|
|
209
|
-
expect(e2.value.every(v => result.includes(v))).true;
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
it('keys', () => {
|
|
213
|
-
// Setup
|
|
214
|
-
const e1 = { key: 'key1', value: ['value1', 'value2'] };
|
|
215
|
-
const e2 = { key: 'key2', value: ['value3'] };
|
|
216
|
-
multiRegistry.register(e1.key, e1.value[0]);
|
|
217
|
-
multiRegistry.register(e1.key, e1.value[1]);
|
|
218
|
-
multiRegistry.register(e2.key, e2.value[0]);
|
|
219
|
-
// Test execution
|
|
220
|
-
const result = multiRegistry.keys();
|
|
221
|
-
expect(result.length).to.be.equal(2);
|
|
222
|
-
expect(result.includes(e1.key)).true;
|
|
223
|
-
expect(result.includes(e2.key)).true;
|
|
224
|
-
});
|
|
225
|
-
});
|