@eclipse-glsp/server 1.1.0-RC07 → 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.
Files changed (222) hide show
  1. package/lib/browser/di/app-module.d.ts +2 -7
  2. package/lib/browser/di/app-module.d.ts.map +1 -1
  3. package/lib/browser/di/app-module.js +5 -30
  4. package/lib/browser/di/app-module.js.map +1 -1
  5. package/lib/browser/index.d.ts +0 -1
  6. package/lib/browser/index.d.ts.map +1 -1
  7. package/lib/browser/index.js +0 -1
  8. package/lib/browser/index.js.map +1 -1
  9. package/lib/browser/launch/worker-server-launcher.d.ts +4 -4
  10. package/lib/browser/launch/worker-server-launcher.d.ts.map +1 -1
  11. package/lib/browser/launch/worker-server-launcher.js +5 -11
  12. package/lib/browser/launch/worker-server-launcher.js.map +1 -1
  13. package/lib/common/actions/client-action-handler.d.ts +1 -2
  14. package/lib/common/actions/client-action-handler.d.ts.map +1 -1
  15. package/lib/common/actions/client-action-handler.js +17 -2
  16. package/lib/common/actions/client-action-handler.js.map +1 -1
  17. package/lib/common/command/command-stack.d.ts +16 -1
  18. package/lib/common/command/command-stack.d.ts.map +1 -1
  19. package/lib/common/command/command-stack.js +0 -15
  20. package/lib/common/command/command-stack.js.map +1 -1
  21. package/lib/common/di/client-session-module.d.ts +1 -1
  22. package/lib/common/di/client-session-module.d.ts.map +1 -1
  23. package/lib/common/di/client-session-module.js +2 -2
  24. package/lib/common/di/client-session-module.js.map +1 -1
  25. package/lib/common/di/glsp-module.d.ts +3 -1
  26. package/lib/common/di/glsp-module.d.ts.map +1 -1
  27. package/lib/common/di/glsp-module.js +0 -15
  28. package/lib/common/di/glsp-module.js.map +1 -1
  29. package/lib/common/di/multi-binding.d.ts +19 -4
  30. package/lib/common/di/multi-binding.d.ts.map +1 -1
  31. package/lib/common/di/multi-binding.js.map +1 -1
  32. package/lib/common/di/server-module.d.ts +1 -6
  33. package/lib/common/di/server-module.d.ts.map +1 -1
  34. package/lib/common/di/server-module.js +21 -17
  35. package/lib/common/di/server-module.js.map +1 -1
  36. package/lib/common/index.d.ts +1 -2
  37. package/lib/common/index.d.ts.map +1 -1
  38. package/lib/common/index.js +1 -2
  39. package/lib/common/index.js.map +1 -1
  40. package/lib/common/launch/glsp-server-launcher.d.ts +1 -1
  41. package/lib/common/launch/glsp-server-launcher.d.ts.map +1 -1
  42. package/lib/common/launch/glsp-server-launcher.js +2 -2
  43. package/lib/common/launch/glsp-server-launcher.js.map +1 -1
  44. package/lib/common/launch/jsonrpc-server-launcher.d.ts +38 -0
  45. package/lib/common/launch/jsonrpc-server-launcher.d.ts.map +1 -0
  46. package/lib/common/launch/jsonrpc-server-launcher.js +84 -0
  47. package/lib/common/launch/jsonrpc-server-launcher.js.map +1 -0
  48. package/lib/common/protocol/glsp-server.d.ts +4 -104
  49. package/lib/common/protocol/glsp-server.d.ts.map +1 -1
  50. package/lib/common/protocol/glsp-server.js +13 -20
  51. package/lib/common/protocol/glsp-server.js.map +1 -1
  52. package/lib/common/session/client-session-factory.d.ts +1 -2
  53. package/lib/common/session/client-session-factory.d.ts.map +1 -1
  54. package/lib/common/session/client-session-factory.js +17 -2
  55. package/lib/common/session/client-session-factory.js.map +1 -1
  56. package/lib/common/session/client-session-manager.d.ts +1 -3
  57. package/lib/common/session/client-session-manager.d.ts.map +1 -1
  58. package/lib/common/session/client-session-manager.js.map +1 -1
  59. package/lib/{browser/di → common/utils}/console-logger.d.ts +7 -1
  60. package/lib/common/utils/console-logger.d.ts.map +1 -0
  61. package/lib/{browser/di → common/utils}/console-logger.js +26 -8
  62. package/lib/common/utils/console-logger.js.map +1 -0
  63. package/lib/common/utils/logger.d.ts +21 -0
  64. package/lib/common/utils/logger.d.ts.map +1 -1
  65. package/lib/common/utils/logger.js +12 -1
  66. package/lib/common/utils/logger.js.map +1 -1
  67. package/lib/node/di/app-module.d.ts +2 -2
  68. package/lib/node/di/app-module.d.ts.map +1 -1
  69. package/lib/node/di/app-module.js +10 -35
  70. package/lib/node/di/app-module.js.map +1 -1
  71. package/lib/node/launch/cli-parser.d.ts +2 -3
  72. package/lib/node/launch/cli-parser.d.ts.map +1 -1
  73. package/lib/node/launch/cli-parser.js.map +1 -1
  74. package/lib/node/launch/socket-cli-parser.js +1 -1
  75. package/lib/node/launch/socket-cli-parser.js.map +1 -1
  76. package/lib/node/launch/socket-server-launcher.d.ts +2 -23
  77. package/lib/node/launch/socket-server-launcher.d.ts.map +1 -1
  78. package/lib/node/launch/socket-server-launcher.js +8 -28
  79. package/lib/node/launch/socket-server-launcher.js.map +1 -1
  80. package/lib/node/launch/websocket-server-launcher.d.ts +2 -8
  81. package/lib/node/launch/websocket-server-launcher.d.ts.map +1 -1
  82. package/lib/node/launch/websocket-server-launcher.js +4 -28
  83. package/lib/node/launch/websocket-server-launcher.js.map +1 -1
  84. package/package.json +4 -4
  85. package/src/browser/di/app-module.ts +4 -32
  86. package/src/browser/index.ts +0 -1
  87. package/src/browser/launch/worker-server-launcher.ts +7 -13
  88. package/src/common/actions/client-action-handler.ts +1 -2
  89. package/src/common/command/command-stack.ts +1 -1
  90. package/src/common/di/client-session-module.ts +1 -1
  91. package/src/common/di/glsp-module.ts +3 -1
  92. package/src/common/di/multi-binding.ts +4 -5
  93. package/src/common/di/server-module.ts +6 -21
  94. package/src/common/index.ts +1 -2
  95. package/src/common/launch/glsp-server-launcher.ts +2 -2
  96. package/src/common/launch/jsonrpc-server-launcher.ts +95 -0
  97. package/src/common/protocol/glsp-server.spec.ts +7 -4
  98. package/src/common/protocol/glsp-server.ts +17 -132
  99. package/src/common/session/client-session-factory.spec.ts +1 -1
  100. package/src/common/session/client-session-factory.ts +1 -2
  101. package/src/common/session/client-session-manager.ts +1 -3
  102. package/src/common/test/mock-util.ts +5 -5
  103. package/src/{browser/di → common/utils}/console-logger.ts +19 -1
  104. package/src/common/utils/logger.ts +16 -1
  105. package/src/node/di/app-module.ts +4 -13
  106. package/src/node/launch/cli-parser.ts +2 -3
  107. package/src/node/launch/socket-cli-parser.ts +1 -1
  108. package/src/node/launch/socket-server-launcher.spec.ts +6 -0
  109. package/src/node/launch/socket-server-launcher.ts +8 -30
  110. package/src/node/launch/websocket-server-launcher.ts +5 -31
  111. package/lib/browser/di/console-logger.d.ts.map +0 -1
  112. package/lib/browser/di/console-logger.js.map +0 -1
  113. package/lib/common/actions/action-dispatcher.spec.d.ts +0 -2
  114. package/lib/common/actions/action-dispatcher.spec.d.ts.map +0 -1
  115. package/lib/common/actions/action-dispatcher.spec.js +0 -264
  116. package/lib/common/actions/action-dispatcher.spec.js.map +0 -1
  117. package/lib/common/actions/action-handler-registry.spec.d.ts +0 -2
  118. package/lib/common/actions/action-handler-registry.spec.d.ts.map +0 -1
  119. package/lib/common/actions/action-handler-registry.spec.js +0 -50
  120. package/lib/common/actions/action-handler-registry.spec.js.map +0 -1
  121. package/lib/common/actions/global-action-provider.spec.d.ts +0 -2
  122. package/lib/common/actions/global-action-provider.spec.d.ts.map +0 -1
  123. package/lib/common/actions/global-action-provider.spec.js +0 -70
  124. package/lib/common/actions/global-action-provider.spec.js.map +0 -1
  125. package/lib/common/command/command-stack.spec.d.ts +0 -2
  126. package/lib/common/command/command-stack.spec.d.ts.map +0 -1
  127. package/lib/common/command/command-stack.spec.js +0 -207
  128. package/lib/common/command/command-stack.spec.js.map +0 -1
  129. package/lib/common/command/command.spec.d.ts +0 -2
  130. package/lib/common/command/command.spec.d.ts.map +0 -1
  131. package/lib/common/command/command.spec.js +0 -86
  132. package/lib/common/command/command.spec.js.map +0 -1
  133. package/lib/common/command/recording-command.spec.d.ts +0 -17
  134. package/lib/common/command/recording-command.spec.d.ts.map +0 -1
  135. package/lib/common/command/recording-command.spec.js +0 -62
  136. package/lib/common/command/recording-command.spec.js.map +0 -1
  137. package/lib/common/di/binding-target.spec.d.ts +0 -2
  138. package/lib/common/di/binding-target.spec.d.ts.map +0 -1
  139. package/lib/common/di/binding-target.spec.js +0 -121
  140. package/lib/common/di/binding-target.spec.js.map +0 -1
  141. package/lib/common/di/multi-bindings.spec.d.ts +0 -2
  142. package/lib/common/di/multi-bindings.spec.d.ts.map +0 -1
  143. package/lib/common/di/multi-bindings.spec.js +0 -137
  144. package/lib/common/di/multi-bindings.spec.js.map +0 -1
  145. package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts +0 -2
  146. package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts.map +0 -1
  147. package/lib/common/diagram/request-type-hints-action-handler.spec.js +0 -57
  148. package/lib/common/diagram/request-type-hints-action-handler.spec.js.map +0 -1
  149. package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts +0 -2
  150. package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts.map +0 -1
  151. package/lib/common/features/contextactions/context-actions-provider-registry.spec.js +0 -34
  152. package/lib/common/features/contextactions/context-actions-provider-registry.spec.js.map +0 -1
  153. package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts +0 -2
  154. package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts.map +0 -1
  155. package/lib/common/features/contextactions/request-context-actions-handler.spec.js +0 -63
  156. package/lib/common/features/contextactions/request-context-actions-handler.spec.js.map +0 -1
  157. package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts +0 -2
  158. package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts.map +0 -1
  159. package/lib/common/features/contextactions/tool-palette-item-provider.spec.js +0 -48
  160. package/lib/common/features/contextactions/tool-palette-item-provider.spec.js.map +0 -1
  161. package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts +0 -2
  162. package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts.map +0 -1
  163. package/lib/common/features/directediting/context-edit-validator-registry.spec.js +0 -44
  164. package/lib/common/features/directediting/context-edit-validator-registry.spec.js.map +0 -1
  165. package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts +0 -2
  166. package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts.map +0 -1
  167. package/lib/common/features/directediting/request-edit-validation-handler.spec.js +0 -97
  168. package/lib/common/features/directediting/request-edit-validation-handler.spec.js.map +0 -1
  169. package/lib/common/features/model/gmodel-serializer.spec.d.ts +0 -2
  170. package/lib/common/features/model/gmodel-serializer.spec.d.ts.map +0 -1
  171. package/lib/common/features/model/gmodel-serializer.spec.js +0 -124
  172. package/lib/common/features/model/gmodel-serializer.spec.js.map +0 -1
  173. package/lib/common/operations/operation-handler-registry.spec.d.ts +0 -2
  174. package/lib/common/operations/operation-handler-registry.spec.d.ts.map +0 -1
  175. package/lib/common/operations/operation-handler-registry.spec.js +0 -50
  176. package/lib/common/operations/operation-handler-registry.spec.js.map +0 -1
  177. package/lib/common/protocol/glsp-client-proxy.d.ts +0 -45
  178. package/lib/common/protocol/glsp-client-proxy.d.ts.map +0 -1
  179. package/lib/common/protocol/glsp-client-proxy.js +0 -53
  180. package/lib/common/protocol/glsp-client-proxy.js.map +0 -1
  181. package/lib/common/protocol/glsp-server-listener.d.ts +0 -37
  182. package/lib/common/protocol/glsp-server-listener.d.ts.map +0 -1
  183. package/lib/common/protocol/glsp-server-listener.js +0 -5
  184. package/lib/common/protocol/glsp-server-listener.js.map +0 -1
  185. package/lib/common/protocol/glsp-server.spec.d.ts +0 -2
  186. package/lib/common/protocol/glsp-server.spec.d.ts.map +0 -1
  187. package/lib/common/protocol/glsp-server.spec.js +0 -119
  188. package/lib/common/protocol/glsp-server.spec.js.map +0 -1
  189. package/lib/common/session/client-session-factory.spec.d.ts +0 -2
  190. package/lib/common/session/client-session-factory.spec.d.ts.map +0 -1
  191. package/lib/common/session/client-session-factory.spec.js +0 -56
  192. package/lib/common/session/client-session-factory.spec.js.map +0 -1
  193. package/lib/common/session/client-session-manager.spec.d.ts +0 -2
  194. package/lib/common/session/client-session-manager.spec.d.ts.map +0 -1
  195. package/lib/common/session/client-session-manager.spec.js +0 -74
  196. package/lib/common/session/client-session-manager.spec.js.map +0 -1
  197. package/lib/common/test/mock-util.d.ts +0 -123
  198. package/lib/common/test/mock-util.d.ts.map +0 -1
  199. package/lib/common/test/mock-util.js +0 -216
  200. package/lib/common/test/mock-util.js.map +0 -1
  201. package/lib/common/utils/promise-queue.spec.d.ts +0 -2
  202. package/lib/common/utils/promise-queue.spec.d.ts.map +0 -1
  203. package/lib/common/utils/promise-queue.spec.js +0 -117
  204. package/lib/common/utils/promise-queue.spec.js.map +0 -1
  205. package/lib/common/utils/registry.spec.d.ts +0 -2
  206. package/lib/common/utils/registry.spec.d.ts.map +0 -1
  207. package/lib/common/utils/registry.spec.js +0 -199
  208. package/lib/common/utils/registry.spec.js.map +0 -1
  209. package/lib/node/launch/cli-parser.spec.d.ts +0 -2
  210. package/lib/node/launch/cli-parser.spec.d.ts.map +0 -1
  211. package/lib/node/launch/cli-parser.spec.js +0 -56
  212. package/lib/node/launch/cli-parser.spec.js.map +0 -1
  213. package/lib/node/launch/socket-cli-parser.spec.d.ts +0 -2
  214. package/lib/node/launch/socket-cli-parser.spec.d.ts.map +0 -1
  215. package/lib/node/launch/socket-cli-parser.spec.js +0 -66
  216. package/lib/node/launch/socket-cli-parser.spec.js.map +0 -1
  217. package/lib/node/launch/socket-server-launcher.spec.d.ts +0 -17
  218. package/lib/node/launch/socket-server-launcher.spec.d.ts.map +0 -1
  219. package/lib/node/launch/socket-server-launcher.spec.js +0 -70
  220. package/lib/node/launch/socket-server-launcher.spec.js.map +0 -1
  221. package/src/common/protocol/glsp-client-proxy.ts +0 -65
  222. package/src/common/protocol/glsp-server-listener.ts +0 -39
@@ -1,199 +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 registry_1 = require("./registry");
19
- const chai_1 = require("chai");
20
- describe('Test Registry', () => {
21
- let registry;
22
- beforeEach(() => {
23
- registry = new registry_1.Registry();
24
- });
25
- it('register - with new key-value pair', () => {
26
- const key = 'key';
27
- const value = 'value';
28
- (0, chai_1.expect)(registry.register(key, value)).true;
29
- (0, chai_1.expect)(registry.get(key), value);
30
- });
31
- it('register - with key-value pair with a already registered key', () => {
32
- // Setup
33
- const key = 'key';
34
- const value = 'value';
35
- (0, chai_1.expect)(registry.register(key, value)).true;
36
- // Test execution
37
- (0, chai_1.expect)(registry.register(key, 'newValue')).false;
38
- (0, chai_1.expect)(registry.get(key), value);
39
- });
40
- it('deregister - with registered key', () => {
41
- // Setup
42
- const key = 'key';
43
- const value = 'value';
44
- (0, chai_1.expect)(registry.register(key, value)).true;
45
- // Test execution
46
- (0, chai_1.expect)(registry.deregister(key)).true;
47
- (0, chai_1.expect)(registry.get(key), undefined);
48
- });
49
- it('deregister - with unregistered key', () => {
50
- (0, chai_1.expect)(registry.deregister('unregisteredKey')).false;
51
- });
52
- it('haskey - with registered key', () => {
53
- // Setup
54
- const key = 'key';
55
- const value = 'value';
56
- (0, chai_1.expect)(registry.register(key, value)).true;
57
- // Test execution
58
- (0, chai_1.expect)(registry.hasKey(key)).true;
59
- });
60
- it('haskey - with unregistered key', () => {
61
- (0, chai_1.expect)(registry.deregister('unregisteredKey')).false;
62
- });
63
- it('get - with registered key', () => {
64
- // Setup
65
- const key = 'key';
66
- const value = 'value';
67
- (0, chai_1.expect)(registry.register(key, value)).true;
68
- // Test execution
69
- (0, chai_1.expect)(registry.get(key), value);
70
- });
71
- it('get - with unregistered key', () => {
72
- (0, chai_1.expect)(registry.get('unregisteredKey'), undefined);
73
- });
74
- it('getAll - should return three values', () => {
75
- // Setup
76
- const e1 = { key: 'key1', value: 'value1' };
77
- const e2 = { key: 'key2', value: 'value2' };
78
- const e3 = { key: 'key3', value: 'value3' };
79
- registry.register(e1.key, e1.value);
80
- registry.register(e2.key, e2.value);
81
- registry.register(e3.key, e3.value);
82
- // Test execution
83
- const result = registry.getAll();
84
- (0, chai_1.expect)(result).to.have.length(3);
85
- (0, chai_1.expect)(result.includes(e1.value)).true;
86
- (0, chai_1.expect)(result.includes(e2.value)).true;
87
- (0, chai_1.expect)(result.includes(e3.value)).true;
88
- });
89
- it('keys - should return three keys', () => {
90
- // Setup
91
- const e1 = { key: 'key1', value: 'value1' };
92
- const e2 = { key: 'key2', value: 'value2' };
93
- const e3 = { key: 'key3', value: 'value3' };
94
- registry.register(e1.key, e1.value);
95
- registry.register(e2.key, e2.value);
96
- registry.register(e3.key, e3.value);
97
- // Test execution
98
- const result = registry.keys();
99
- (0, chai_1.expect)(result).to.have.length(3);
100
- (0, chai_1.expect)(result.includes(e1.key)).true;
101
- (0, chai_1.expect)(result.includes(e2.key)).true;
102
- (0, chai_1.expect)(result.includes(e3.key)).true;
103
- });
104
- });
105
- describe('Test MapMultiRegistry', () => {
106
- let multiRegistry;
107
- beforeEach(() => {
108
- multiRegistry = new registry_1.MultiRegistry();
109
- });
110
- it('register - with new key-value pair', () => {
111
- // Setup
112
- const e1 = { key: 'key', value: 'value' };
113
- const e2 = { key: e1.key, value: 'value2' };
114
- multiRegistry.register(e1.key, e1.value);
115
- multiRegistry.register(e2.key, e2.value);
116
- const resultValue = multiRegistry.get(e1.key);
117
- (0, chai_1.expect)(resultValue).to.not.be.undefined;
118
- (0, chai_1.expect)(resultValue.length).to.be.equal(2);
119
- (0, chai_1.expect)(resultValue.includes(e1.value)).true;
120
- (0, chai_1.expect)(resultValue.includes(e2.value)).true;
121
- });
122
- it('deregister - with registered key', () => {
123
- // Setup
124
- const key = 'key';
125
- const existingValue = ['value', 'value2'];
126
- multiRegistry.register(key, existingValue[0]);
127
- multiRegistry.register(key, existingValue[1]);
128
- // Test execution
129
- (0, chai_1.expect)(multiRegistry.deregister(key, existingValue[1])).true;
130
- const result = multiRegistry.get(key);
131
- (0, chai_1.expect)(result.length).to.be.equal(1);
132
- (0, chai_1.expect)(result[0], existingValue[0]);
133
- });
134
- it('deregister - with unregistered key', () => {
135
- (0, chai_1.expect)(multiRegistry.deregister('unregisteredKey', 'someValue')).false;
136
- });
137
- it('deregisterAll - with registered key', () => {
138
- // Setup
139
- const key = 'key';
140
- const existingValue = ['value', 'value2'];
141
- multiRegistry.register(key, existingValue[0]);
142
- multiRegistry.register(key, existingValue[1]);
143
- (0, chai_1.expect)(multiRegistry.deregisterAll(key)).true;
144
- (0, chai_1.expect)(multiRegistry.get(key)).to.have.length(0);
145
- });
146
- it('deregisterAll - with unregistered key', () => {
147
- (0, chai_1.expect)(multiRegistry.deregisterAll('unregisteredKey')).false;
148
- });
149
- it('haskey - with registered key', () => {
150
- // Setup
151
- const key = 'key';
152
- const existingValue = 'value';
153
- multiRegistry.register(key, existingValue);
154
- // Test execution
155
- (0, chai_1.expect)(multiRegistry.hasKey(key)).true;
156
- });
157
- it('haskey - with unregistered key', () => {
158
- (0, chai_1.expect)(multiRegistry.hasKey('unregisteredKey')).false;
159
- });
160
- it('get - with registered key', () => {
161
- // Setup
162
- const key = 'key';
163
- const existingValue = 'value';
164
- multiRegistry.register(key, existingValue);
165
- // Test execution
166
- (0, chai_1.expect)(multiRegistry.get(key).length).to.be.equal(1);
167
- (0, chai_1.expect)(multiRegistry.get(key).includes(existingValue)).true;
168
- });
169
- it('get - with unregistered key', () => {
170
- (0, chai_1.expect)(multiRegistry.get('unregisteredKey')).to.have.length(0);
171
- });
172
- it('getAll', () => {
173
- // Setup
174
- const e1 = { key: 'key1', value: ['value1', 'value2'] };
175
- const e2 = { key: 'key2', value: ['value3'] };
176
- multiRegistry.register(e1.key, e1.value[0]);
177
- multiRegistry.register(e1.key, e1.value[1]);
178
- multiRegistry.register(e2.key, e2.value[0]);
179
- // Test execution
180
- const result = multiRegistry.getAll();
181
- (0, chai_1.expect)(result).to.have.length(3);
182
- (0, chai_1.expect)(e1.value.every(v => result.includes(v))).true;
183
- (0, chai_1.expect)(e2.value.every(v => result.includes(v))).true;
184
- });
185
- it('keys', () => {
186
- // Setup
187
- const e1 = { key: 'key1', value: ['value1', 'value2'] };
188
- const e2 = { key: 'key2', value: ['value3'] };
189
- multiRegistry.register(e1.key, e1.value[0]);
190
- multiRegistry.register(e1.key, e1.value[1]);
191
- multiRegistry.register(e2.key, e2.value[0]);
192
- // Test execution
193
- const result = multiRegistry.keys();
194
- (0, chai_1.expect)(result.length).to.be.equal(2);
195
- (0, chai_1.expect)(result.includes(e1.key)).true;
196
- (0, chai_1.expect)(result.includes(e2.key)).true;
197
- });
198
- });
199
- //# sourceMappingURL=registry.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.spec.js","sourceRoot":"","sources":["../../../src/common/utils/registry.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yCAAqD;AACrD,+BAA8B;AAE9B,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC3B,IAAI,QAAkC,CAAC;IAEvC,UAAU,CAAC,GAAG,EAAE;QACZ,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC1C,MAAM,GAAG,GAAG,KAAK,CAAC;QAClB,MAAM,KAAK,GAAG,OAAO,CAAC;QACtB,IAAA,aAAM,EAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3C,IAAA,aAAM,EAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;Q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,EAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;QACrC,IAAA,aAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IACzC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=cli-parser.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-parser.spec.d.ts","sourceRoot":"","sources":["../../../src/node/launch/cli-parser.spec.ts"],"names":[],"mappings":""}
@@ -1,56 +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 path = require("path");
20
- const logger_1 = require("../../common/utils/logger");
21
- const cli_parser_1 = require("./cli-parser");
22
- describe('test createCliParser', () => {
23
- const parser = (0, cli_parser_1.createCliParser)();
24
- parser.command.exitOverride();
25
- const argv = ['/usr/bin/node', 'test'];
26
- it('parse - no args', () => {
27
- const options = parser.parse(argv);
28
- (0, chai_1.expect)(options).to.deep.equal(cli_parser_1.defaultLaunchOptions);
29
- });
30
- it('parse - invalid log dir', () => {
31
- (0, chai_1.expect)(() => parser.parse([...argv, '--logDir', 'invalid.Path'])).to.throw();
32
- });
33
- it('parse - valid log dir', () => {
34
- const logDir = path.resolve('../customLog');
35
- const result = parser.parse([...argv, '--logDir', '../customLog/']);
36
- (0, chai_1.expect)(result.logDir, logDir);
37
- });
38
- it('parse - invalid logLevel', () => {
39
- (0, chai_1.expect)(() => parser.parse([...argv, '--logLevel', 'someRandomLevel'])).to.throw();
40
- });
41
- it('parse - valid logLevel', () => {
42
- const result = parser.parse([...argv, '--logLevel', 'error']);
43
- (0, chai_1.expect)(result.logLevel).to.be.equal(logger_1.LogLevel.error);
44
- });
45
- it('parse- no args with custom default options', () => {
46
- const options = {
47
- logDir: '.myLogDir',
48
- logLevel: logger_1.LogLevel.debug,
49
- consoleLog: false,
50
- fileLog: true
51
- };
52
- const result = (0, cli_parser_1.createCliParser)(options).parse(argv);
53
- (0, chai_1.expect)(result).to.deep.equal(options);
54
- });
55
- });
56
- //# sourceMappingURL=cli-parser.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-parser.spec.js","sourceRoot":"","sources":["../../../src/node/launch/cli-parser.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+BAA8B;AAC9B,6BAA6B;AAC7B,sDAAqD;AACrD,6CAAqE;AAErE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAClC,MAAM,MAAM,GAAG,IAAA,4BAAe,GAAE,CAAC;IAEjC,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;IAC9B,MAAM,IAAI,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAEvC,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACvB,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACnC,IAAA,aAAM,EAAC,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,iCAAoB,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QAC/B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,MAAM,GAAG,IAAA,4BAAe,EAAC,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpD,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=socket-cli-parser.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"socket-cli-parser.spec.d.ts","sourceRoot":"","sources":["../../../src/node/launch/socket-cli-parser.spec.ts"],"names":[],"mappings":""}
@@ -1,66 +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 logger_1 = require("../../common/utils/logger");
20
- const socket_cli_parser_1 = require("./socket-cli-parser");
21
- describe('test createCliParser', () => {
22
- const parser = (0, socket_cli_parser_1.createSocketCliParser)();
23
- parser.command.exitOverride();
24
- const argv = ['/usr/bin/node', 'test'];
25
- it('parse - no args', () => {
26
- const options = parser.parse(argv);
27
- (0, chai_1.expect)(options).to.deep.equal(socket_cli_parser_1.defaultSocketLaunchOptions);
28
- });
29
- it('parse - invalid port (below lower range)', () => {
30
- (0, chai_1.expect)(() => parser.parse([...argv, '--port', '-1'])).to.throw();
31
- });
32
- it('parse - invalid port (below upper range)', () => {
33
- (0, chai_1.expect)(() => parser.parse([...argv, '--port', '65536'])).to.throw();
34
- });
35
- it('parse - valid port', () => {
36
- const port = 3000;
37
- const result = parser.parse([...argv, '--port', '3000']);
38
- (0, chai_1.expect)(result.port).to.equal(port);
39
- });
40
- it('parse - --no-consoleLog', () => {
41
- const result = parser.parse([...argv, '--no-consoleLog']);
42
- (0, chai_1.expect)(result.consoleLog).false;
43
- });
44
- it('parse - --fileLog', () => {
45
- const result = parser.parse([...argv, '--fileLog']);
46
- (0, chai_1.expect)(result.fileLog).true;
47
- });
48
- it('parse - custom host name', () => {
49
- const host = 'docker.internal';
50
- const result = parser.parse([...argv, '--host', host]);
51
- (0, chai_1.expect)(result.host, host);
52
- });
53
- it('parse- no args with custom default options', () => {
54
- const options = {
55
- logDir: '.myLogDir',
56
- logLevel: logger_1.LogLevel.debug,
57
- consoleLog: true,
58
- fileLog: true,
59
- host: 'myHost',
60
- port: 3000
61
- };
62
- const result = (0, socket_cli_parser_1.createSocketCliParser)(options).parse(argv);
63
- (0, chai_1.expect)(result).to.deep.equal(options);
64
- });
65
- });
66
- //# sourceMappingURL=socket-cli-parser.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"socket-cli-parser.spec.js","sourceRoot":"","sources":["../../../src/node/launch/socket-cli-parser.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+BAA8B;AAC9B,sDAAqD;AACrD,2DAA6G;AAE7G,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAClC,MAAM,MAAM,GAAG,IAAA,yCAAqB,GAAE,CAAC;IAEvC,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;IAC9B,MAAM,IAAI,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAEvC,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACvB,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,I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,KAAK,CAAC,CAAC,GAAG,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;QACpD,IAAA,aAAM,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAChC,MAAM,IAAI,GAAG,iBAAiB,CAAC;QAC/B,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;QACvD,IAAA,aAAM,EAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QAClD,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,WAAW;YACnB,QAAQ,EAAE,iBAAQ,CAAC,KAAK;YACxB,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,IAAI;SACb,CAAC;QACF,MAAM,MAAM,GAAG,IAAA,yCAAqB,EAAC,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1D,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,17 +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
- export {};
17
- //# sourceMappingURL=socket-server-launcher.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"socket-server-launcher.spec.d.ts","sourceRoot":"","sources":["../../../src/node/launch/socket-server-launcher.spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF"}
@@ -1,70 +0,0 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (c) 2022-2023 STMicroelectronics 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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- const chai_1 = require("chai");
19
- const inversify_1 = require("inversify");
20
- const net = require("net");
21
- const app_module_1 = require("../di/app-module");
22
- const socket_cli_parser_1 = require("./socket-cli-parser");
23
- const socket_server_launcher_1 = require("./socket-server-launcher");
24
- const severPort = 5008;
25
- describe('test SocketServerLauncher', () => {
26
- it('starts and stops', async () => {
27
- const appContainer = new inversify_1.Container();
28
- appContainer.load((0, app_module_1.createAppModule)(socket_cli_parser_1.defaultSocketLaunchOptions));
29
- const launcher = appContainer.resolve(socket_server_launcher_1.SocketServerLauncher);
30
- launcher.start({ port: severPort });
31
- const sockStart = new net.Socket();
32
- sockStart.setTimeout(100);
33
- const startPromise = new Promise(res => {
34
- sockStart
35
- .on('connect', () => {
36
- (0, chai_1.expect)(true);
37
- sockStart.destroy();
38
- res(true);
39
- })
40
- .on('error', e => {
41
- chai_1.expect.fail('Server is not reachable: ' + e.message);
42
- })
43
- .on('timeout', () => {
44
- chai_1.expect.fail('Connection time outed.');
45
- })
46
- .connect(severPort);
47
- });
48
- await startPromise;
49
- launcher.shutdown();
50
- const sockStop = new net.Socket();
51
- sockStop.setTimeout(100);
52
- const stopPromise = new Promise(res => {
53
- sockStop
54
- .on('connect', () => {
55
- chai_1.expect.fail('Server still reachable.');
56
- })
57
- .on('error', () => {
58
- (0, chai_1.expect)(true);
59
- sockStop.destroy();
60
- res(true);
61
- })
62
- .on('timeout', () => {
63
- chai_1.expect.fail('Connection time outed.');
64
- })
65
- .connect(severPort);
66
- });
67
- await stopPromise;
68
- });
69
- });
70
- //# sourceMappingURL=socket-server-launcher.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"socket-server-launcher.spec.js","sourceRoot":"","sources":["../../../src/node/launch/socket-server-launcher.spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,+BAA8B;AAC9B,yCAAsC;AACtC,2BAA2B;AAC3B,iDAAmD;AACnD,2DAAiE;AACjE,qEAAgE;AAChE,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,YAAY,GAAG,IAAI,qBAAS,EAAE,CAAC;QACrC,YAAY,CAAC,IAAI,CAAC,IAAA,4BAAe,EAAC,8CAA0B,CAAC,CAAC,CAAC;QAC/D,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,6CAAoB,CAAC,CAAC;QAC5D,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;QACpC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QACnC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAC1B,MAAM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AAC;QAC5B,CAAC,CAAC,CAAC;QACH,MAAM,WAAW,CAAC;IACtB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,65 +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 { ActionMessage, JsonrpcGLSPClient } from '@eclipse-glsp/protocol';
17
- import { inject, injectable } from 'inversify';
18
- import * as jsonrpc from 'vscode-jsonrpc';
19
- import { Logger } from '../utils/logger';
20
-
21
- export const GLSPClientProxyFactory = Symbol('GLSPClientProxyFactory');
22
-
23
- export type GLSPClientProxyFactory = (connection: jsonrpc.MessageConnection) => GLSPClientProxy;
24
-
25
- export const GLSPClientProxy = Symbol('GLSPClientProxy');
26
-
27
- /**
28
- * Json-rpc client proxy interface to hide the underlying json-rpc logic.
29
- */
30
- export interface GLSPClientProxy {
31
- /**
32
- * A `process` notification is sent from the server to server to the client when the client should handle i.e.
33
- * process a specific {@link ActionMessage}. Any communication that is performed between initialization and shutdown
34
- * is handled by sending action messages, either from the client to the server or from the server to the client. This
35
- * is the core part of the Graphical Language Server Protocol.
36
- *
37
- * @param message The {@link ActionMessage} that should be processed.
38
- */
39
- process(message: ActionMessage): void;
40
- }
41
-
42
- export const JsonRpcGLSPClientProxy = Symbol('JsonRpcGLSPClientProxy');
43
-
44
- export interface JsonRpcGLSPClientProxy extends GLSPClientProxy {
45
- connect(connection: jsonrpc.MessageConnection): void;
46
- }
47
-
48
- @injectable()
49
- export class DefaultGLSPClientProxy implements JsonRpcGLSPClientProxy {
50
- @inject(Logger)
51
- private logger: Logger;
52
-
53
- protected connection: jsonrpc.MessageConnection;
54
-
55
- connect(connection: jsonrpc.MessageConnection): void {
56
- if (!this.connection) {
57
- this.connection = connection;
58
- }
59
- }
60
-
61
- process(message: ActionMessage): void {
62
- this.logger.debug(`Send action '${message.action.kind}' to client '${message.clientId}'`);
63
- this.connection.sendNotification(JsonrpcGLSPClient.ActionMessageNotification, message);
64
- }
65
- }
@@ -1,39 +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 { GLSPServer } from './glsp-server';
17
-
18
- export const GLSPServerListener = Symbol('GLSPServerListener');
19
-
20
- /**
21
- * A listener to track the connection status of {@link GLSPClient}s (i.e. client applications).
22
- * Gets notified when a new GLSP client connects or disconnects.
23
- */
24
- export interface GLSPServerListener {
25
- /**
26
- * Triggered after a GLSPServer has been initialized via the {@link GLSPServer.initialize()}
27
- * method.
28
- *
29
- * @param server The GLSPServer which has been initialized.
30
- */
31
- serverInitialized?(server: GLSPServer): void;
32
-
33
- /**
34
- * Triggered after the {@link GLSPServer.shutdown()} method has been invoked.
35
- *
36
- * @param glspServer The glspServer which has been shut down.
37
- */
38
- serverShutDown?(server: GLSPServer): void;
39
- }