@eclipse-glsp/server 1.1.0-RC10 → 1.1.0-next.342c713.66

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 (238) hide show
  1. package/lib/browser/launch/worker-server-launcher.js +26 -2
  2. package/lib/browser/launch/worker-server-launcher.js.map +1 -1
  3. package/lib/common/actions/action-dispatcher.d.ts +2 -1
  4. package/lib/common/actions/action-dispatcher.d.ts.map +1 -1
  5. package/lib/common/actions/action-dispatcher.js +9 -6
  6. package/lib/common/actions/action-dispatcher.js.map +1 -1
  7. package/lib/common/actions/action-handler-registry.js +4 -2
  8. package/lib/common/actions/action-handler-registry.js.map +1 -1
  9. package/lib/common/actions/client-action-handler.d.ts +17 -8
  10. package/lib/common/actions/client-action-handler.d.ts.map +1 -1
  11. package/lib/common/actions/client-action-handler.js +32 -21
  12. package/lib/common/actions/client-action-handler.js.map +1 -1
  13. package/lib/common/actions/global-action-provider.d.ts +6 -21
  14. package/lib/common/actions/global-action-provider.d.ts.map +1 -1
  15. package/lib/common/actions/global-action-provider.js +17 -21
  16. package/lib/common/actions/global-action-provider.js.map +1 -1
  17. package/lib/common/command/command-stack.js +2 -1
  18. package/lib/common/command/command-stack.js.map +1 -1
  19. package/lib/common/command/recording-command.d.ts +9 -14
  20. package/lib/common/command/recording-command.d.ts.map +1 -1
  21. package/lib/common/command/recording-command.js +36 -27
  22. package/lib/common/command/recording-command.js.map +1 -1
  23. package/lib/common/command/undo-redo-action-handler.js +2 -1
  24. package/lib/common/command/undo-redo-action-handler.js.map +1 -1
  25. package/lib/common/di/client-session-module.d.ts +9 -1
  26. package/lib/common/di/client-session-module.d.ts.map +1 -1
  27. package/lib/common/di/client-session-module.js +9 -9
  28. package/lib/common/di/client-session-module.js.map +1 -1
  29. package/lib/common/di/diagram-module.d.ts +20 -1
  30. package/lib/common/di/diagram-module.d.ts.map +1 -1
  31. package/lib/common/di/diagram-module.js +10 -48
  32. package/lib/common/di/diagram-module.js.map +1 -1
  33. package/lib/common/di/glsp-module.js +2 -1
  34. package/lib/common/di/glsp-module.js.map +1 -1
  35. package/lib/common/di/server-module.d.ts +0 -1
  36. package/lib/common/di/server-module.d.ts.map +1 -1
  37. package/lib/common/di/server-module.js +0 -1
  38. package/lib/common/di/server-module.js.map +1 -1
  39. package/lib/common/diagram/request-type-hints-action-handler.js +2 -1
  40. package/lib/common/diagram/request-type-hints-action-handler.js.map +1 -1
  41. package/lib/common/features/clipboard/request-clipboard-data-action-handler.js +2 -1
  42. package/lib/common/features/clipboard/request-clipboard-data-action-handler.js.map +1 -1
  43. package/lib/common/features/contextactions/command-palette-action-provider.js +2 -1
  44. package/lib/common/features/contextactions/command-palette-action-provider.js.map +1 -1
  45. package/lib/common/features/contextactions/context-actions-provider-registry.js +2 -1
  46. package/lib/common/features/contextactions/context-actions-provider-registry.js.map +1 -1
  47. package/lib/common/features/contextactions/context-menu-item-provider.js +2 -1
  48. package/lib/common/features/contextactions/context-menu-item-provider.js.map +1 -1
  49. package/lib/common/features/contextactions/request-context-actions-handler.js +2 -1
  50. package/lib/common/features/contextactions/request-context-actions-handler.js.map +1 -1
  51. package/lib/common/features/contextactions/tool-palette-item-provider.js +4 -2
  52. package/lib/common/features/contextactions/tool-palette-item-provider.js.map +1 -1
  53. package/lib/common/features/directediting/context-edit-validator-registry.js +2 -1
  54. package/lib/common/features/directediting/context-edit-validator-registry.js.map +1 -1
  55. package/lib/common/features/directediting/label-edit-validator.js +2 -1
  56. package/lib/common/features/directediting/label-edit-validator.js.map +1 -1
  57. package/lib/common/features/directediting/request-edit-validation-handler.js +2 -1
  58. package/lib/common/features/directediting/request-edit-validation-handler.js.map +1 -1
  59. package/lib/common/features/layout/computed-bounds-action-handler.js +2 -1
  60. package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -1
  61. package/lib/common/features/layout/layout-operation-handler.js +2 -1
  62. package/lib/common/features/layout/layout-operation-handler.js.map +1 -1
  63. package/lib/common/features/model/gmodel-factory.js +2 -1
  64. package/lib/common/features/model/gmodel-factory.js.map +1 -1
  65. package/lib/common/features/model/gmodel-index.js +2 -1
  66. package/lib/common/features/model/gmodel-index.js.map +1 -1
  67. package/lib/common/features/model/gmodel-serializer.js +2 -1
  68. package/lib/common/features/model/gmodel-serializer.js.map +1 -1
  69. package/lib/common/features/model/model-state.d.ts.map +1 -1
  70. package/lib/common/features/model/model-state.js +5 -1
  71. package/lib/common/features/model/model-state.js.map +1 -1
  72. package/lib/common/features/model/model-submission-handler.d.ts +30 -2
  73. package/lib/common/features/model/model-submission-handler.d.ts.map +1 -1
  74. package/lib/common/features/model/model-submission-handler.js +58 -8
  75. package/lib/common/features/model/model-submission-handler.js.map +1 -1
  76. package/lib/common/features/model/request-model-action-handler.d.ts +5 -6
  77. package/lib/common/features/model/request-model-action-handler.d.ts.map +1 -1
  78. package/lib/common/features/model/request-model-action-handler.js +37 -14
  79. package/lib/common/features/model/request-model-action-handler.js.map +1 -1
  80. package/lib/common/features/model/save-model-action-handler.js +2 -1
  81. package/lib/common/features/model/save-model-action-handler.js.map +1 -1
  82. package/lib/common/features/navigation/navigation-target-provider-registry.js +2 -1
  83. package/lib/common/features/navigation/navigation-target-provider-registry.js.map +1 -1
  84. package/lib/common/features/navigation/navigation-target-resolver.js +2 -1
  85. package/lib/common/features/navigation/navigation-target-resolver.js.map +1 -1
  86. package/lib/common/features/navigation/request-navigation-targets-action-handler.js +2 -1
  87. package/lib/common/features/navigation/request-navigation-targets-action-handler.js.map +1 -1
  88. package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js +2 -1
  89. package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js.map +1 -1
  90. package/lib/common/features/popup/request-popup-model-action-handler.js +2 -1
  91. package/lib/common/features/popup/request-popup-model-action-handler.js.map +1 -1
  92. package/lib/common/features/progress/progress-service.d.ts +44 -0
  93. package/lib/common/features/progress/progress-service.d.ts.map +1 -0
  94. package/lib/common/features/progress/progress-service.js +74 -0
  95. package/lib/common/features/progress/progress-service.js.map +1 -0
  96. package/lib/common/features/validation/model-validator.d.ts +47 -2
  97. package/lib/common/features/validation/model-validator.d.ts.map +1 -1
  98. package/lib/common/features/validation/model-validator.js +80 -1
  99. package/lib/common/features/validation/model-validator.js.map +1 -1
  100. package/lib/common/features/validation/request-markers-handler.d.ts +15 -0
  101. package/lib/common/features/validation/request-markers-handler.d.ts.map +1 -1
  102. package/lib/common/features/validation/request-markers-handler.js +5 -10
  103. package/lib/common/features/validation/request-markers-handler.js.map +1 -1
  104. package/lib/common/gmodel/apply-label-edit-operation-handler.js +2 -1
  105. package/lib/common/gmodel/apply-label-edit-operation-handler.js.map +1 -1
  106. package/lib/common/gmodel/change-bounds-operation-handler.js +2 -1
  107. package/lib/common/gmodel/change-bounds-operation-handler.js.map +1 -1
  108. package/lib/common/gmodel/change-routing-points-operation-handler.js +2 -1
  109. package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -1
  110. package/lib/common/gmodel/cut-operation-handler.js +2 -1
  111. package/lib/common/gmodel/cut-operation-handler.js.map +1 -1
  112. package/lib/common/gmodel/delete-operation-handler.js +2 -1
  113. package/lib/common/gmodel/delete-operation-handler.js.map +1 -1
  114. package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts +3 -3
  115. package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts.map +1 -1
  116. package/lib/common/gmodel/gmodel-create-edge-operation-handler.js +2 -1
  117. package/lib/common/gmodel/gmodel-create-edge-operation-handler.js.map +1 -1
  118. package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts +3 -3
  119. package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts.map +1 -1
  120. package/lib/common/gmodel/gmodel-create-node-operation-handler.js +2 -1
  121. package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -1
  122. package/lib/common/gmodel/gmodel-diagram-module.js +2 -1
  123. package/lib/common/gmodel/gmodel-diagram-module.js.map +1 -1
  124. package/lib/common/gmodel/paste-operation-handler.js +26 -2
  125. package/lib/common/gmodel/paste-operation-handler.js.map +1 -1
  126. package/lib/common/gmodel/reconnect-edge-operation-handler.js +2 -1
  127. package/lib/common/gmodel/reconnect-edge-operation-handler.js.map +1 -1
  128. package/lib/common/index.d.ts +1 -0
  129. package/lib/common/index.d.ts.map +1 -1
  130. package/lib/common/index.js +1 -0
  131. package/lib/common/index.js.map +1 -1
  132. package/lib/common/launch/glsp-server-launcher.js +2 -1
  133. package/lib/common/launch/glsp-server-launcher.js.map +1 -1
  134. package/lib/common/launch/jsonrpc-server-launcher.js +2 -1
  135. package/lib/common/launch/jsonrpc-server-launcher.js.map +1 -1
  136. package/lib/common/operations/compound-operation-handler.d.ts +5 -0
  137. package/lib/common/operations/compound-operation-handler.d.ts.map +1 -1
  138. package/lib/common/operations/compound-operation-handler.js +8 -2
  139. package/lib/common/operations/compound-operation-handler.js.map +1 -1
  140. package/lib/common/operations/create-operation-handler.d.ts +19 -5
  141. package/lib/common/operations/create-operation-handler.d.ts.map +1 -1
  142. package/lib/common/operations/create-operation-handler.js +2 -1
  143. package/lib/common/operations/create-operation-handler.js.map +1 -1
  144. package/lib/common/operations/json-operation-handler.d.ts +94 -0
  145. package/lib/common/operations/json-operation-handler.d.ts.map +1 -0
  146. package/lib/common/operations/json-operation-handler.js +120 -0
  147. package/lib/common/operations/json-operation-handler.js.map +1 -0
  148. package/lib/common/operations/operation-action-handler.d.ts.map +1 -1
  149. package/lib/common/operations/operation-action-handler.js +3 -2
  150. package/lib/common/operations/operation-action-handler.js.map +1 -1
  151. package/lib/common/operations/operation-handler-registry.d.ts +1 -9
  152. package/lib/common/operations/operation-handler-registry.d.ts.map +1 -1
  153. package/lib/common/operations/operation-handler-registry.js +4 -12
  154. package/lib/common/operations/operation-handler-registry.js.map +1 -1
  155. package/lib/common/operations/operation-handler.d.ts +2 -2
  156. package/lib/common/operations/operation-handler.d.ts.map +1 -1
  157. package/lib/common/operations/operation-handler.js +2 -1
  158. package/lib/common/operations/operation-handler.js.map +1 -1
  159. package/lib/common/protocol/client-action.d.ts +31 -0
  160. package/lib/common/protocol/client-action.d.ts.map +1 -0
  161. package/lib/common/protocol/client-action.js +35 -0
  162. package/lib/common/protocol/client-action.js.map +1 -0
  163. package/lib/common/protocol/glsp-server.d.ts +1 -1
  164. package/lib/common/protocol/glsp-server.d.ts.map +1 -1
  165. package/lib/common/protocol/glsp-server.js +9 -10
  166. package/lib/common/protocol/glsp-server.js.map +1 -1
  167. package/lib/common/session/client-session-factory.js +5 -4
  168. package/lib/common/session/client-session-factory.js.map +1 -1
  169. package/lib/common/session/client-session-manager.js +2 -1
  170. package/lib/common/session/client-session-manager.js.map +1 -1
  171. package/lib/common/utils/client-options-util.d.ts +3 -0
  172. package/lib/common/utils/client-options-util.d.ts.map +1 -1
  173. package/lib/common/utils/client-options-util.js +5 -15
  174. package/lib/common/utils/client-options-util.js.map +1 -1
  175. package/lib/common/utils/console-logger.js +2 -1
  176. package/lib/common/utils/console-logger.js.map +1 -1
  177. package/lib/common/utils/logger.js +2 -1
  178. package/lib/common/utils/logger.js.map +1 -1
  179. package/lib/common/utils/promise-queue.d.ts.map +1 -1
  180. package/lib/common/utils/promise-queue.js +3 -6
  181. package/lib/common/utils/promise-queue.js.map +1 -1
  182. package/lib/common/utils/registry.d.ts +3 -1
  183. package/lib/common/utils/registry.d.ts.map +1 -1
  184. package/lib/common/utils/registry.js +15 -4
  185. package/lib/common/utils/registry.js.map +1 -1
  186. package/lib/node/abstract-json-model-storage.d.ts.map +1 -1
  187. package/lib/node/abstract-json-model-storage.js +33 -3
  188. package/lib/node/abstract-json-model-storage.js.map +1 -1
  189. package/lib/node/di/app-module.js +24 -1
  190. package/lib/node/di/app-module.js.map +1 -1
  191. package/lib/node/gmodel/gmodel-storage.js +2 -1
  192. package/lib/node/gmodel/gmodel-storage.js.map +1 -1
  193. package/lib/node/launch/cli-parser.js +26 -3
  194. package/lib/node/launch/cli-parser.js.map +1 -1
  195. package/lib/node/launch/socket-cli-parser.js +24 -1
  196. package/lib/node/launch/socket-cli-parser.js.map +1 -1
  197. package/lib/node/launch/socket-server-launcher.js +27 -3
  198. package/lib/node/launch/socket-server-launcher.js.map +1 -1
  199. package/lib/node/launch/websocket-server-launcher.js +27 -3
  200. package/lib/node/launch/websocket-server-launcher.js.map +1 -1
  201. package/package.json +4 -5
  202. package/src/common/actions/action-dispatcher.spec.ts +3 -2
  203. package/src/common/actions/action-dispatcher.ts +8 -5
  204. package/src/common/actions/client-action-handler.ts +28 -18
  205. package/src/common/actions/global-action-provider.spec.ts +4 -15
  206. package/src/common/actions/global-action-provider.ts +21 -25
  207. package/src/common/command/recording-command.spec.ts +15 -5
  208. package/src/common/command/recording-command.ts +16 -26
  209. package/src/common/di/client-session-module.ts +17 -10
  210. package/src/common/di/diagram-module.ts +14 -66
  211. package/src/common/di/server-module.ts +0 -1
  212. package/src/common/features/model/model-state.ts +3 -0
  213. package/src/common/features/model/model-submission-handler.ts +63 -6
  214. package/src/common/features/model/request-model-action-handler.ts +37 -17
  215. package/src/common/features/progress/progress-service.ts +74 -0
  216. package/src/common/features/validation/model-validator.ts +75 -3
  217. package/src/common/features/validation/request-markers-handler.ts +4 -10
  218. package/src/common/gmodel/gmodel-create-edge-operation-handler.ts +3 -3
  219. package/src/common/gmodel/gmodel-create-node-operation-handler.ts +3 -3
  220. package/src/common/index.ts +1 -0
  221. package/src/common/operations/compound-operation-handler.ts +6 -1
  222. package/src/common/operations/create-operation-handler.ts +22 -5
  223. package/src/common/operations/json-operation-handler.ts +147 -0
  224. package/src/common/operations/operation-action-handler.ts +2 -2
  225. package/src/common/operations/operation-handler-registry.ts +1 -12
  226. package/src/common/operations/operation-handler.ts +2 -2
  227. package/src/common/protocol/client-action.ts +38 -0
  228. package/src/common/protocol/glsp-server.spec.ts +11 -10
  229. package/src/common/protocol/glsp-server.ts +11 -14
  230. package/src/common/session/client-session-factory.spec.ts +2 -2
  231. package/src/common/session/client-session-factory.ts +3 -3
  232. package/src/common/session/client-session-manager.spec.ts +4 -3
  233. package/src/common/utils/client-options-util.ts +8 -0
  234. package/src/common/utils/promise-queue.ts +4 -5
  235. package/src/common/utils/registry.spec.ts +3 -1
  236. package/src/common/utils/registry.ts +8 -3
  237. package/src/node/abstract-json-model-storage.ts +8 -2
  238. package/src/node/launch/cli-parser.ts +1 -1
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.processPort = exports.createSocketCliParser = exports.defaultSocketLaunchOptions = void 0;
4
27
  /********************************************************************************
@@ -16,7 +39,7 @@ exports.processPort = exports.createSocketCliParser = exports.defaultSocketLaunc
16
39
  *
17
40
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
18
41
  ********************************************************************************/
19
- const cmd = require("commander");
42
+ const cmd = __importStar(require("commander"));
20
43
  const cli_parser_1 = require("./cli-parser");
21
44
  exports.defaultSocketLaunchOptions = Object.assign(Object.assign({}, cli_parser_1.defaultLaunchOptions), { port: 0, host: 'localhost' });
22
45
  function createSocketCliParser(defaultOptions = exports.defaultSocketLaunchOptions) {
@@ -1 +1 @@
1
- {"version":3,"file":"socket-cli-parser.js","sourceRoot":"","sources":["../../../src/node/launch/socket-cli-parser.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iCAAiC;AACjC,6CAA+F;AAOlF,QAAA,0BAA0B,mCAChC,iCAAoB,KACvB,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,WAAW,IACnB;AAEF,SAAgB,qBAAqB,CACjC,iBAAsC,kCAA0B;IAEhE,MAAM,MAAM,GAAG,IAAA,4BAAe,EAAI,cAAc,CAAC,CAAC;IAClD,MAAM,CAAC,OAAO;SACT,MAAM,CAAC,oBAAoB,EAAE,6BAA6B,cAAc,CAAC,IAAI,GAAG,EAAE,WAAW,EAAE,cAAc,CAAC,IAAI,CAAC;SACnH,MAAM,CAAC,eAAe,EAAE,2BAA2B,cAAc,CAAC,IAAI,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC;SAC9F,MAAM,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;SACpD,MAAM,CAAC,WAAW,EAAE,qBAAqB,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACxE,OAAO,MAAM,CAAC;AAClB,CAAC;AAVD,sDAUC;AAED,SAAgB,WAAW,CAAC,KAAa;IACrC,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE;QACb,MAAM,IAAI,GAAG,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;KAC/D;IACD,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,KAAK,EAAE;QAC1B,MAAM,IAAI,GAAG,CAAC,oBAAoB,CAAC,4CAA4C,CAAC,CAAC;KACpF;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAVD,kCAUC"}
1
+ {"version":3,"file":"socket-cli-parser.js","sourceRoot":"","sources":["../../../src/node/launch/socket-cli-parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+CAAiC;AACjC,6CAA+F;AAOlF,QAAA,0BAA0B,mCAChC,iCAAoB,KACvB,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,WAAW,IACnB;AAEF,SAAgB,qBAAqB,CACjC,iBAAsC,kCAA0B;IAEhE,MAAM,MAAM,GAAG,IAAA,4BAAe,EAAI,cAAc,CAAC,CAAC;IAClD,MAAM,CAAC,OAAO;SACT,MAAM,CAAC,oBAAoB,EAAE,6BAA6B,cAAc,CAAC,IAAI,GAAG,EAAE,WAAW,EAAE,cAAc,CAAC,IAAI,CAAC;SACnH,MAAM,CAAC,eAAe,EAAE,2BAA2B,cAAc,CAAC,IAAI,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC;SAC9F,MAAM,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;SACpD,MAAM,CAAC,WAAW,EAAE,qBAAqB,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACxE,OAAO,MAAM,CAAC;AAClB,CAAC;AAVD,sDAUC;AAED,SAAgB,WAAW,CAAC,KAAa;IACrC,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE;QACb,MAAM,IAAI,GAAG,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;KAC/D;IACD,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,KAAK,EAAE;QAC1B,MAAM,IAAI,GAAG,CAAC,oBAAoB,CAAC,4CAA4C,CAAC,CAAC;KACpF;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAVD,kCAUC"}
@@ -1,10 +1,33 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
2
18
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
19
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
20
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
21
  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
22
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
23
  };
24
+ var __importStar = (this && this.__importStar) || function (mod) {
25
+ if (mod && mod.__esModule) return mod;
26
+ var result = {};
27
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
+ __setModuleDefault(result, mod);
29
+ return result;
30
+ };
8
31
  var __metadata = (this && this.__metadata) || function (k, v) {
9
32
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
33
  };
@@ -27,12 +50,12 @@ exports.SocketServerLauncher = exports.START_UP_COMPLETE_MSG = void 0;
27
50
  ********************************************************************************/
28
51
  const protocol_1 = require("@eclipse-glsp/protocol");
29
52
  const inversify_1 = require("inversify");
30
- const net = require("net");
31
- const jsonrpc = require("vscode-jsonrpc/node");
53
+ const net = __importStar(require("net"));
54
+ const jsonrpc = __importStar(require("vscode-jsonrpc/node"));
32
55
  const jsonrpc_server_launcher_1 = require("../../common/launch/jsonrpc-server-launcher");
33
56
  const logger_1 = require("../../common/utils/logger");
34
57
  exports.START_UP_COMPLETE_MSG = '[GLSP-Server]:Startup completed. Accepting requests on port:';
35
- let SocketServerLauncher = exports.SocketServerLauncher = class SocketServerLauncher extends jsonrpc_server_launcher_1.JsonRpcGLSPServerLauncher {
58
+ let SocketServerLauncher = class SocketServerLauncher extends jsonrpc_server_launcher_1.JsonRpcGLSPServerLauncher {
36
59
  constructor() {
37
60
  super();
38
61
  this.toDispose.push(protocol_1.Disposable.create(() => {
@@ -73,6 +96,7 @@ let SocketServerLauncher = exports.SocketServerLauncher = class SocketServerLaun
73
96
  return jsonrpc.createMessageConnection(new jsonrpc.SocketMessageReader(socket), new jsonrpc.SocketMessageWriter(socket), console);
74
97
  }
75
98
  };
99
+ exports.SocketServerLauncher = SocketServerLauncher;
76
100
  __decorate([
77
101
  (0, inversify_1.inject)(logger_1.Logger),
78
102
  __metadata("design:type", logger_1.Logger)
@@ -1 +1 @@
1
- {"version":3,"file":"socket-server-launcher.js","sourceRoot":"","sources":["../../../src/node/launch/socket-server-launcher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAoD;AACpD,yCAA+C;AAC/C,2BAA2B;AAC3B,+CAA+C;AAC/C,yFAAwF;AACxF,sDAAmD;AAEtC,QAAA,qBAAqB,GAAG,8DAA8D,CAAC;AAG7F,IAAM,oBAAoB,kCAA1B,MAAM,oBAAqB,SAAQ,mDAAmD;IAKzF;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,CAAC,IAAI,CACf,qBAAU,CAAC,MAAM,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QAC3B,CAAC,CAAC,CACL,CAAC;IACN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C,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;YACrD,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACP,CAAC;IAES,gBAAgB,CAAC,MAAkB;QACzC,OAAO,OAAO,CAAC,uBAAuB,CAAC,IAAI,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,IAAI,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IACtI,CAAC;CACJ,CAAA;AA/CsC;IAAlC,IAAA,kBAAM,EAAC,eAAM,CAAC;8BAA4B,eAAM;oDAAC;+BADzC,oBAAoB;IADhC,IAAA,sBAAU,GAAE;;GACA,oBAAoB,CAgDhC"}
1
+ {"version":3,"file":"socket-server-launcher.js","sourceRoot":"","sources":["../../../src/node/launch/socket-server-launcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAoD;AACpD,yCAA+C;AAC/C,yCAA2B;AAC3B,6DAA+C;AAC/C,yFAAwF;AACxF,sDAAmD;AAEtC,QAAA,qBAAqB,GAAG,8DAA8D,CAAC;AAG7F,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,mDAAmD;IAKzF;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,CAAC,IAAI,CACf,qBAAU,CAAC,MAAM,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QAC3B,CAAC,CAAC,CACL,CAAC;IACN,CAAC;IAES,GAAG,CAAC,IAA8B;QACxC,IAAI,CAAC,SAAS,G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SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;YACrD,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACP,CAAC;IAES,gBAAgB,CAAC,MAAkB;QACzC,OAAO,OAAO,CAAC,uBAAuB,CAAC,IAAI,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,IAAI,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IACtI,CAAC;CACJ,CAAA;AAhDY,oDAAoB;AACM;IAAlC,IAAA,kBAAM,EAAC,eAAM,CAAC;8BAA4B,eAAM;oDAAC;+BADzC,oBAAoB;IADhC,IAAA,sBAAU,GAAE;;GACA,oBAAoB,CAgDhC"}
@@ -14,26 +14,49 @@
14
14
  *
15
15
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
16
  ********************************************************************************/
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }) : function(o, v) {
31
+ o["default"] = v;
32
+ });
17
33
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
34
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
35
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
36
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
37
  return c > 3 && r && Object.defineProperty(target, key, r), r;
22
38
  };
39
+ var __importStar = (this && this.__importStar) || function (mod) {
40
+ if (mod && mod.__esModule) return mod;
41
+ var result = {};
42
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
43
+ __setModuleDefault(result, mod);
44
+ return result;
45
+ };
23
46
  var __metadata = (this && this.__metadata) || function (k, v) {
24
47
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
48
  };
26
49
  Object.defineProperty(exports, "__esModule", { value: true });
27
50
  exports.wrapWebSocket = exports.WebSocketServerLauncher = void 0;
28
51
  const protocol_1 = require("@eclipse-glsp/protocol");
29
- const http = require("http");
52
+ const http = __importStar(require("http"));
30
53
  const inversify_1 = require("inversify");
31
- const net = require("net");
54
+ const net = __importStar(require("net"));
32
55
  const ws_1 = require("ws");
33
56
  const jsonrpc_server_launcher_1 = require("../../common/launch/jsonrpc-server-launcher");
34
57
  const logger_1 = require("../../common/utils/logger");
35
58
  const STATUS_UPGRADE_REQUIRED = 426;
36
- let WebSocketServerLauncher = exports.WebSocketServerLauncher = class WebSocketServerLauncher extends jsonrpc_server_launcher_1.JsonRpcGLSPServerLauncher {
59
+ let WebSocketServerLauncher = class WebSocketServerLauncher extends jsonrpc_server_launcher_1.JsonRpcGLSPServerLauncher {
37
60
  constructor() {
38
61
  super();
39
62
  this.toDispose.push(protocol_1.Disposable.create(() => {
@@ -82,6 +105,7 @@ let WebSocketServerLauncher = exports.WebSocketServerLauncher = class WebSocketS
82
105
  super.start(options);
83
106
  }
84
107
  };
108
+ exports.WebSocketServerLauncher = WebSocketServerLauncher;
85
109
  __decorate([
86
110
  (0, inversify_1.inject)(logger_1.Logger),
87
111
  __metadata("design:type", logger_1.Logger)
@@ -1 +1 @@
1
- {"version":3,"file":"websocket-server-launcher.js","sourceRoot":"","sources":["../../../src/node/launch/websocket-server-launcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,qDAA+G;AAC/G,6BAA6B;AAC7B,yCAA+C;AAC/C,2BAA2B;AAE3B,2BAAuC;AACvC,yFAAwF;AACxF,sDAAmD;AAoBnD,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAG7B,IAAM,uBAAuB,qCAA7B,MAAM,uBAAwB,SAAQ,mDAAiD;IAM1F;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,CAAC,IAAI,CACf,qBAAU,CAAC,MAAM,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC,CAAC,CACL,CAAC;IACN,CAAC;IAES,KAAK,CAAC,GAAG,CAAC,OAA+B;QAC/C,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC3D,IAAI,CAAC,MAAM,GAAG,IAAI,WAAM,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;QACzF,MAAM,QAAQ,GAAG,QAAQ,eAAe,CAAC,IAAI,IAAI,eAAe,CAAC,IAAI,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC;QAChG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mFAAmF,QAAQ,GAAG,CAAC,CAAC;QACjH,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAEjF,IAAI,CAAC,MAAM,CA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CAAC;QAC3C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AACD;;;GAGG;AACH,SAAgB,aAAa,CAAC,MAAiB;IAC3C,OAAO;QACH,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACrC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC;QACzC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QACrC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;KAChC,CAAC;AACN,CAAC;AARD,sCAQC"}
1
+ {"version":3,"file":"websocket-server-launcher.js","sourceRoot":"","sources":["../../../src/node/launch/websocket-server-launcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElF,qDAA+G;AAC/G,2CAA6B;AAC7B,yCAA+C;AAC/C,yCAA2B;AAE3B,2BAAuC;AACvC,yFAAwF;AACxF,sDAAmD;AAoBnD,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAG7B,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,mDAAiD;IAM1F;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,CAAC,IAAI,CACf,qBAAU,CAAC,MAAM,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC,CAAC,CACL,CAAC;IACN,CAAC;IAES,KAAK,CAAC,GAAG,CAAC,OAA+B;QAC/C,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,C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,CAgEnC;AAED,KAAK,UAAU,WAAW;IACtB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,MAAM,GAAG,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;QAC/B,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE;YACf,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;gBACzC,MAAM,CAAC,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC,CAAC;gBAC9D,OAAO;aACV;YACD,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AACD;;;GAGG;AACH,SAAgB,aAAa,CAAC,MAAiB;IAC3C,OAAO;QACH,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACrC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC;QACzC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QACrC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;KAChC,CAAC;AACN,CAAC;AARD,sCAQC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-glsp/server",
3
- "version": "1.1.0-RC10",
3
+ "version": "1.1.0-next.342c713.66+342c713",
4
4
  "description": "A js server framework for Eclipse GLSP",
5
5
  "keywords": [
6
6
  "eclipse",
@@ -59,8 +59,8 @@
59
59
  "watch": "tsc -w"
60
60
  },
61
61
  "dependencies": {
62
- "@eclipse-glsp/graph": "1.1.0-RC10",
63
- "@eclipse-glsp/protocol": "1.1.0-RC10",
62
+ "@eclipse-glsp/graph": "1.1.0-next.342c713.66+342c713",
63
+ "@eclipse-glsp/protocol": "next",
64
64
  "@types/uuid": "8.3.1",
65
65
  "commander": "^8.3.0",
66
66
  "fast-json-patch": "^3.1.0",
@@ -68,7 +68,6 @@
68
68
  "ws": "^8.12.1"
69
69
  },
70
70
  "devDependencies": {
71
- "@types/fs-extra": "^9.0.13",
72
71
  "@types/ws": "^8.5.4"
73
72
  },
74
73
  "peerDependencies": {
@@ -77,5 +76,5 @@
77
76
  "publishConfig": {
78
77
  "access": "public"
79
78
  },
80
- "gitHead": "d93e52cd0208d00e8f7c5ea69d4b24de5998dbd8"
79
+ "gitHead": "342c7133ea792927d30a2bbdce68531d651bd9d4"
81
80
  }
@@ -24,7 +24,7 @@ import { Logger } from '../utils/logger';
24
24
  import { DefaultActionDispatcher } from './action-dispatcher';
25
25
  import { ActionHandler } from './action-handler';
26
26
  import { ActionHandlerRegistry } from './action-handler-registry';
27
- import assert = require('assert');
27
+ import { ClientActionForwarder } from './client-action-handler';
28
28
 
29
29
  function waitSync(timeInMillis: number): void {
30
30
  const start = Date.now();
@@ -48,6 +48,7 @@ describe('test DefaultActionDispatcher', () => {
48
48
  bind(ClientId).toConstantValue(clientId);
49
49
  bind(ActionHandlerRegistry).toConstantValue(actionHandlerRegistry);
50
50
  bind(ClientActionKinds).toConstantValue(['response', 'response1', 'response2']);
51
+ bind(ClientActionForwarder).toConstantValue(sinon.createStubInstance(ClientActionForwarder));
51
52
  })
52
53
  );
53
54
  const actionDispatcher = container.resolve(DefaultActionDispatcher);
@@ -62,7 +63,7 @@ describe('test DefaultActionDispatcher', () => {
62
63
 
63
64
  describe('test with one-way actions (no response actions)', () => {
64
65
  it('dispatch- unhandled action', async () => {
65
- assert.rejects(actionDispatcher.dispatch({ kind: 'unhandled' }));
66
+ mock.expectToThrowAsync(() => actionDispatcher.dispatch({ kind: 'unhandled' }));
66
67
  });
67
68
 
68
69
  it('dispatch - one action', async () => {
@@ -15,12 +15,13 @@
15
15
  ********************************************************************************/
16
16
  import { Action, Disposable, flatPush, MaybeArray, RequestAction, ResponseAction, UpdateModelAction } from '@eclipse-glsp/protocol';
17
17
  import { inject, injectable } from 'inversify';
18
- import { ClientActionKinds, ClientId } from '../di/service-identifiers';
18
+ import { ClientId } from '../di/service-identifiers';
19
19
  import { GLSPServerError } from '../utils/glsp-server-error';
20
20
  import { Logger } from '../utils/logger';
21
21
  import { PromiseQueue } from '../utils/promise-queue';
22
22
  import { ActionHandler } from './action-handler';
23
23
  import { ActionHandlerRegistry } from './action-handler-registry';
24
+ import { ClientActionForwarder } from './client-action-handler';
24
25
 
25
26
  export const ActionDispatcher = Symbol('ActionDispatcher');
26
27
 
@@ -62,8 +63,8 @@ export class DefaultActionDispatcher implements ActionDispatcher, Disposable {
62
63
  @inject(ActionHandlerRegistry)
63
64
  protected actionHandlerRegistry: ActionHandlerRegistry;
64
65
 
65
- @inject(ClientActionKinds)
66
- protected clientActionKinds: string[];
66
+ @inject(ClientActionForwarder)
67
+ protected clientActionForwarder: ClientActionForwarder;
67
68
 
68
69
  @inject(Logger)
69
70
  private logger: Logger;
@@ -76,7 +77,7 @@ export class DefaultActionDispatcher implements ActionDispatcher, Disposable {
76
77
 
77
78
  dispatch(action: Action): Promise<void> {
78
79
  // Dont queue actions that are just delegated to the client
79
- if (this.clientActionKinds.includes(action.kind)) {
80
+ if (this.clientActionForwarder.shouldForwardToClient(action)) {
80
81
  return this.doDispatch(action);
81
82
  }
82
83
  return this.actionQueue.enqueue(() => this.doDispatch(action));
@@ -84,8 +85,10 @@ export class DefaultActionDispatcher implements ActionDispatcher, Disposable {
84
85
 
85
86
  protected async doDispatch(action: Action): Promise<void> {
86
87
  this.logger.debug('Dispatch action:', action.kind);
88
+ const handledOnClient = this.clientActionForwarder.handle(action);
89
+
87
90
  const actionHandlers = this.actionHandlerRegistry.get(action.kind);
88
- if (actionHandlers.length === 0) {
91
+ if (!handledOnClient && actionHandlers.length === 0) {
89
92
  throw new GLSPServerError(`No handler registered for action kind: ${action.kind}`);
90
93
  }
91
94
 
@@ -13,37 +13,47 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Action, ActionMessage, GLSPClientProxy } from '@eclipse-glsp/protocol';
17
- import { inject, injectable, optional } from 'inversify';
16
+ import { Action, ActionMessage, GLSPClientProxy, ResponseAction } from '@eclipse-glsp/protocol';
17
+ import { inject, injectable } from 'inversify';
18
18
  import { ClientActionKinds, ClientId } from '../di/service-identifiers';
19
+ import { ClientAction } from '../protocol/client-action';
19
20
 
20
21
  /**
21
- * The client action handler is responsible of handling action kinds that are intended for the
22
- * GLSP client, by sending them to the client over json-rpc.
22
+ * Component responsible for forwarding actions that are (also) handled by the
23
+ * client
23
24
  */
24
-
25
25
  @injectable()
26
- export class ClientActionHandler implements ClientActionHandler {
26
+ export class ClientActionForwarder {
27
27
  @inject(GLSPClientProxy)
28
- @optional()
29
- protected glspClient?: GLSPClientProxy;
28
+ protected glspClient: GLSPClientProxy;
30
29
 
31
30
  @inject(ClientId)
32
31
  protected readonly clientId: string;
33
32
 
34
- constructor(@inject(ClientActionKinds) @optional() public actionKinds: string[] = []) {}
33
+ constructor(@inject(ClientActionKinds) public actionKinds: Set<string>) {}
35
34
 
36
- execute(action: Action): [] {
37
- this.send(action);
38
- return [];
35
+ /**
36
+ * Processes the given action and checks wether it is a
37
+ * `clientAction` i.e. an action that should be forwarded to
38
+ * the client to be handled there. If the check is successful
39
+ * the action is wrapped in an {@link ActionMessage} and sent to the client.
40
+ *
41
+ * @param action The action to check and forward
42
+ * @return `true` if the action was forwarded to the client, `false` otherwise
43
+ */
44
+ handle(action: Action): boolean {
45
+ if (this.shouldForwardToClient(action)) {
46
+ const message: ActionMessage = { action, clientId: this.clientId };
47
+ this.glspClient.process(message);
48
+ return true;
49
+ }
50
+ return false;
39
51
  }
40
52
 
41
- protected send(action: Action): void {
42
- const message: ActionMessage = { action, clientId: this.clientId };
43
- if (this.glspClient) {
44
- this.glspClient.process(message);
45
- return;
53
+ shouldForwardToClient(action: Action): boolean {
54
+ if (ClientAction.is(action)) {
55
+ return false;
46
56
  }
47
- throw new Error('Could not send message to client. No GLSPClientProxy is defined');
57
+ return this.actionKinds.has(action.kind) || ResponseAction.is(action);
48
58
  }
49
59
  }
@@ -13,21 +13,20 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import { expect } from 'chai';
16
17
  import { Container, ContainerModule } from 'inversify';
17
- import { ClientActionKinds, DiagramModules, InjectionContainer } from '../di/service-identifiers';
18
+ import * as sinon from 'sinon';
19
+ import { DiagramModules, InjectionContainer } from '../di/service-identifiers';
18
20
  import { ClientSessionInitializer } from '../session/client-session-initializer';
19
21
  import * as mock from '../test/mock-util';
20
22
  import { Logger } from '../utils/logger';
21
23
  import { ActionHandler } from './action-handler';
22
24
  import { ActionHandlerRegistry } from './action-handler-registry';
23
25
  import { DefaultGlobalActionProvider } from './global-action-provider';
24
- import * as sinon from 'sinon';
25
- import { expect } from 'chai';
26
26
 
27
27
  describe('test DefaultGlobalActionProvider', () => {
28
28
  const container = new Container();
29
29
  const serverActions = ['A1', 'A2', 'A3'];
30
- const clientActions = ['C1', 'C2'];
31
30
  const diagramType = 'myDiagramType';
32
31
 
33
32
  const handler1Actions = ['A1', 'A2'];
@@ -44,8 +43,6 @@ describe('test DefaultGlobalActionProvider', () => {
44
43
  bind(ActionHandler).toConstantValue(new mock.StubActionHandler(handler1Actions));
45
44
  bind(ActionHandler).toConstantValue(new mock.StubActionHandler(handler2Actions));
46
45
  bind(ActionHandlerRegistry).toConstantValue(handlerRegistry);
47
- bind(ClientActionKinds).toConstantValue(clientActions[0]);
48
- bind(ClientActionKinds).toConstantValue(clientActions[1]);
49
46
  });
50
47
 
51
48
  const diagramModules = new Map<string, ContainerModule[]>();
@@ -62,18 +59,10 @@ describe('test DefaultGlobalActionProvider', () => {
62
59
  const actionProvider = container.resolve(DefaultGlobalActionProvider);
63
60
 
64
61
  it('serverActionsKinds', () => {
65
- const result = actionProvider.serverActionKinds;
62
+ const result = actionProvider.actionKinds;
66
63
  expect(result.size).to.be.equal(1);
67
64
  const resultServerActions = result.get(diagramType);
68
65
  expect(resultServerActions).to.not.be.undefined;
69
66
  expect(serverActions.every(action => resultServerActions!.includes(action))).true;
70
67
  });
71
-
72
- it('clientActionKinds', () => {
73
- const result = actionProvider.clientActionKinds;
74
- expect(result.size).to.be.equal(1);
75
- const resultClientActions = result.get(diagramType);
76
- expect(resultClientActions).to.not.be.undefined;
77
- expect(clientActions.every(action => resultClientActions!.includes(action))).true;
78
- });
79
68
  });
@@ -13,60 +13,56 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
+ import { distinctAdd } from '@eclipse-glsp/protocol';
16
17
  import { Container, ContainerModule, inject, injectable } from 'inversify';
17
- import { ClientActionKinds, DiagramModules, InjectionContainer } from '../di/service-identifiers';
18
+ import { createClientSessionModule } from '../di/client-session-module';
19
+ import { DiagramModules, InjectionContainer } from '../di/service-identifiers';
18
20
  import { ClientSessionInitializer } from '../session/client-session-initializer';
19
21
  import { ActionHandlerRegistry } from './action-handler-registry';
20
- import { ClientActionHandler } from './client-action-handler';
21
22
 
22
23
  export const GlobalActionProvider = Symbol('GlobalActionProvider');
23
24
 
25
+ /**
26
+ * Provides a map of handled action kinds grouped by `diagramType`
27
+ */
24
28
  export interface GlobalActionProvider {
25
- readonly serverActionKinds: Map<string, string[]>;
26
- readonly clientActionKinds: Map<string, string[]>;
29
+ readonly actionKinds: Map<string, string[]>;
27
30
  }
28
31
 
29
32
  @injectable()
30
33
  export class DefaultGlobalActionProvider implements GlobalActionProvider {
31
- public readonly serverActionKinds: Map<string, string[]>;
32
- public readonly clientActionKinds: Map<string, string[]>;
34
+ public readonly actionKinds: Map<string, string[]>;
33
35
 
34
36
  constructor(
35
37
  @inject(InjectionContainer) serverContainer: Container,
36
38
  @inject(DiagramModules) diagramModules: Map<string, ContainerModule[]>
37
39
  ) {
38
- this.serverActionKinds = new Map();
39
- this.clientActionKinds = new Map();
40
+ this.actionKinds = new Map();
40
41
  diagramModules.forEach((modules, diagramType) => {
41
42
  const container = this.createDiagramContainer(serverContainer, modules);
42
43
  const initializers = container.getAll<ClientSessionInitializer>(ClientSessionInitializer);
43
44
  initializers.forEach(service => service.initialize());
44
- this.loadServerActionKinds(diagramType, container);
45
- this.loadClientActionKinds(diagramType, container);
45
+ this.loadActionKinds(diagramType, container);
46
46
  container.unbindAll();
47
47
  });
48
48
  }
49
49
 
50
50
  createDiagramContainer(serverContainer: Container, modules: ContainerModule[]): Container {
51
51
  const container = serverContainer.createChild();
52
- container.load(...modules);
52
+ const clientSessionModule = createClientSessionModule({
53
+ clientId: 'tempId',
54
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
55
+ glspClient: { process: () => {} },
56
+ clientActionKinds: []
57
+ });
58
+ container.load(...modules, clientSessionModule);
53
59
  return container;
54
60
  }
55
61
 
56
- loadServerActionKinds(diagramType: string, diagramContainer: Container): void {
62
+ loadActionKinds(diagramType: string, diagramContainer: Container): void {
57
63
  const handlerRegistry = diagramContainer.get<ActionHandlerRegistry>(ActionHandlerRegistry);
58
- const diagramServerActions = this.serverActionKinds.get(diagramType) ?? [];
59
- handlerRegistry
60
- .getAll()
61
- .filter(handler => !(handler instanceof ClientActionHandler))
62
- .forEach(handler => diagramServerActions.push(...handler.actionKinds));
63
- this.serverActionKinds.set(diagramType, [...new Set(diagramServerActions)]);
64
- }
65
-
66
- loadClientActionKinds(diagramType: string, diagramContainer: Container): void {
67
- const clientActionKinds = diagramContainer.getAll<string>(ClientActionKinds);
68
- const diagramClientActions = this.clientActionKinds.get(diagramType) ?? [];
69
- diagramClientActions.push(...clientActionKinds);
70
- this.clientActionKinds.set(diagramType, diagramClientActions);
64
+ const diagramServerActions = this.actionKinds.get(diagramType) ?? [];
65
+ handlerRegistry.getAll().forEach(handler => distinctAdd(diagramServerActions, ...handler.actionKinds));
66
+ this.actionKinds.set(diagramType, diagramServerActions);
71
67
  }
72
68
  }
@@ -14,9 +14,9 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
- import { AnyObject } from '@eclipse-glsp/protocol';
17
+ import { AnyObject, MaybePromise } from '@eclipse-glsp/protocol';
18
18
  import { expect } from 'chai';
19
- import { RecordingCommand } from './recording-command';
19
+ import { AbstractRecordingCommand } from './recording-command';
20
20
 
21
21
  interface TestModel {
22
22
  string: string;
@@ -27,6 +27,16 @@ interface TestModel {
27
27
 
28
28
  let jsonObject: TestModel;
29
29
 
30
+ class TestRecordingCommand<JsonObject extends AnyObject = AnyObject> extends AbstractRecordingCommand<JsonObject> {
31
+ constructor(protected jsonObject: JsonObject, protected doExecute: () => MaybePromise<void>) {
32
+ super();
33
+ }
34
+
35
+ protected getJsonObject(): MaybePromise<JsonObject> {
36
+ return this.jsonObject;
37
+ }
38
+ }
39
+
30
40
  describe('RecordingCommand', () => {
31
41
  let beforeState: TestModel;
32
42
 
@@ -41,14 +51,14 @@ describe('RecordingCommand', () => {
41
51
 
42
52
  it('should be undoable after execution', async () => {
43
53
  // eslint-disable-next-line @typescript-eslint/no-empty-function
44
- const command = new RecordingCommand(jsonObject, () => {});
54
+ const command = new TestRecordingCommand(jsonObject, () => {});
45
55
  expect(command.canUndo()).to.be.false;
46
56
  await command.execute();
47
57
  expect(command.canUndo()).to.be.true;
48
58
  });
49
59
 
50
60
  it('should restore the pre execution state when undo is called', async () => {
51
- const command = new RecordingCommand(jsonObject, () => {
61
+ const command = new TestRecordingCommand(jsonObject, () => {
52
62
  jsonObject.string = 'bar';
53
63
  jsonObject.flag = false;
54
64
  jsonObject.maybe = { hello: 'world' };
@@ -60,7 +70,7 @@ describe('RecordingCommand', () => {
60
70
  });
61
71
 
62
72
  it('should restore the post execution state when redo is called', async () => {
63
- const command = new RecordingCommand(jsonObject, () => {
73
+ const command = new TestRecordingCommand(jsonObject, () => {
64
74
  jsonObject.string = 'bar';
65
75
  jsonObject.flag = false;
66
76
  jsonObject.maybe = { hello: 'world' };