@theia/task 1.67.0-next.13 → 1.67.0-next.56

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 (230) hide show
  1. package/README.md +1 -1
  2. package/package.json +12 -12
  3. package/lib/browser/index.d.ts +0 -7
  4. package/lib/browser/index.d.ts.map +0 -1
  5. package/lib/browser/index.js +0 -25
  6. package/lib/browser/index.js.map +0 -1
  7. package/lib/browser/process/process-task-contribution.d.ts +0 -7
  8. package/lib/browser/process/process-task-contribution.d.ts.map +0 -1
  9. package/lib/browser/process/process-task-contribution.js +0 -36
  10. package/lib/browser/process/process-task-contribution.js.map +0 -1
  11. package/lib/browser/process/process-task-frontend-module.d.ts +0 -3
  12. package/lib/browser/process/process-task-frontend-module.d.ts.map +0 -1
  13. package/lib/browser/process/process-task-frontend-module.js +0 -28
  14. package/lib/browser/process/process-task-frontend-module.js.map +0 -1
  15. package/lib/browser/process/process-task-resolver.d.ts +0 -18
  16. package/lib/browser/process/process-task-resolver.d.ts.map +0 -1
  17. package/lib/browser/process/process-task-resolver.js +0 -94
  18. package/lib/browser/process/process-task-resolver.js.map +0 -1
  19. package/lib/browser/provided-task-configurations.d.ts +0 -44
  20. package/lib/browser/provided-task-configurations.d.ts.map +0 -1
  21. package/lib/browser/provided-task-configurations.js +0 -206
  22. package/lib/browser/provided-task-configurations.js.map +0 -1
  23. package/lib/browser/provided-task-configurations.spec.d.ts +0 -2
  24. package/lib/browser/provided-task-configurations.spec.d.ts.map +0 -1
  25. package/lib/browser/provided-task-configurations.spec.js +0 -44
  26. package/lib/browser/provided-task-configurations.spec.js.map +0 -1
  27. package/lib/browser/quick-open-task.d.ts +0 -146
  28. package/lib/browser/quick-open-task.d.ts.map +0 -1
  29. package/lib/browser/quick-open-task.js +0 -757
  30. package/lib/browser/quick-open-task.js.map +0 -1
  31. package/lib/browser/task-configuration-manager.d.ts +0 -63
  32. package/lib/browser/task-configuration-manager.d.ts.map +0 -1
  33. package/lib/browser/task-configuration-manager.js +0 -243
  34. package/lib/browser/task-configuration-manager.js.map +0 -1
  35. package/lib/browser/task-configuration-model.d.ts +0 -34
  36. package/lib/browser/task-configuration-model.d.ts.map +0 -1
  37. package/lib/browser/task-configuration-model.js +0 -83
  38. package/lib/browser/task-configuration-model.js.map +0 -1
  39. package/lib/browser/task-configurations.d.ts +0 -128
  40. package/lib/browser/task-configurations.d.ts.map +0 -1
  41. package/lib/browser/task-configurations.js +0 -479
  42. package/lib/browser/task-configurations.js.map +0 -1
  43. package/lib/browser/task-context-key-service.d.ts +0 -18
  44. package/lib/browser/task-context-key-service.d.ts.map +0 -1
  45. package/lib/browser/task-context-key-service.js +0 -72
  46. package/lib/browser/task-context-key-service.js.map +0 -1
  47. package/lib/browser/task-contribution.d.ts +0 -183
  48. package/lib/browser/task-contribution.d.ts.map +0 -1
  49. package/lib/browser/task-contribution.js +0 -199
  50. package/lib/browser/task-contribution.js.map +0 -1
  51. package/lib/browser/task-definition-registry.d.ts +0 -39
  52. package/lib/browser/task-definition-registry.d.ts.map +0 -1
  53. package/lib/browser/task-definition-registry.js +0 -130
  54. package/lib/browser/task-definition-registry.js.map +0 -1
  55. package/lib/browser/task-definition-registry.spec.d.ts +0 -2
  56. package/lib/browser/task-definition-registry.spec.d.ts.map +0 -1
  57. package/lib/browser/task-definition-registry.spec.js +0 -171
  58. package/lib/browser/task-definition-registry.spec.js.map +0 -1
  59. package/lib/browser/task-frontend-contribution.d.ts +0 -57
  60. package/lib/browser/task-frontend-contribution.d.ts.map +0 -1
  61. package/lib/browser/task-frontend-contribution.js +0 -351
  62. package/lib/browser/task-frontend-contribution.js.map +0 -1
  63. package/lib/browser/task-frontend-module.d.ts +0 -6
  64. package/lib/browser/task-frontend-module.d.ts.map +0 -1
  65. package/lib/browser/task-frontend-module.js +0 -82
  66. package/lib/browser/task-frontend-module.js.map +0 -1
  67. package/lib/browser/task-name-resolver.d.ts +0 -14
  68. package/lib/browser/task-name-resolver.d.ts.map +0 -1
  69. package/lib/browser/task-name-resolver.js +0 -60
  70. package/lib/browser/task-name-resolver.js.map +0 -1
  71. package/lib/browser/task-node.d.ts +0 -10
  72. package/lib/browser/task-node.d.ts.map +0 -1
  73. package/lib/browser/task-node.js +0 -18
  74. package/lib/browser/task-node.js.map +0 -1
  75. package/lib/browser/task-problem-matcher-registry.d.ts +0 -41
  76. package/lib/browser/task-problem-matcher-registry.d.ts.map +0 -1
  77. package/lib/browser/task-problem-matcher-registry.js +0 -302
  78. package/lib/browser/task-problem-matcher-registry.js.map +0 -1
  79. package/lib/browser/task-problem-pattern-registry.d.ts +0 -24
  80. package/lib/browser/task-problem-pattern-registry.d.ts.map +0 -1
  81. package/lib/browser/task-problem-pattern-registry.js +0 -203
  82. package/lib/browser/task-problem-pattern-registry.js.map +0 -1
  83. package/lib/browser/task-schema-updater.d.ts +0 -58
  84. package/lib/browser/task-schema-updater.d.ts.map +0 -1
  85. package/lib/browser/task-schema-updater.js +0 -676
  86. package/lib/browser/task-schema-updater.js.map +0 -1
  87. package/lib/browser/task-service.d.ts +0 -282
  88. package/lib/browser/task-service.d.ts.map +0 -1
  89. package/lib/browser/task-service.js +0 -1116
  90. package/lib/browser/task-service.js.map +0 -1
  91. package/lib/browser/task-source-resolver.d.ts +0 -10
  92. package/lib/browser/task-source-resolver.d.ts.map +0 -1
  93. package/lib/browser/task-source-resolver.js +0 -44
  94. package/lib/browser/task-source-resolver.js.map +0 -1
  95. package/lib/browser/task-templates.d.ts +0 -14
  96. package/lib/browser/task-templates.d.ts.map +0 -1
  97. package/lib/browser/task-templates.js +0 -158
  98. package/lib/browser/task-templates.js.map +0 -1
  99. package/lib/browser/task-terminal-widget-manager.d.ts +0 -45
  100. package/lib/browser/task-terminal-widget-manager.d.ts.map +0 -1
  101. package/lib/browser/task-terminal-widget-manager.js +0 -222
  102. package/lib/browser/task-terminal-widget-manager.js.map +0 -1
  103. package/lib/browser/tasks-monaco-contribution.d.ts +0 -2
  104. package/lib/browser/tasks-monaco-contribution.d.ts.map +0 -1
  105. package/lib/browser/tasks-monaco-contribution.js +0 -28
  106. package/lib/browser/tasks-monaco-contribution.js.map +0 -1
  107. package/lib/common/index.d.ts +0 -5
  108. package/lib/common/index.d.ts.map +0 -1
  109. package/lib/common/index.js +0 -23
  110. package/lib/common/index.js.map +0 -1
  111. package/lib/common/problem-matcher-protocol.d.ts +0 -125
  112. package/lib/common/problem-matcher-protocol.d.ts.map +0 -1
  113. package/lib/common/problem-matcher-protocol.js +0 -133
  114. package/lib/common/problem-matcher-protocol.js.map +0 -1
  115. package/lib/common/process/task-protocol.d.ts +0 -69
  116. package/lib/common/process/task-protocol.d.ts.map +0 -1
  117. package/lib/common/process/task-protocol.js +0 -34
  118. package/lib/common/process/task-protocol.js.map +0 -1
  119. package/lib/common/task-common-module.d.ts +0 -8
  120. package/lib/common/task-common-module.d.ts.map +0 -1
  121. package/lib/common/task-common-module.js +0 -29
  122. package/lib/common/task-common-module.js.map +0 -1
  123. package/lib/common/task-preferences.d.ts +0 -6
  124. package/lib/common/task-preferences.d.ts.map +0 -1
  125. package/lib/common/task-preferences.js +0 -41
  126. package/lib/common/task-preferences.js.map +0 -1
  127. package/lib/common/task-protocol.d.ts +0 -194
  128. package/lib/common/task-protocol.d.ts.map +0 -1
  129. package/lib/common/task-protocol.js +0 -138
  130. package/lib/common/task-protocol.js.map +0 -1
  131. package/lib/common/task-util.d.ts +0 -23
  132. package/lib/common/task-util.d.ts.map +0 -1
  133. package/lib/common/task-util.js +0 -47
  134. package/lib/common/task-util.js.map +0 -1
  135. package/lib/common/task-watcher.d.ts +0 -18
  136. package/lib/common/task-watcher.d.ts.map +0 -1
  137. package/lib/common/task-watcher.js +0 -82
  138. package/lib/common/task-watcher.js.map +0 -1
  139. package/lib/node/custom/custom-task-runner-backend-module.d.ts +0 -3
  140. package/lib/node/custom/custom-task-runner-backend-module.d.ts.map +0 -1
  141. package/lib/node/custom/custom-task-runner-backend-module.js +0 -37
  142. package/lib/node/custom/custom-task-runner-backend-module.js.map +0 -1
  143. package/lib/node/custom/custom-task-runner-contribution.d.ts +0 -7
  144. package/lib/node/custom/custom-task-runner-contribution.d.ts.map +0 -1
  145. package/lib/node/custom/custom-task-runner-contribution.js +0 -35
  146. package/lib/node/custom/custom-task-runner-contribution.js.map +0 -1
  147. package/lib/node/custom/custom-task-runner.d.ts +0 -16
  148. package/lib/node/custom/custom-task-runner.d.ts.map +0 -1
  149. package/lib/node/custom/custom-task-runner.js +0 -62
  150. package/lib/node/custom/custom-task-runner.js.map +0 -1
  151. package/lib/node/custom/custom-task.d.ts +0 -21
  152. package/lib/node/custom/custom-task.d.ts.map +0 -1
  153. package/lib/node/custom/custom-task.js +0 -68
  154. package/lib/node/custom/custom-task.js.map +0 -1
  155. package/lib/node/index.d.ts +0 -4
  156. package/lib/node/index.d.ts.map +0 -1
  157. package/lib/node/index.js +0 -22
  158. package/lib/node/index.js.map +0 -1
  159. package/lib/node/process/process-task-runner-backend-module.d.ts +0 -3
  160. package/lib/node/process/process-task-runner-backend-module.d.ts.map +0 -1
  161. package/lib/node/process/process-task-runner-backend-module.js +0 -37
  162. package/lib/node/process/process-task-runner-backend-module.js.map +0 -1
  163. package/lib/node/process/process-task-runner-contribution.d.ts +0 -7
  164. package/lib/node/process/process-task-runner-contribution.d.ts.map +0 -1
  165. package/lib/node/process/process-task-runner-contribution.js +0 -36
  166. package/lib/node/process/process-task-runner-contribution.js.map +0 -1
  167. package/lib/node/process/process-task-runner.d.ts +0 -61
  168. package/lib/node/process/process-task-runner.d.ts.map +0 -1
  169. package/lib/node/process/process-task-runner.js +0 -348
  170. package/lib/node/process/process-task-runner.js.map +0 -1
  171. package/lib/node/process/process-task.d.ts +0 -27
  172. package/lib/node/process/process-task.d.ts.map +0 -1
  173. package/lib/node/process/process-task.js +0 -125
  174. package/lib/node/process/process-task.js.map +0 -1
  175. package/lib/node/process/process-task.spec.d.ts +0 -2
  176. package/lib/node/process/process-task.spec.d.ts.map +0 -1
  177. package/lib/node/process/process-task.spec.js +0 -30
  178. package/lib/node/process/process-task.spec.js.map +0 -1
  179. package/lib/node/task-abstract-line-matcher.d.ts +0 -50
  180. package/lib/node/task-abstract-line-matcher.d.ts.map +0 -1
  181. package/lib/node/task-abstract-line-matcher.js +0 -274
  182. package/lib/node/task-abstract-line-matcher.js.map +0 -1
  183. package/lib/node/task-backend-application-contribution.d.ts +0 -9
  184. package/lib/node/task-backend-application-contribution.d.ts.map +0 -1
  185. package/lib/node/task-backend-application-contribution.js +0 -41
  186. package/lib/node/task-backend-application-contribution.js.map +0 -1
  187. package/lib/node/task-backend-module.d.ts +0 -4
  188. package/lib/node/task-backend-module.d.ts.map +0 -1
  189. package/lib/node/task-backend-module.js +0 -53
  190. package/lib/node/task-backend-module.js.map +0 -1
  191. package/lib/node/task-line-matchers.d.ts +0 -28
  192. package/lib/node/task-line-matchers.d.ts.map +0 -1
  193. package/lib/node/task-line-matchers.js +0 -122
  194. package/lib/node/task-line-matchers.js.map +0 -1
  195. package/lib/node/task-manager.d.ts +0 -56
  196. package/lib/node/task-manager.d.ts.map +0 -1
  197. package/lib/node/task-manager.js +0 -125
  198. package/lib/node/task-manager.js.map +0 -1
  199. package/lib/node/task-problem-collector.d.ts +0 -11
  200. package/lib/node/task-problem-collector.d.ts.map +0 -1
  201. package/lib/node/task-problem-collector.js +0 -58
  202. package/lib/node/task-problem-collector.js.map +0 -1
  203. package/lib/node/task-problem-collector.spec.d.ts +0 -2
  204. package/lib/node/task-problem-collector.spec.d.ts.map +0 -1
  205. package/lib/node/task-problem-collector.spec.js +0 -311
  206. package/lib/node/task-problem-collector.spec.js.map +0 -1
  207. package/lib/node/task-runner-protocol.d.ts +0 -17
  208. package/lib/node/task-runner-protocol.d.ts.map +0 -1
  209. package/lib/node/task-runner-protocol.js +0 -20
  210. package/lib/node/task-runner-protocol.js.map +0 -1
  211. package/lib/node/task-runner.d.ts +0 -51
  212. package/lib/node/task-runner.d.ts.map +0 -1
  213. package/lib/node/task-runner.js +0 -90
  214. package/lib/node/task-runner.js.map +0 -1
  215. package/lib/node/task-server.d.ts +0 -40
  216. package/lib/node/task-server.d.ts.map +0 -1
  217. package/lib/node/task-server.js +0 -232
  218. package/lib/node/task-server.js.map +0 -1
  219. package/lib/node/task-server.slow-spec.d.ts +0 -2
  220. package/lib/node/task-server.slow-spec.d.ts.map +0 -1
  221. package/lib/node/task-server.slow-spec.js +0 -395
  222. package/lib/node/task-server.slow-spec.js.map +0 -1
  223. package/lib/node/task.d.ts +0 -51
  224. package/lib/node/task.d.ts.map +0 -1
  225. package/lib/node/task.js +0 -73
  226. package/lib/node/task.js.map +0 -1
  227. package/lib/node/test/task-test-container.d.ts +0 -3
  228. package/lib/node/test/task-test-container.d.ts.map +0 -1
  229. package/lib/node/test/task-test-container.js +0 -59
  230. package/lib/node/test/task-test-container.js.map +0 -1
@@ -1,72 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2024 TypeFox 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-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.TaskContextKeyService = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
22
- const application_protocol_1 = require("@theia/core/lib/common/application-protocol");
23
- let TaskContextKeyService = class TaskContextKeyService {
24
- init() {
25
- this.customExecutionSupported = this.contextKeyService.createKey('customExecutionSupported', true);
26
- this.shellExecutionSupported = this.contextKeyService.createKey('shellExecutionSupported', true);
27
- this.processExecutionSupported = this.contextKeyService.createKey('processExecutionSupported', true);
28
- this.serverlessWebContext = this.contextKeyService.createKey('serverlessWebContext', false);
29
- this.taskCommandsRegistered = this.contextKeyService.createKey('taskCommandsRegistered', true);
30
- this.applicationServer.getApplicationPlatform().then(platform => {
31
- if (platform === 'web') {
32
- this.setShellExecutionSupported(false);
33
- this.setProcessExecutionSupported(false);
34
- this.setServerlessWebContext(true);
35
- }
36
- });
37
- }
38
- setCustomExecutionSupported(customExecutionSupported) {
39
- this.customExecutionSupported.set(customExecutionSupported);
40
- }
41
- setShellExecutionSupported(shellExecutionSupported) {
42
- this.shellExecutionSupported.set(shellExecutionSupported);
43
- }
44
- setProcessExecutionSupported(processExecutionSupported) {
45
- this.processExecutionSupported.set(processExecutionSupported);
46
- }
47
- setServerlessWebContext(serverlessWebContext) {
48
- this.serverlessWebContext.set(serverlessWebContext);
49
- }
50
- setTaskCommandsRegistered(taskCommandsRegistered) {
51
- this.taskCommandsRegistered.set(taskCommandsRegistered);
52
- }
53
- };
54
- exports.TaskContextKeyService = TaskContextKeyService;
55
- tslib_1.__decorate([
56
- (0, inversify_1.inject)(context_key_service_1.ContextKeyService),
57
- tslib_1.__metadata("design:type", Object)
58
- ], TaskContextKeyService.prototype, "contextKeyService", void 0);
59
- tslib_1.__decorate([
60
- (0, inversify_1.inject)(application_protocol_1.ApplicationServer),
61
- tslib_1.__metadata("design:type", Object)
62
- ], TaskContextKeyService.prototype, "applicationServer", void 0);
63
- tslib_1.__decorate([
64
- (0, inversify_1.postConstruct)(),
65
- tslib_1.__metadata("design:type", Function),
66
- tslib_1.__metadata("design:paramtypes", []),
67
- tslib_1.__metadata("design:returntype", void 0)
68
- ], TaskContextKeyService.prototype, "init", null);
69
- exports.TaskContextKeyService = TaskContextKeyService = tslib_1.__decorate([
70
- (0, inversify_1.injectable)()
71
- ], TaskContextKeyService);
72
- //# sourceMappingURL=task-context-key-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-context-key-service.js","sourceRoot":"","sources":["../../src/browser/task-context-key-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAiF;AACjF,qFAA4F;AAC5F,sFAAgF;AAGzE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAiBpB,IAAI;QACV,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,0BAA0B,EAAE,IAAI,CAAC,CAAC;QACnG,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC;QACjG,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,2BAA2B,EAAE,IAAI,CAAC,CAAC;QACrG,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;QAC5F,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC;QAC/F,IAAI,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC5D,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;gBACrB,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;gBACvC,IAAI,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC;gBACzC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;YACvC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED,2BAA2B,CAAC,wBAAiC;QACzD,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAChE,CAAC;IAED,0BAA0B,CAAC,uBAAgC;QACvD,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IAC9D,CAAC;IAED,4BAA4B,CAAC,yBAAkC;QAC3D,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAClE,CAAC;IAED,uBAAuB,CAAC,oBAA6B;QACjD,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACxD,CAAC;IAED,yBAAyB,CAAC,sBAA+B;QACrD,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAC5D,CAAC;CAEJ,CAAA;AApDY,sDAAqB;AAGX;IADlB,IAAA,kBAAM,EAAC,uCAAiB,CAAC;;gEAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,wCAAiB,CAAC;;gEAC8B;AAW9C;IADT,IAAA,yBAAa,GAAE;;;;iDAcf;gCA9BQ,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CAoDjC"}
@@ -1,183 +0,0 @@
1
- import { Disposable } from '@theia/core/lib/common/disposable';
2
- import { TaskConfiguration } from '../common/task-protocol';
3
- import { WaitUntilEvent, Emitter } from '@theia/core/lib/common/event';
4
- export declare const TaskContribution: unique symbol;
5
- /**
6
- * A {@link TaskContribution} allows to contribute custom {@link TaskResolver}s and/or {@link TaskProvider}s.
7
- *
8
- * ### Example usage
9
- * ```typescript
10
- * @injectable()
11
- * export class ProcessTaskContribution implements TaskContribution {
12
- *
13
- * @inject(ProcessTaskResolver)
14
- * protected readonly processTaskResolver: ProcessTaskResolver;
15
- *
16
- * registerResolvers(resolvers: TaskResolverRegistry): void {
17
- * resolvers.register('process', this.processTaskResolver);
18
- * resolvers.register('shell', this.processTaskResolver);
19
- * }
20
- * }
21
- * ```
22
- */
23
- export interface TaskContribution {
24
- /**
25
- * Register task resolvers using the given `TaskResolverRegistry`.
26
- * @param resolvers the task resolver registry.
27
- */
28
- registerResolvers?(resolvers: TaskResolverRegistry): void;
29
- /**
30
- * Register task providers using the given `TaskProviderRegistry`.
31
- * @param resolvers the task provider registry.
32
- */
33
- registerProviders?(providers: TaskProviderRegistry): void;
34
- }
35
- /**
36
- * A {@link TaskResolver} is used to preprocess/resolve a task before sending
37
- * it to the Task Server. For instance, the resolver can be used to add missing information to the configuration
38
- * (e.g default values for optional parameters).
39
- */
40
- export interface TaskResolver {
41
- /**
42
- * Resolves a `TaskConfiguration` before sending it for execution to the `TaskServer` (Backend).
43
- * @param taskConfig the configuration that should be resolved.
44
- *
45
- * @returns a promise of the resolved `TaskConfiguration`.
46
- */
47
- resolveTask(taskConfig: TaskConfiguration): Promise<TaskConfiguration>;
48
- }
49
- /**
50
- * A {@link TaskProvider} can be used to define the set of tasks that should
51
- * be provided to the system. i.e. that are available for the user to run.
52
- */
53
- export interface TaskProvider {
54
- /**
55
- * Retrieves the task configurations which are provided programmatically to the system.
56
- *
57
- * @returns a promise of the provided tasks configurations.
58
- */
59
- provideTasks(): Promise<TaskConfiguration[]>;
60
- }
61
- export interface WillResolveTaskProvider extends WaitUntilEvent {
62
- taskType?: string;
63
- }
64
- /**
65
- * The {@link TaskResolverRegistry} is the common component for registration and provision of
66
- * {@link TaskResolver}s. Theia will collect all {@link TaskContribution}s and invoke {@link TaskContribution#registerResolvers}
67
- * for each contribution.
68
- */
69
- export declare class TaskResolverRegistry {
70
- protected readonly onWillProvideTaskResolverEmitter: Emitter<WillResolveTaskProvider>;
71
- /**
72
- * Emit when the registry provides a registered resolver. i.e. when the {@link TaskResolverRegistry#getResolver}
73
- * function is called.
74
- */
75
- readonly onWillProvideTaskResolver: import("@theia/core/lib/common/event").Event<WillResolveTaskProvider>;
76
- protected taskResolvers: Map<string, TaskResolver>;
77
- protected executionResolvers: Map<string, TaskResolver>;
78
- /**
79
- * Registers the given {@link TaskResolver} to resolve the `TaskConfiguration` of the specified type.
80
- * If there is already a `TaskResolver` registered for the specified type the registration will
81
- * be overwritten with the new value.
82
- *
83
- * @deprecated since 1.12.0 use `registerTaskResolver` instead.
84
- *
85
- * @param type the task configuration type for which the given resolver should be registered.
86
- * @param resolver the task resolver that should be registered.
87
- *
88
- * @returns a `Disposable` that can be invoked to unregister the given resolver
89
- */
90
- register(type: string, resolver: TaskResolver): Disposable;
91
- /**
92
- * Registers the given {@link TaskResolver} to resolve the `TaskConfiguration` of the specified type.
93
- * If there is already a `TaskResolver` registered for the specified type the registration will
94
- * be overwritten with the new value.
95
- *
96
- * @param type the task configuration type for which the given resolver should be registered.
97
- * @param resolver the task resolver that should be registered.
98
- *
99
- * @returns a `Disposable` that can be invoked to unregister the given resolver
100
- */
101
- registerTaskResolver(type: string, resolver: TaskResolver): Disposable;
102
- /**
103
- * Retrieves the {@link TaskResolver} registered for the given type task configuration type.
104
- *
105
- * @deprecated since 1.12.0 use `getTaskResolver()` instead.
106
- *
107
- * @param type the task configuration type
108
- *
109
- * @returns a promise of the registered `TaskResolver` or `undefined` if no resolver is registered for the given type.
110
- */
111
- getResolver(type: string): Promise<TaskResolver | undefined>;
112
- /**
113
- * Retrieves the {@link TaskResolver} registered for the given type task configuration type.
114
- * @param type the task configuration type
115
- *
116
- * @returns a promise of the registered `TaskResolver` or `undefined` if no resolver is registered for the given type.
117
- */
118
- getTaskResolver(type: string): Promise<TaskResolver | undefined>;
119
- /**
120
- * Registers the given {@link TaskResolver} to resolve the `TaskConfiguration` for the
121
- * specified type of execution ('shell', 'process' or 'customExecution').
122
- * If there is already a `TaskResolver` registered for the specified type the registration will
123
- * be overwritten with the new value.
124
- *
125
- * @param type the task execution type for which the given resolver should be registered.
126
- * @param resolver the task resolver that should be registered.
127
- *
128
- * @returns a `Disposable` that can be invoked to unregister the given resolver
129
- */
130
- registerExecutionResolver(type: string, resolver: TaskResolver): Disposable;
131
- /**
132
- * Retrieves the {@link TaskResolver} registered for the given type of execution ('shell', 'process' or 'customExecution')..
133
- * @param type the task configuration type
134
- *
135
- * @returns a promise of the registered `TaskResolver` or `undefined` if no resolver is registered for the given type.
136
- */
137
- getExecutionResolver(executionType: string): TaskResolver | undefined;
138
- }
139
- /**
140
- * The {@link TaskProviderRegistry} is the common component for registration and provision of
141
- * {@link TaskProvider}s. Theia will collect all {@link TaskContribution}s and invoke {@link TaskContribution#registerProviders}
142
- * for each contribution.
143
- */
144
- export declare class TaskProviderRegistry {
145
- protected readonly onWillProvideTaskProviderEmitter: Emitter<WillResolveTaskProvider>;
146
- /**
147
- * Emit when the registry provides a registered task provider. i.e. when the {@link TaskProviderRegistry#getProvider}
148
- * function is called.
149
- */
150
- readonly onWillProvideTaskProvider: import("@theia/core/lib/common/event").Event<WillResolveTaskProvider>;
151
- protected providers: Map<string, TaskProvider>;
152
- protected init(): void;
153
- /**
154
- * Registers the given {@link TaskProvider} for task configurations of the specified type
155
- * @param type the task configuration type for which the given provider should be registered.
156
- * @param provider the `TaskProvider` that should be registered.
157
- *
158
- * @returns a `Disposable` that can be invoked to unregister the given resolver.
159
- */
160
- register(type: string, provider: TaskProvider, handle?: number): Disposable;
161
- /**
162
- * Initiates activation of a TaskProvider with the given type
163
- * @param type the task configuration type, '*' indicates, all providers.
164
- */
165
- activateProvider(type: string): Promise<void>;
166
- /**
167
- * Retrieves the {@link TaskProvider} registered for the given type task configuration type.
168
- * If there is already a `TaskProvider` registered for the specified type the registration will
169
- * be overwritten with the new value.
170
- * @param type the task configuration type.
171
- *
172
- * @returns a promise of the registered `TaskProvider`` or `undefined` if no provider is registered for the given type.
173
- */
174
- getProvider(type: string): Promise<TaskProvider | undefined>;
175
- /**
176
- * Retrieve all registered {@link TaskProvider}s.
177
- *
178
- * Use {@link activateProvider} to control registration of providers as needed.
179
- * @returns a promise of all registered {@link TaskProvider}s.
180
- */
181
- getProviders(): Promise<TaskProvider[]>;
182
- }
183
- //# sourceMappingURL=task-contribution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/task-contribution.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEvE,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAE3D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;;OAGG;IACH,iBAAiB,CAAC,CAAC,SAAS,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC1D;;;OAGG;IACH,iBAAiB,CAAC,CAAC,SAAS,EAAE,oBAAoB,GAAG,IAAI,CAAC;CAC7D;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IACzB;;;;;OAKG;IAEH,WAAW,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC1E;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB;;;;OAIG;IACH,YAAY,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;;GAIG;AACH,qBACa,oBAAoB;IAE7B,SAAS,CAAC,QAAQ,CAAC,gCAAgC,mCAA0C;IAC7F;;;OAGG;IACH,QAAQ,CAAC,yBAAyB,wEAA+C;IAEjF,SAAS,CAAC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IAC/D,SAAS,CAAC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IAEpE;;;;;;;;;;;OAWG;IAC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Red Hat, Inc. 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-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.TaskProviderRegistry = exports.TaskResolverRegistry = exports.TaskContribution = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const event_1 = require("@theia/core/lib/common/event");
22
- exports.TaskContribution = Symbol('TaskContribution');
23
- /**
24
- * The {@link TaskResolverRegistry} is the common component for registration and provision of
25
- * {@link TaskResolver}s. Theia will collect all {@link TaskContribution}s and invoke {@link TaskContribution#registerResolvers}
26
- * for each contribution.
27
- */
28
- let TaskResolverRegistry = class TaskResolverRegistry {
29
- constructor() {
30
- this.onWillProvideTaskResolverEmitter = new event_1.Emitter();
31
- /**
32
- * Emit when the registry provides a registered resolver. i.e. when the {@link TaskResolverRegistry#getResolver}
33
- * function is called.
34
- */
35
- this.onWillProvideTaskResolver = this.onWillProvideTaskResolverEmitter.event;
36
- this.taskResolvers = new Map();
37
- this.executionResolvers = new Map();
38
- }
39
- /**
40
- * Registers the given {@link TaskResolver} to resolve the `TaskConfiguration` of the specified type.
41
- * If there is already a `TaskResolver` registered for the specified type the registration will
42
- * be overwritten with the new value.
43
- *
44
- * @deprecated since 1.12.0 use `registerTaskResolver` instead.
45
- *
46
- * @param type the task configuration type for which the given resolver should be registered.
47
- * @param resolver the task resolver that should be registered.
48
- *
49
- * @returns a `Disposable` that can be invoked to unregister the given resolver
50
- */
51
- register(type, resolver) {
52
- return this.registerTaskResolver(type, resolver);
53
- }
54
- /**
55
- * Registers the given {@link TaskResolver} to resolve the `TaskConfiguration` of the specified type.
56
- * If there is already a `TaskResolver` registered for the specified type the registration will
57
- * be overwritten with the new value.
58
- *
59
- * @param type the task configuration type for which the given resolver should be registered.
60
- * @param resolver the task resolver that should be registered.
61
- *
62
- * @returns a `Disposable` that can be invoked to unregister the given resolver
63
- */
64
- registerTaskResolver(type, resolver) {
65
- if (this.taskResolvers.has(type)) {
66
- console.warn(`Overriding task resolver for ${type}`);
67
- }
68
- this.taskResolvers.set(type, resolver);
69
- return {
70
- dispose: () => this.taskResolvers.delete(type)
71
- };
72
- }
73
- /**
74
- * Retrieves the {@link TaskResolver} registered for the given type task configuration type.
75
- *
76
- * @deprecated since 1.12.0 use `getTaskResolver()` instead.
77
- *
78
- * @param type the task configuration type
79
- *
80
- * @returns a promise of the registered `TaskResolver` or `undefined` if no resolver is registered for the given type.
81
- */
82
- async getResolver(type) {
83
- return this.getTaskResolver(type);
84
- }
85
- /**
86
- * Retrieves the {@link TaskResolver} registered for the given type task configuration type.
87
- * @param type the task configuration type
88
- *
89
- * @returns a promise of the registered `TaskResolver` or `undefined` if no resolver is registered for the given type.
90
- */
91
- async getTaskResolver(type) {
92
- await event_1.WaitUntilEvent.fire(this.onWillProvideTaskResolverEmitter, { taskType: type });
93
- return this.taskResolvers.get(type);
94
- }
95
- /**
96
- * Registers the given {@link TaskResolver} to resolve the `TaskConfiguration` for the
97
- * specified type of execution ('shell', 'process' or 'customExecution').
98
- * If there is already a `TaskResolver` registered for the specified type the registration will
99
- * be overwritten with the new value.
100
- *
101
- * @param type the task execution type for which the given resolver should be registered.
102
- * @param resolver the task resolver that should be registered.
103
- *
104
- * @returns a `Disposable` that can be invoked to unregister the given resolver
105
- */
106
- registerExecutionResolver(type, resolver) {
107
- if (this.executionResolvers.has(type)) {
108
- console.warn(`Overriding execution resolver for ${type}`);
109
- }
110
- this.executionResolvers.set(type, resolver);
111
- return {
112
- dispose: () => this.executionResolvers.delete(type)
113
- };
114
- }
115
- /**
116
- * Retrieves the {@link TaskResolver} registered for the given type of execution ('shell', 'process' or 'customExecution')..
117
- * @param type the task configuration type
118
- *
119
- * @returns a promise of the registered `TaskResolver` or `undefined` if no resolver is registered for the given type.
120
- */
121
- getExecutionResolver(executionType) {
122
- return this.executionResolvers.get(executionType);
123
- }
124
- };
125
- exports.TaskResolverRegistry = TaskResolverRegistry;
126
- exports.TaskResolverRegistry = TaskResolverRegistry = tslib_1.__decorate([
127
- (0, inversify_1.injectable)()
128
- ], TaskResolverRegistry);
129
- /**
130
- * The {@link TaskProviderRegistry} is the common component for registration and provision of
131
- * {@link TaskProvider}s. Theia will collect all {@link TaskContribution}s and invoke {@link TaskContribution#registerProviders}
132
- * for each contribution.
133
- */
134
- let TaskProviderRegistry = class TaskProviderRegistry {
135
- constructor() {
136
- this.onWillProvideTaskProviderEmitter = new event_1.Emitter();
137
- /**
138
- * Emit when the registry provides a registered task provider. i.e. when the {@link TaskProviderRegistry#getProvider}
139
- * function is called.
140
- */
141
- this.onWillProvideTaskProvider = this.onWillProvideTaskProviderEmitter.event;
142
- }
143
- init() {
144
- this.providers = new Map();
145
- }
146
- /**
147
- * Registers the given {@link TaskProvider} for task configurations of the specified type
148
- * @param type the task configuration type for which the given provider should be registered.
149
- * @param provider the `TaskProvider` that should be registered.
150
- *
151
- * @returns a `Disposable` that can be invoked to unregister the given resolver.
152
- */
153
- register(type, provider, handle) {
154
- const key = handle === undefined ? type : `${type}::${handle}`;
155
- this.providers.set(key, provider);
156
- return {
157
- dispose: () => this.providers.delete(key)
158
- };
159
- }
160
- /**
161
- * Initiates activation of a TaskProvider with the given type
162
- * @param type the task configuration type, '*' indicates, all providers.
163
- */
164
- async activateProvider(type) {
165
- await event_1.WaitUntilEvent.fire(this.onWillProvideTaskProviderEmitter, { taskType: type });
166
- }
167
- /**
168
- * Retrieves the {@link TaskProvider} registered for the given type task configuration type.
169
- * If there is already a `TaskProvider` registered for the specified type the registration will
170
- * be overwritten with the new value.
171
- * @param type the task configuration type.
172
- *
173
- * @returns a promise of the registered `TaskProvider`` or `undefined` if no provider is registered for the given type.
174
- */
175
- async getProvider(type) {
176
- await this.activateProvider(type);
177
- return this.providers.get(type);
178
- }
179
- /**
180
- * Retrieve all registered {@link TaskProvider}s.
181
- *
182
- * Use {@link activateProvider} to control registration of providers as needed.
183
- * @returns a promise of all registered {@link TaskProvider}s.
184
- */
185
- async getProviders() {
186
- return [...this.providers.values()];
187
- }
188
- };
189
- exports.TaskProviderRegistry = TaskProviderRegistry;
190
- tslib_1.__decorate([
191
- (0, inversify_1.postConstruct)(),
192
- tslib_1.__metadata("design:type", Function),
193
- tslib_1.__metadata("design:paramtypes", []),
194
- tslib_1.__metadata("design:returntype", void 0)
195
- ], TaskProviderRegistry.prototype, "init", null);
196
- exports.TaskProviderRegistry = TaskProviderRegistry = tslib_1.__decorate([
197
- (0, inversify_1.injectable)()
198
- ], TaskProviderRegistry);
199
- //# sourceMappingURL=task-contribution.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-contribution.js","sourceRoot":"","sources":["../../src/browser/task-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAyE;AAGzE,wDAAuE;AAE1D,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAkE3D;;;;GAIG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAA1B;QAEgB,qCAAgC,GAAG,IAAI,eAAO,EAA2B,CAAC;QAC7F;;;WAGG;QACM,8BAAyB,GAAG,IAAI,CAAC,gCAAgC,CAAC,KAAK,CAAC;QAEvE,kBA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IACH,KAAK,CAAC,WAAW,CAAC,IAAY;QAC1B,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,YAAY;QACd,OAAO,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;IACxC,CAAC;CACJ,CAAA;AA7DY,oDAAoB;AAYnB;IADT,IAAA,yBAAa,GAAE;;;;gDAGf;+BAdQ,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CA6DhC"}
@@ -1,39 +0,0 @@
1
- import { Event, Emitter } from '@theia/core/lib/common';
2
- import { TaskConfiguration, TaskDefinition, TaskCustomization } from '../common';
3
- import { Disposable } from '@theia/core/lib/common/disposable';
4
- export declare class TaskDefinitionRegistry {
5
- private definitions;
6
- protected readonly onDidRegisterTaskDefinitionEmitter: Emitter<void>;
7
- get onDidRegisterTaskDefinition(): Event<void>;
8
- protected readonly onDidUnregisterTaskDefinitionEmitter: Emitter<void>;
9
- get onDidUnregisterTaskDefinition(): Event<void>;
10
- /**
11
- * Returns all task definitions that are registered
12
- * @return the task definitions that are registered
13
- */
14
- getAll(): TaskDefinition[];
15
- /**
16
- * Finds the task definition(s) from the registry with the given `taskType`.
17
- *
18
- * @param taskType the type of the task
19
- * @return an array of the task definitions. If no task definitions are found, an empty array is returned.
20
- */
21
- getDefinitions(taskType: string): TaskDefinition[];
22
- /**
23
- * Finds the task definition from the registry for the task configuration.
24
- * The task configuration is considered as a "match" to the task definition if it has all the `required` properties.
25
- * In case that more than one task definition is found, return the one that has the biggest number of matched properties.
26
- *
27
- * @param taskConfiguration the task configuration
28
- * @return the task definition for the task configuration. If the task definition is not found, `undefined` is returned.
29
- */
30
- getDefinition(taskConfiguration: TaskConfiguration | TaskCustomization): TaskDefinition | undefined;
31
- /**
32
- * Add a task definition to the registry.
33
- *
34
- * @param definition the task definition to be added.
35
- */
36
- register(definition: TaskDefinition): Disposable;
37
- compareTasks(one: TaskConfiguration | TaskCustomization, other: TaskConfiguration | TaskCustomization): boolean;
38
- }
39
- //# sourceMappingURL=task-definition-registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-definition-registry.d.ts","sourceRoot":"","sources":["../../src/browser/task-definition-registry.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,qBACa,sBAAsB;IAG/B,OAAO,CAAC,WAAW,CAA4C;IAE/D,SAAS,CAAC,QAAQ,CAAC,kCAAkC,gBAAuB;IAC5E,IAAI,2BAA2B,IAAI,KAAK,CAAC,IAAI,CAAC,CAE7C;IAED,SAAS,CAAC,QAAQ,CAAC,oCAAoC,gBAAuB;IAC9E,IAAI,6BAA6B,IAAI,KAAK,CAAC,IAAI,CAAC,CAE/C;IAED;;;OAGG;IACH,MAAM,IAAI,cAAc,EAAE;IAQ1B;;;;;OAKG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,EAAE;IAIlD;;;;;;;OAOG;IACH,aAAa,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,cAAc,GAAG,SAAS;IAqBnG;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,cAAc,GAAG,UAAU;IAehD,YAAY,CAAC,GAAG,EAAE,iBAAiB,GAAG,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,OAAO;CAqBlH"}
@@ -1,130 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2019 Ericsson 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-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.TaskDefinitionRegistry = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const coreutils_1 = require("@theia/core/shared/@lumino/coreutils");
22
- const common_1 = require("@theia/core/lib/common");
23
- const disposable_1 = require("@theia/core/lib/common/disposable");
24
- let TaskDefinitionRegistry = class TaskDefinitionRegistry {
25
- constructor() {
26
- // task type - array of task definitions
27
- this.definitions = new Map();
28
- this.onDidRegisterTaskDefinitionEmitter = new common_1.Emitter();
29
- this.onDidUnregisterTaskDefinitionEmitter = new common_1.Emitter();
30
- }
31
- get onDidRegisterTaskDefinition() {
32
- return this.onDidRegisterTaskDefinitionEmitter.event;
33
- }
34
- get onDidUnregisterTaskDefinition() {
35
- return this.onDidUnregisterTaskDefinitionEmitter.event;
36
- }
37
- /**
38
- * Returns all task definitions that are registered
39
- * @return the task definitions that are registered
40
- */
41
- getAll() {
42
- const all = [];
43
- for (const definitions of this.definitions.values()) {
44
- all.push(...definitions);
45
- }
46
- return all;
47
- }
48
- /**
49
- * Finds the task definition(s) from the registry with the given `taskType`.
50
- *
51
- * @param taskType the type of the task
52
- * @return an array of the task definitions. If no task definitions are found, an empty array is returned.
53
- */
54
- getDefinitions(taskType) {
55
- return this.definitions.get(taskType) || [];
56
- }
57
- /**
58
- * Finds the task definition from the registry for the task configuration.
59
- * The task configuration is considered as a "match" to the task definition if it has all the `required` properties.
60
- * In case that more than one task definition is found, return the one that has the biggest number of matched properties.
61
- *
62
- * @param taskConfiguration the task configuration
63
- * @return the task definition for the task configuration. If the task definition is not found, `undefined` is returned.
64
- */
65
- getDefinition(taskConfiguration) {
66
- const definitions = this.getDefinitions(taskConfiguration.type);
67
- let matchedDefinition;
68
- let highest = -1;
69
- for (const def of definitions) {
70
- const required = def.properties.required || [];
71
- if (!required.every(requiredProp => taskConfiguration[requiredProp] !== undefined)) {
72
- continue;
73
- }
74
- let score = required.length; // number of required properties
75
- const requiredProps = new Set(required);
76
- // number of optional properties
77
- score += def.properties.all.filter(p => !requiredProps.has(p) && taskConfiguration[p] !== undefined).length;
78
- if (score > highest) {
79
- highest = score;
80
- matchedDefinition = def;
81
- }
82
- }
83
- return matchedDefinition;
84
- }
85
- /**
86
- * Add a task definition to the registry.
87
- *
88
- * @param definition the task definition to be added.
89
- */
90
- register(definition) {
91
- const taskType = definition.taskType;
92
- const definitions = this.definitions.get(taskType) || [];
93
- definitions.push(definition);
94
- this.definitions.set(taskType, definitions);
95
- this.onDidRegisterTaskDefinitionEmitter.fire(undefined);
96
- return disposable_1.Disposable.create(() => {
97
- const index = definitions.indexOf(definition);
98
- if (index !== -1) {
99
- definitions.splice(index, 1);
100
- }
101
- this.onDidUnregisterTaskDefinitionEmitter.fire(undefined);
102
- });
103
- }
104
- compareTasks(one, other) {
105
- const oneType = one.type;
106
- const otherType = other.type;
107
- if (oneType !== otherType) {
108
- return false;
109
- }
110
- if (one['taskType'] !== other['taskType']) {
111
- return false;
112
- }
113
- const def = this.getDefinition(one);
114
- if (def) {
115
- // scope is either a string or an enum value. Anyway...they must exactly match
116
- // "_scope" may hold the Uri to the associated workspace whereas
117
- // "scope" reflects the original TaskConfigurationScope as provided by plugins,
118
- // Matching "_scope" or "scope" are both accepted in order to correlate provided task
119
- // configurations (e.g. TaskScope.Workspace) against already configured tasks.
120
- return def.properties.all.every(p => p === 'type' || coreutils_1.JSONExt.deepEqual(one[p], other[p]))
121
- && (one._scope === other._scope || one.scope === other.scope);
122
- }
123
- return one.label === other.label && one._source === other._source;
124
- }
125
- };
126
- exports.TaskDefinitionRegistry = TaskDefinitionRegistry;
127
- exports.TaskDefinitionRegistry = TaskDefinitionRegistry = tslib_1.__decorate([
128
- (0, inversify_1.injectable)()
129
- ], TaskDefinitionRegistry);
130
- //# sourceMappingURL=task-definition-registry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task-definition-registry.js","sourceRoot":"","sources":["../../src/browser/task-definition-registry.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAA0D;AAC1D,oEAA+D;AAC/D,mDAAwD;AAExD,kEAA+D;AAGxD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAA5B;QAEH,wCAAwC;QAChC,gBAAW,GAAkC,IAAI,GAAG,EAAE,CAAC;QAE5C,uCAAkC,GAAG,IAAI,gBAAO,EAAQ,CAAC;QAKzD,yCAAoC,GAAG,IAAI,gBAAO,EAAQ,CAAC;IAiGlF,CAAC;IArGG,IAAI,2BAA2B;QAC3B,OAAO,IAAI,CAAC,kCAAkC,CAAC,KAAK,CAAC;IACzD,CAAC;IAGD,IAAI,6BAA6B;QAC7B,OAAO,IAAI,CAAC,oCAAoC,CAAC,KAAK,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACH,MAAM;QACF,MAAM,GAAG,GAAqB,EAAE,CAAC;QACjC,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC;YAClD,GAAG,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IAED;;;;;O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