@eclipse-glsp/server 2.8.0-next.0 → 2.8.0-next.10

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.
Files changed (132) hide show
  1. package/lib/browser/launch/worker-server-launcher.js +3 -5
  2. package/lib/browser/launch/worker-server-launcher.js.map +1 -1
  3. package/lib/common/actions/action-dispatcher.js +5 -8
  4. package/lib/common/actions/action-dispatcher.js.map +1 -1
  5. package/lib/common/actions/action-handler-registry.js +1 -1
  6. package/lib/common/actions/action-handler-registry.js.map +1 -1
  7. package/lib/common/actions/global-action-provider.js +1 -2
  8. package/lib/common/actions/global-action-provider.js.map +1 -1
  9. package/lib/common/command/command.js +1 -2
  10. package/lib/common/command/command.js.map +1 -1
  11. package/lib/common/command/recording-command.js +3 -6
  12. package/lib/common/command/recording-command.js.map +1 -1
  13. package/lib/common/di/diagram-module.js +5 -6
  14. package/lib/common/di/diagram-module.js.map +1 -1
  15. package/lib/common/di/glsp-module.js +1 -1
  16. package/lib/common/di/glsp-module.js.map +1 -1
  17. package/lib/common/di/server-module.js +1 -1
  18. package/lib/common/di/server-module.js.map +1 -1
  19. package/lib/common/features/directediting/context-edit-validator.js +3 -3
  20. package/lib/common/features/directediting/context-edit-validator.js.map +1 -1
  21. package/lib/common/features/directediting/label-edit-validator.js +1 -1
  22. package/lib/common/features/directediting/label-edit-validator.js.map +1 -1
  23. package/lib/common/features/layout/computed-bounds-action-handler.d.ts +16 -1
  24. package/lib/common/features/layout/computed-bounds-action-handler.d.ts.map +1 -1
  25. package/lib/common/features/layout/computed-bounds-action-handler.js +41 -4
  26. package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -1
  27. package/lib/common/features/layout/layout-operation-handler.js +1 -2
  28. package/lib/common/features/layout/layout-operation-handler.js.map +1 -1
  29. package/lib/common/features/model/gmodel-index.js +3 -5
  30. package/lib/common/features/model/gmodel-index.js.map +1 -1
  31. package/lib/common/features/model/gmodel-serializer.js +1 -2
  32. package/lib/common/features/model/gmodel-serializer.js.map +1 -1
  33. package/lib/common/features/model/model-submission-handler.d.ts +1 -2
  34. package/lib/common/features/model/model-submission-handler.d.ts.map +1 -1
  35. package/lib/common/features/model/model-submission-handler.js +3 -6
  36. package/lib/common/features/model/model-submission-handler.js.map +1 -1
  37. package/lib/common/features/model/request-model-action-handler.js +4 -6
  38. package/lib/common/features/model/request-model-action-handler.js.map +1 -1
  39. package/lib/common/features/navigation/navigation-target-resolution.js +1 -1
  40. package/lib/common/features/navigation/navigation-target-resolution.js.map +1 -1
  41. package/lib/common/features/progress/progress-service.d.ts.map +1 -1
  42. package/lib/common/features/progress/progress-service.js +1 -2
  43. package/lib/common/features/progress/progress-service.js.map +1 -1
  44. package/lib/common/features/validation/request-markers-handler.js +1 -2
  45. package/lib/common/features/validation/request-markers-handler.js.map +1 -1
  46. package/lib/common/gmodel/change-routing-points-operation-handler.js +1 -2
  47. package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -1
  48. package/lib/common/gmodel/gmodel-create-node-operation-handler.js +3 -5
  49. package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -1
  50. package/lib/common/gmodel/paste-operation-handler.d.ts +1 -1
  51. package/lib/common/gmodel/paste-operation-handler.d.ts.map +1 -1
  52. package/lib/common/gmodel/paste-operation-handler.js +8 -11
  53. package/lib/common/gmodel/paste-operation-handler.js.map +1 -1
  54. package/lib/common/launch/glsp-server-launcher.d.ts +8 -1
  55. package/lib/common/launch/glsp-server-launcher.d.ts.map +1 -1
  56. package/lib/common/launch/glsp-server-launcher.js +11 -1
  57. package/lib/common/launch/glsp-server-launcher.js.map +1 -1
  58. package/lib/common/launch/jsonrpc-server-launcher.d.ts +51 -2
  59. package/lib/common/launch/jsonrpc-server-launcher.d.ts.map +1 -1
  60. package/lib/common/launch/jsonrpc-server-launcher.js +82 -3
  61. package/lib/common/launch/jsonrpc-server-launcher.js.map +1 -1
  62. package/lib/common/operations/compound-operation-handler.js +1 -1
  63. package/lib/common/operations/compound-operation-handler.js.map +1 -1
  64. package/lib/common/operations/json-operation-handler.js +2 -3
  65. package/lib/common/operations/json-operation-handler.js.map +1 -1
  66. package/lib/common/protocol/glsp-server.js +6 -7
  67. package/lib/common/protocol/glsp-server.js.map +1 -1
  68. package/lib/common/session/client-session-manager.js +3 -5
  69. package/lib/common/session/client-session-manager.js.map +1 -1
  70. package/lib/common/utils/action-queue.js +2 -4
  71. package/lib/common/utils/action-queue.js.map +1 -1
  72. package/lib/common/utils/client-options-util.js +2 -2
  73. package/lib/common/utils/client-options-util.js.map +1 -1
  74. package/lib/common/utils/glsp-server-error.d.ts +2 -3
  75. package/lib/common/utils/glsp-server-error.d.ts.map +1 -1
  76. package/lib/common/utils/glsp-server-error.js +1 -1
  77. package/lib/common/utils/glsp-server-error.js.map +1 -1
  78. package/lib/common/utils/layout-util.d.ts +5 -5
  79. package/lib/common/utils/layout-util.d.ts.map +1 -1
  80. package/lib/common/utils/layout-util.js +17 -19
  81. package/lib/common/utils/layout-util.js.map +1 -1
  82. package/lib/common/utils/logger.js +1 -2
  83. package/lib/common/utils/logger.js.map +1 -1
  84. package/lib/node/abstract-json-model-storage.js +2 -4
  85. package/lib/node/abstract-json-model-storage.js.map +1 -1
  86. package/lib/node/launch/socket-server-launcher.d.ts +39 -2
  87. package/lib/node/launch/socket-server-launcher.d.ts.map +1 -1
  88. package/lib/node/launch/socket-server-launcher.js +50 -31
  89. package/lib/node/launch/socket-server-launcher.js.map +1 -1
  90. package/lib/node/launch/websocket-server-launcher.d.ts +36 -5
  91. package/lib/node/launch/websocket-server-launcher.d.ts.map +1 -1
  92. package/lib/node/launch/websocket-server-launcher.js +54 -13
  93. package/lib/node/launch/websocket-server-launcher.js.map +1 -1
  94. package/package.json +17 -21
  95. package/src/common/features/directediting/context-edit-validator.ts +2 -2
  96. package/src/common/features/layout/computed-bounds-action-handler.ts +52 -4
  97. package/src/common/features/model/model-submission-handler.ts +3 -2
  98. package/src/common/features/progress/progress-service.ts +2 -3
  99. package/src/common/gmodel/paste-operation-handler.ts +6 -6
  100. package/src/common/launch/glsp-server-launcher.ts +12 -1
  101. package/src/common/launch/jsonrpc-server-launcher.ts +89 -2
  102. package/src/common/utils/glsp-server-error.ts +3 -5
  103. package/src/common/utils/layout-util.ts +13 -12
  104. package/src/node/launch/socket-server-launcher.ts +54 -31
  105. package/src/node/launch/websocket-server-launcher.ts +72 -14
  106. package/src/browser/di/browser-action-dispatch-scope.spec.ts +0 -75
  107. package/src/common/actions/action-handler-registry.spec.ts +0 -52
  108. package/src/common/actions/global-action-provider.spec.ts +0 -68
  109. package/src/common/command/command-stack.spec.ts +0 -239
  110. package/src/common/command/command.spec.ts +0 -92
  111. package/src/common/command/recording-command.spec.ts +0 -86
  112. package/src/common/di/binding-target.spec.ts +0 -147
  113. package/src/common/di/multi-bindings.spec.ts +0 -133
  114. package/src/common/features/contextactions/context-actions-provider-registry.spec.ts +0 -69
  115. package/src/common/features/contextactions/request-context-actions-handler.spec.ts +0 -75
  116. package/src/common/features/contextactions/tool-palette-item-provider.spec.ts +0 -46
  117. package/src/common/features/directediting/context-edit-validator-registry.spec.ts +0 -54
  118. package/src/common/features/directediting/request-edit-validation-handler.spec.ts +0 -131
  119. package/src/common/features/model/gmodel-serializer.spec.ts +0 -141
  120. package/src/common/features/type-hints/request-type-hints-action-handler.spec.ts +0 -59
  121. package/src/common/operations/operation-handler-registry.spec.ts +0 -50
  122. package/src/common/protocol/glsp-server.spec.ts +0 -154
  123. package/src/common/session/client-session-factory.spec.ts +0 -60
  124. package/src/common/session/client-session-manager.spec.ts +0 -83
  125. package/src/common/test/mock-util.ts +0 -281
  126. package/src/common/utils/action-queue.spec.ts +0 -133
  127. package/src/common/utils/promise-queue.spec.ts +0 -142
  128. package/src/common/utils/registry.spec.ts +0 -225
  129. package/src/node/actions/action-dispatcher.spec.ts +0 -678
  130. package/src/node/launch/cli-parser.spec.ts +0 -61
  131. package/src/node/launch/socket-cli-parser.spec.ts +0 -73
  132. 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
- });