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

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 (229) hide show
  1. package/lib/browser/index.d.ts +7 -0
  2. package/lib/browser/index.d.ts.map +1 -0
  3. package/lib/browser/index.js +25 -0
  4. package/lib/browser/index.js.map +1 -0
  5. package/lib/browser/process/process-task-contribution.d.ts +7 -0
  6. package/lib/browser/process/process-task-contribution.d.ts.map +1 -0
  7. package/lib/browser/process/process-task-contribution.js +36 -0
  8. package/lib/browser/process/process-task-contribution.js.map +1 -0
  9. package/lib/browser/process/process-task-frontend-module.d.ts +3 -0
  10. package/lib/browser/process/process-task-frontend-module.d.ts.map +1 -0
  11. package/lib/browser/process/process-task-frontend-module.js +28 -0
  12. package/lib/browser/process/process-task-frontend-module.js.map +1 -0
  13. package/lib/browser/process/process-task-resolver.d.ts +18 -0
  14. package/lib/browser/process/process-task-resolver.d.ts.map +1 -0
  15. package/lib/browser/process/process-task-resolver.js +94 -0
  16. package/lib/browser/process/process-task-resolver.js.map +1 -0
  17. package/lib/browser/provided-task-configurations.d.ts +44 -0
  18. package/lib/browser/provided-task-configurations.d.ts.map +1 -0
  19. package/lib/browser/provided-task-configurations.js +206 -0
  20. package/lib/browser/provided-task-configurations.js.map +1 -0
  21. package/lib/browser/provided-task-configurations.spec.d.ts +2 -0
  22. package/lib/browser/provided-task-configurations.spec.d.ts.map +1 -0
  23. package/lib/browser/provided-task-configurations.spec.js +44 -0
  24. package/lib/browser/provided-task-configurations.spec.js.map +1 -0
  25. package/lib/browser/quick-open-task.d.ts +146 -0
  26. package/lib/browser/quick-open-task.d.ts.map +1 -0
  27. package/lib/browser/quick-open-task.js +757 -0
  28. package/lib/browser/quick-open-task.js.map +1 -0
  29. package/lib/browser/task-configuration-manager.d.ts +63 -0
  30. package/lib/browser/task-configuration-manager.d.ts.map +1 -0
  31. package/lib/browser/task-configuration-manager.js +243 -0
  32. package/lib/browser/task-configuration-manager.js.map +1 -0
  33. package/lib/browser/task-configuration-model.d.ts +34 -0
  34. package/lib/browser/task-configuration-model.d.ts.map +1 -0
  35. package/lib/browser/task-configuration-model.js +83 -0
  36. package/lib/browser/task-configuration-model.js.map +1 -0
  37. package/lib/browser/task-configurations.d.ts +128 -0
  38. package/lib/browser/task-configurations.d.ts.map +1 -0
  39. package/lib/browser/task-configurations.js +479 -0
  40. package/lib/browser/task-configurations.js.map +1 -0
  41. package/lib/browser/task-context-key-service.d.ts +18 -0
  42. package/lib/browser/task-context-key-service.d.ts.map +1 -0
  43. package/lib/browser/task-context-key-service.js +72 -0
  44. package/lib/browser/task-context-key-service.js.map +1 -0
  45. package/lib/browser/task-contribution.d.ts +183 -0
  46. package/lib/browser/task-contribution.d.ts.map +1 -0
  47. package/lib/browser/task-contribution.js +199 -0
  48. package/lib/browser/task-contribution.js.map +1 -0
  49. package/lib/browser/task-definition-registry.d.ts +39 -0
  50. package/lib/browser/task-definition-registry.d.ts.map +1 -0
  51. package/lib/browser/task-definition-registry.js +130 -0
  52. package/lib/browser/task-definition-registry.js.map +1 -0
  53. package/lib/browser/task-definition-registry.spec.d.ts +2 -0
  54. package/lib/browser/task-definition-registry.spec.d.ts.map +1 -0
  55. package/lib/browser/task-definition-registry.spec.js +171 -0
  56. package/lib/browser/task-definition-registry.spec.js.map +1 -0
  57. package/lib/browser/task-frontend-contribution.d.ts +57 -0
  58. package/lib/browser/task-frontend-contribution.d.ts.map +1 -0
  59. package/lib/browser/task-frontend-contribution.js +351 -0
  60. package/lib/browser/task-frontend-contribution.js.map +1 -0
  61. package/lib/browser/task-frontend-module.d.ts +6 -0
  62. package/lib/browser/task-frontend-module.d.ts.map +1 -0
  63. package/lib/browser/task-frontend-module.js +82 -0
  64. package/lib/browser/task-frontend-module.js.map +1 -0
  65. package/lib/browser/task-name-resolver.d.ts +14 -0
  66. package/lib/browser/task-name-resolver.d.ts.map +1 -0
  67. package/lib/browser/task-name-resolver.js +60 -0
  68. package/lib/browser/task-name-resolver.js.map +1 -0
  69. package/lib/browser/task-node.d.ts +10 -0
  70. package/lib/browser/task-node.d.ts.map +1 -0
  71. package/lib/browser/task-node.js +18 -0
  72. package/lib/browser/task-node.js.map +1 -0
  73. package/lib/browser/task-problem-matcher-registry.d.ts +41 -0
  74. package/lib/browser/task-problem-matcher-registry.d.ts.map +1 -0
  75. package/lib/browser/task-problem-matcher-registry.js +302 -0
  76. package/lib/browser/task-problem-matcher-registry.js.map +1 -0
  77. package/lib/browser/task-problem-pattern-registry.d.ts +24 -0
  78. package/lib/browser/task-problem-pattern-registry.d.ts.map +1 -0
  79. package/lib/browser/task-problem-pattern-registry.js +203 -0
  80. package/lib/browser/task-problem-pattern-registry.js.map +1 -0
  81. package/lib/browser/task-schema-updater.d.ts +58 -0
  82. package/lib/browser/task-schema-updater.d.ts.map +1 -0
  83. package/lib/browser/task-schema-updater.js +676 -0
  84. package/lib/browser/task-schema-updater.js.map +1 -0
  85. package/lib/browser/task-service.d.ts +282 -0
  86. package/lib/browser/task-service.d.ts.map +1 -0
  87. package/lib/browser/task-service.js +1116 -0
  88. package/lib/browser/task-service.js.map +1 -0
  89. package/lib/browser/task-source-resolver.d.ts +10 -0
  90. package/lib/browser/task-source-resolver.d.ts.map +1 -0
  91. package/lib/browser/task-source-resolver.js +44 -0
  92. package/lib/browser/task-source-resolver.js.map +1 -0
  93. package/lib/browser/task-templates.d.ts +14 -0
  94. package/lib/browser/task-templates.d.ts.map +1 -0
  95. package/lib/browser/task-templates.js +158 -0
  96. package/lib/browser/task-templates.js.map +1 -0
  97. package/lib/browser/task-terminal-widget-manager.d.ts +45 -0
  98. package/lib/browser/task-terminal-widget-manager.d.ts.map +1 -0
  99. package/lib/browser/task-terminal-widget-manager.js +222 -0
  100. package/lib/browser/task-terminal-widget-manager.js.map +1 -0
  101. package/lib/browser/tasks-monaco-contribution.d.ts +2 -0
  102. package/lib/browser/tasks-monaco-contribution.d.ts.map +1 -0
  103. package/lib/browser/tasks-monaco-contribution.js +28 -0
  104. package/lib/browser/tasks-monaco-contribution.js.map +1 -0
  105. package/lib/common/index.d.ts +5 -0
  106. package/lib/common/index.d.ts.map +1 -0
  107. package/lib/common/index.js +23 -0
  108. package/lib/common/index.js.map +1 -0
  109. package/lib/common/problem-matcher-protocol.d.ts +125 -0
  110. package/lib/common/problem-matcher-protocol.d.ts.map +1 -0
  111. package/lib/common/problem-matcher-protocol.js +133 -0
  112. package/lib/common/problem-matcher-protocol.js.map +1 -0
  113. package/lib/common/process/task-protocol.d.ts +69 -0
  114. package/lib/common/process/task-protocol.d.ts.map +1 -0
  115. package/lib/common/process/task-protocol.js +34 -0
  116. package/lib/common/process/task-protocol.js.map +1 -0
  117. package/lib/common/task-common-module.d.ts +8 -0
  118. package/lib/common/task-common-module.d.ts.map +1 -0
  119. package/lib/common/task-common-module.js +29 -0
  120. package/lib/common/task-common-module.js.map +1 -0
  121. package/lib/common/task-preferences.d.ts +6 -0
  122. package/lib/common/task-preferences.d.ts.map +1 -0
  123. package/lib/common/task-preferences.js +41 -0
  124. package/lib/common/task-preferences.js.map +1 -0
  125. package/lib/common/task-protocol.d.ts +194 -0
  126. package/lib/common/task-protocol.d.ts.map +1 -0
  127. package/lib/common/task-protocol.js +138 -0
  128. package/lib/common/task-protocol.js.map +1 -0
  129. package/lib/common/task-util.d.ts +23 -0
  130. package/lib/common/task-util.d.ts.map +1 -0
  131. package/lib/common/task-util.js +47 -0
  132. package/lib/common/task-util.js.map +1 -0
  133. package/lib/common/task-watcher.d.ts +18 -0
  134. package/lib/common/task-watcher.d.ts.map +1 -0
  135. package/lib/common/task-watcher.js +82 -0
  136. package/lib/common/task-watcher.js.map +1 -0
  137. package/lib/node/custom/custom-task-runner-backend-module.d.ts +3 -0
  138. package/lib/node/custom/custom-task-runner-backend-module.d.ts.map +1 -0
  139. package/lib/node/custom/custom-task-runner-backend-module.js +37 -0
  140. package/lib/node/custom/custom-task-runner-backend-module.js.map +1 -0
  141. package/lib/node/custom/custom-task-runner-contribution.d.ts +7 -0
  142. package/lib/node/custom/custom-task-runner-contribution.d.ts.map +1 -0
  143. package/lib/node/custom/custom-task-runner-contribution.js +35 -0
  144. package/lib/node/custom/custom-task-runner-contribution.js.map +1 -0
  145. package/lib/node/custom/custom-task-runner.d.ts +16 -0
  146. package/lib/node/custom/custom-task-runner.d.ts.map +1 -0
  147. package/lib/node/custom/custom-task-runner.js +62 -0
  148. package/lib/node/custom/custom-task-runner.js.map +1 -0
  149. package/lib/node/custom/custom-task.d.ts +21 -0
  150. package/lib/node/custom/custom-task.d.ts.map +1 -0
  151. package/lib/node/custom/custom-task.js +68 -0
  152. package/lib/node/custom/custom-task.js.map +1 -0
  153. package/lib/node/index.d.ts +4 -0
  154. package/lib/node/index.d.ts.map +1 -0
  155. package/lib/node/index.js +22 -0
  156. package/lib/node/index.js.map +1 -0
  157. package/lib/node/process/process-task-runner-backend-module.d.ts +3 -0
  158. package/lib/node/process/process-task-runner-backend-module.d.ts.map +1 -0
  159. package/lib/node/process/process-task-runner-backend-module.js +37 -0
  160. package/lib/node/process/process-task-runner-backend-module.js.map +1 -0
  161. package/lib/node/process/process-task-runner-contribution.d.ts +7 -0
  162. package/lib/node/process/process-task-runner-contribution.d.ts.map +1 -0
  163. package/lib/node/process/process-task-runner-contribution.js +36 -0
  164. package/lib/node/process/process-task-runner-contribution.js.map +1 -0
  165. package/lib/node/process/process-task-runner.d.ts +61 -0
  166. package/lib/node/process/process-task-runner.d.ts.map +1 -0
  167. package/lib/node/process/process-task-runner.js +348 -0
  168. package/lib/node/process/process-task-runner.js.map +1 -0
  169. package/lib/node/process/process-task.d.ts +27 -0
  170. package/lib/node/process/process-task.d.ts.map +1 -0
  171. package/lib/node/process/process-task.js +125 -0
  172. package/lib/node/process/process-task.js.map +1 -0
  173. package/lib/node/process/process-task.spec.d.ts +2 -0
  174. package/lib/node/process/process-task.spec.d.ts.map +1 -0
  175. package/lib/node/process/process-task.spec.js +30 -0
  176. package/lib/node/process/process-task.spec.js.map +1 -0
  177. package/lib/node/task-abstract-line-matcher.d.ts +50 -0
  178. package/lib/node/task-abstract-line-matcher.d.ts.map +1 -0
  179. package/lib/node/task-abstract-line-matcher.js +274 -0
  180. package/lib/node/task-abstract-line-matcher.js.map +1 -0
  181. package/lib/node/task-backend-application-contribution.d.ts +9 -0
  182. package/lib/node/task-backend-application-contribution.d.ts.map +1 -0
  183. package/lib/node/task-backend-application-contribution.js +41 -0
  184. package/lib/node/task-backend-application-contribution.js.map +1 -0
  185. package/lib/node/task-backend-module.d.ts +4 -0
  186. package/lib/node/task-backend-module.d.ts.map +1 -0
  187. package/lib/node/task-backend-module.js +53 -0
  188. package/lib/node/task-backend-module.js.map +1 -0
  189. package/lib/node/task-line-matchers.d.ts +28 -0
  190. package/lib/node/task-line-matchers.d.ts.map +1 -0
  191. package/lib/node/task-line-matchers.js +122 -0
  192. package/lib/node/task-line-matchers.js.map +1 -0
  193. package/lib/node/task-manager.d.ts +56 -0
  194. package/lib/node/task-manager.d.ts.map +1 -0
  195. package/lib/node/task-manager.js +125 -0
  196. package/lib/node/task-manager.js.map +1 -0
  197. package/lib/node/task-problem-collector.d.ts +11 -0
  198. package/lib/node/task-problem-collector.d.ts.map +1 -0
  199. package/lib/node/task-problem-collector.js +58 -0
  200. package/lib/node/task-problem-collector.js.map +1 -0
  201. package/lib/node/task-problem-collector.spec.d.ts +2 -0
  202. package/lib/node/task-problem-collector.spec.d.ts.map +1 -0
  203. package/lib/node/task-problem-collector.spec.js +311 -0
  204. package/lib/node/task-problem-collector.spec.js.map +1 -0
  205. package/lib/node/task-runner-protocol.d.ts +17 -0
  206. package/lib/node/task-runner-protocol.d.ts.map +1 -0
  207. package/lib/node/task-runner-protocol.js +20 -0
  208. package/lib/node/task-runner-protocol.js.map +1 -0
  209. package/lib/node/task-runner.d.ts +51 -0
  210. package/lib/node/task-runner.d.ts.map +1 -0
  211. package/lib/node/task-runner.js +90 -0
  212. package/lib/node/task-runner.js.map +1 -0
  213. package/lib/node/task-server.d.ts +40 -0
  214. package/lib/node/task-server.d.ts.map +1 -0
  215. package/lib/node/task-server.js +232 -0
  216. package/lib/node/task-server.js.map +1 -0
  217. package/lib/node/task-server.slow-spec.d.ts +2 -0
  218. package/lib/node/task-server.slow-spec.d.ts.map +1 -0
  219. package/lib/node/task-server.slow-spec.js +395 -0
  220. package/lib/node/task-server.slow-spec.js.map +1 -0
  221. package/lib/node/task.d.ts +51 -0
  222. package/lib/node/task.d.ts.map +1 -0
  223. package/lib/node/task.js +73 -0
  224. package/lib/node/task.js.map +1 -0
  225. package/lib/node/test/task-test-container.d.ts +3 -0
  226. package/lib/node/test/task-test-container.d.ts.map +1 -0
  227. package/lib/node/test/task-test-container.js +59 -0
  228. package/lib/node/test/task-test-container.js.map +1 -0
  229. package/package.json +12 -12
@@ -0,0 +1,7 @@
1
+ export * from './task-service';
2
+ export * from './task-contribution';
3
+ export * from './task-definition-registry';
4
+ export * from './task-problem-matcher-registry';
5
+ export * from './task-problem-pattern-registry';
6
+ export * from './task-schema-updater';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAgBA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2017 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
+ const tslib_1 = require("tslib");
19
+ tslib_1.__exportStar(require("./task-service"), exports);
20
+ tslib_1.__exportStar(require("./task-contribution"), exports);
21
+ tslib_1.__exportStar(require("./task-definition-registry"), exports);
22
+ tslib_1.__exportStar(require("./task-problem-matcher-registry"), exports);
23
+ tslib_1.__exportStar(require("./task-problem-pattern-registry"), exports);
24
+ tslib_1.__exportStar(require("./task-schema-updater"), exports);
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.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,yDAA+B;AAC/B,8DAAoC;AACpC,qEAA2C;AAC3C,0EAAgD;AAChD,0EAAgD;AAChD,gEAAsC"}
@@ -0,0 +1,7 @@
1
+ import { ProcessTaskResolver } from './process-task-resolver';
2
+ import { TaskContribution, TaskResolverRegistry } from '../task-contribution';
3
+ export declare class ProcessTaskContribution implements TaskContribution {
4
+ protected readonly processTaskResolver: ProcessTaskResolver;
5
+ registerResolvers(resolvers: TaskResolverRegistry): void;
6
+ }
7
+ //# sourceMappingURL=process-task-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-task-contribution.d.ts","sourceRoot":"","sources":["../../../src/browser/process/process-task-contribution.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE9E,qBACa,uBAAwB,YAAW,gBAAgB;IAG5D,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAE5D,iBAAiB,CAAC,SAAS,EAAE,oBAAoB,GAAG,IAAI;CAI3D"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 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.ProcessTaskContribution = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const process_task_resolver_1 = require("./process-task-resolver");
22
+ let ProcessTaskContribution = class ProcessTaskContribution {
23
+ registerResolvers(resolvers) {
24
+ resolvers.registerExecutionResolver('process', this.processTaskResolver);
25
+ resolvers.registerExecutionResolver('shell', this.processTaskResolver);
26
+ }
27
+ };
28
+ exports.ProcessTaskContribution = ProcessTaskContribution;
29
+ tslib_1.__decorate([
30
+ (0, inversify_1.inject)(process_task_resolver_1.ProcessTaskResolver),
31
+ tslib_1.__metadata("design:type", process_task_resolver_1.ProcessTaskResolver)
32
+ ], ProcessTaskContribution.prototype, "processTaskResolver", void 0);
33
+ exports.ProcessTaskContribution = ProcessTaskContribution = tslib_1.__decorate([
34
+ (0, inversify_1.injectable)()
35
+ ], ProcessTaskContribution);
36
+ //# sourceMappingURL=process-task-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-task-contribution.js","sourceRoot":"","sources":["../../../src/browser/process/process-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,4DAAkE;AAClE,mEAA8D;AAIvD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAKhC,iBAAiB,CAAC,SAA+B;QAC7C,SAAS,CAAC,yBAAyB,CAAC,SAAS,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACzE,SAAS,CAAC,yBAAyB,CAAC,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC3E,CAAC;CACJ,CAAA;AATY,0DAAuB;AAGb;IADlB,IAAA,kBAAM,EAAC,2CAAmB,CAAC;sCACY,2CAAmB;oEAAC;kCAHnD,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CASnC"}
@@ -0,0 +1,3 @@
1
+ import { interfaces } from '@theia/core/shared/inversify';
2
+ export declare function bindProcessTaskModule(bind: interfaces.Bind): void;
3
+ //# sourceMappingURL=process-task-frontend-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-task-frontend-module.d.ts","sourceRoot":"","sources":["../../../src/browser/process/process-task-frontend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAK1D,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAKjE"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 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.bindProcessTaskModule = void 0;
19
+ const process_task_contribution_1 = require("./process-task-contribution");
20
+ const process_task_resolver_1 = require("./process-task-resolver");
21
+ const task_contribution_1 = require("../task-contribution");
22
+ function bindProcessTaskModule(bind) {
23
+ bind(process_task_resolver_1.ProcessTaskResolver).toSelf().inSingletonScope();
24
+ bind(process_task_contribution_1.ProcessTaskContribution).toSelf().inSingletonScope();
25
+ bind(task_contribution_1.TaskContribution).toService(process_task_contribution_1.ProcessTaskContribution);
26
+ }
27
+ exports.bindProcessTaskModule = bindProcessTaskModule;
28
+ //# sourceMappingURL=process-task-frontend-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-task-frontend-module.js","sourceRoot":"","sources":["../../../src/browser/process/process-task-frontend-module.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;;;AAGhF,2EAAsE;AACtE,mEAA8D;AAC9D,4DAAwD;AAExD,SAAgB,qBAAqB,CAAC,IAAqB;IAEvD,IAAI,CAAC,2CAAmB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACtD,IAAI,CAAC,mDAAuB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC1D,IAAI,CAAC,oCAAgB,CAAC,CAAC,SAAS,CAAC,mDAAuB,CAAC,CAAC;AAC9D,CAAC;AALD,sDAKC"}
@@ -0,0 +1,18 @@
1
+ import { VariableResolverService } from '@theia/variable-resolver/lib/browser';
2
+ import { TaskResolver } from '../task-contribution';
3
+ import { TaskConfiguration } from '../../common/task-protocol';
4
+ import { TaskDefinitionRegistry } from '../task-definition-registry';
5
+ import { WorkspaceService } from '@theia/workspace/lib/browser';
6
+ export declare class ProcessTaskResolver implements TaskResolver {
7
+ protected readonly variableResolverService: VariableResolverService;
8
+ protected readonly taskDefinitionRegistry: TaskDefinitionRegistry;
9
+ protected readonly workspaceService: WorkspaceService;
10
+ /**
11
+ * Perform some adjustments to the task launch configuration, before sending
12
+ * it to the backend to be executed. We can make sure that parameters that
13
+ * are optional to the user but required by the server will be defined, with
14
+ * sane default values. Also, resolve all known variables, e.g. `${workspaceFolder}`.
15
+ */
16
+ resolveTask(taskConfig: TaskConfiguration): Promise<TaskConfiguration>;
17
+ }
18
+ //# sourceMappingURL=process-task-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-task-resolver.d.ts","sourceRoot":"","sources":["../../../src/browser/process/process-task-resolver.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,qBACa,mBAAoB,YAAW,YAAY;IAGpD,SAAS,CAAC,QAAQ,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAGpE,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IAGlE,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAEtD;;;;;OAKG;IACG,WAAW,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;CA6C/E"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 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.ProcessTaskResolver = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const browser_1 = require("@theia/variable-resolver/lib/browser");
22
+ const task_definition_registry_1 = require("../task-definition-registry");
23
+ const uri_1 = require("@theia/core/lib/common/uri");
24
+ const browser_2 = require("@theia/workspace/lib/browser");
25
+ let ProcessTaskResolver = class ProcessTaskResolver {
26
+ /**
27
+ * Perform some adjustments to the task launch configuration, before sending
28
+ * it to the backend to be executed. We can make sure that parameters that
29
+ * are optional to the user but required by the server will be defined, with
30
+ * sane default values. Also, resolve all known variables, e.g. `${workspaceFolder}`.
31
+ */
32
+ async resolveTask(taskConfig) {
33
+ var _a;
34
+ const type = taskConfig.executionType || taskConfig.type;
35
+ if (type !== 'process' && type !== 'shell') {
36
+ throw new Error('Unsupported task configuration type.');
37
+ }
38
+ const context = typeof taskConfig._scope === 'string' ? new uri_1.default(taskConfig._scope) : undefined;
39
+ const variableResolverOptions = {
40
+ context, configurationSection: 'tasks'
41
+ };
42
+ const processTaskConfig = taskConfig;
43
+ let cwd = processTaskConfig.options && processTaskConfig.options.cwd;
44
+ if (!cwd) {
45
+ const rootURI = this.workspaceService.getWorkspaceRootUri(context);
46
+ if (rootURI) {
47
+ cwd = rootURI.toString();
48
+ }
49
+ }
50
+ const result = {
51
+ ...processTaskConfig,
52
+ command: await this.variableResolverService.resolve(processTaskConfig.command, variableResolverOptions),
53
+ args: processTaskConfig.args ? await this.variableResolverService.resolve(processTaskConfig.args, variableResolverOptions) : undefined,
54
+ windows: processTaskConfig.windows ? {
55
+ command: await this.variableResolverService.resolve(processTaskConfig.windows.command, variableResolverOptions),
56
+ args: processTaskConfig.windows.args ? await this.variableResolverService.resolve(processTaskConfig.windows.args, variableResolverOptions) : undefined,
57
+ options: processTaskConfig.windows.options
58
+ } : undefined,
59
+ osx: processTaskConfig.osx ? {
60
+ command: await this.variableResolverService.resolve(processTaskConfig.osx.command, variableResolverOptions),
61
+ args: processTaskConfig.osx.args ? await this.variableResolverService.resolve(processTaskConfig.osx.args, variableResolverOptions) : undefined,
62
+ options: processTaskConfig.osx.options
63
+ } : undefined,
64
+ linux: processTaskConfig.linux ? {
65
+ command: await this.variableResolverService.resolve(processTaskConfig.linux.command, variableResolverOptions),
66
+ args: processTaskConfig.linux.args ? await this.variableResolverService.resolve(processTaskConfig.linux.args, variableResolverOptions) : undefined,
67
+ options: processTaskConfig.linux.options
68
+ } : undefined,
69
+ options: {
70
+ cwd: await this.variableResolverService.resolve(cwd, variableResolverOptions),
71
+ env: ((_a = processTaskConfig.options) === null || _a === void 0 ? void 0 : _a.env) && await this.variableResolverService.resolve(processTaskConfig.options.env, variableResolverOptions),
72
+ shell: processTaskConfig.options && processTaskConfig.options.shell
73
+ }
74
+ };
75
+ return result;
76
+ }
77
+ };
78
+ exports.ProcessTaskResolver = ProcessTaskResolver;
79
+ tslib_1.__decorate([
80
+ (0, inversify_1.inject)(browser_1.VariableResolverService),
81
+ tslib_1.__metadata("design:type", browser_1.VariableResolverService)
82
+ ], ProcessTaskResolver.prototype, "variableResolverService", void 0);
83
+ tslib_1.__decorate([
84
+ (0, inversify_1.inject)(task_definition_registry_1.TaskDefinitionRegistry),
85
+ tslib_1.__metadata("design:type", task_definition_registry_1.TaskDefinitionRegistry)
86
+ ], ProcessTaskResolver.prototype, "taskDefinitionRegistry", void 0);
87
+ tslib_1.__decorate([
88
+ (0, inversify_1.inject)(browser_2.WorkspaceService),
89
+ tslib_1.__metadata("design:type", browser_2.WorkspaceService)
90
+ ], ProcessTaskResolver.prototype, "workspaceService", void 0);
91
+ exports.ProcessTaskResolver = ProcessTaskResolver = tslib_1.__decorate([
92
+ (0, inversify_1.injectable)()
93
+ ], ProcessTaskResolver);
94
+ //# sourceMappingURL=process-task-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-task-resolver.js","sourceRoot":"","sources":["../../../src/browser/process/process-task-resolver.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,4DAAkE;AAClE,kEAA+E;AAI/E,0EAAqE;AACrE,oDAA6C;AAC7C,0DAAgE;AAGzD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAW5B;;;;;OAKG;IACH,KAAK,CAAC,WAAW,CAAC,UAA6B;;QAC3C,MAAM,IAAI,GAAG,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,IAAI,CAAC;QACzD,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,OAAO,EAAE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OAAO,0CAAE,GAAG,KAAI,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,GAAG,EAAE,uBAAuB,CAAC;gBACzI,KAAK,EAAE,iBAAiB,CAAC,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,KAAK;aACtE;SACJ,CAAC;QACF,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;AA9DY,kDAAmB;AAGT;IADlB,IAAA,kBAAM,EAAC,iCAAuB,CAAC;sCACY,iCAAuB;oEAAC;AAGjD;IADlB,IAAA,kBAAM,EAAC,iDAAsB,CAAC;sCACY,iDAAsB;mEAAC;AAG/C;IADlB,IAAA,kBAAM,EAAC,0BAAgB,CAAC;sCACY,0BAAgB;6DAAC;8BAT7C,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;GACA,mBAAmB,CA8D/B"}
@@ -0,0 +1,44 @@
1
+ import { TaskProviderRegistry, TaskProvider } from './task-contribution';
2
+ import { TaskDefinitionRegistry } from './task-definition-registry';
3
+ import { TaskConfiguration, TaskCustomization, TaskConfigurationScope } from '../common';
4
+ export declare const ALL_TASK_TYPES: string;
5
+ export declare class ProvidedTaskConfigurations {
6
+ /**
7
+ * Map of source (name of extension, or path of root folder that the task config comes from) and `task config map`.
8
+ * For the second level of inner map, the key is task label.
9
+ * For the third level of inner map, the key is the task scope and value TaskConfiguration.
10
+ */
11
+ protected tasksMap: Map<string, Map<string, Map<string | undefined, TaskConfiguration>>>;
12
+ protected readonly taskProviderRegistry: TaskProviderRegistry;
13
+ protected readonly taskDefinitionRegistry: TaskDefinitionRegistry;
14
+ private currentToken;
15
+ private activatedProvidersTypes;
16
+ private nextToken;
17
+ startUserAction(): number;
18
+ protected updateUserAction(token: number): void;
19
+ protected pushActivatedProvidersType(taskType: string): void;
20
+ protected isTaskProviderActivationNeeded(taskType?: string): boolean;
21
+ /**
22
+ * Activate providers for the given taskType
23
+ * @param taskType A specific task type or '*' to indicate all task providers
24
+ */
25
+ protected activateProviders(taskType?: string): Promise<void>;
26
+ /** returns a list of provided tasks matching an optional given type, or all if '*' is used */
27
+ getTasks(token: number, type?: string): Promise<TaskConfiguration[]>;
28
+ protected refreshTasks(token: number, taskType?: string): Promise<void>;
29
+ protected resolveTaskConfigurations(taskProvider: TaskProvider): Promise<TaskConfiguration[]>;
30
+ /** returns the task configuration for a given source and label or undefined if none */
31
+ getTask(token: number, source: string, taskLabel: string, scope: TaskConfigurationScope): Promise<TaskConfiguration | undefined>;
32
+ /**
33
+ * Finds the detected task for the given task customization.
34
+ * The detected task is considered as a "match" to the task customization if it has all the `required` properties.
35
+ * In case that more than one customization is found, return the one that has the biggest number of matched properties.
36
+ *
37
+ * @param customization the task customization
38
+ * @return the detected task for the given task customization. If the task customization is not found, `undefined` is returned.
39
+ */
40
+ getTaskToCustomize(token: number, customization: TaskCustomization, scope: TaskConfigurationScope): Promise<TaskConfiguration | undefined>;
41
+ protected getCachedTask(source: string, taskLabel: string, scope?: TaskConfigurationScope): TaskConfiguration | undefined;
42
+ protected cacheTasks(tasks: TaskConfiguration[]): void;
43
+ }
44
+ //# sourceMappingURL=provided-task-configurations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provided-task-configurations.d.ts","sourceRoot":"","sources":["../../src/browser/provided-task-configurations.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAA0B,sBAAsB,EAAa,MAAM,WAAW,CAAC;AAE5H,eAAO,MAAM,cAAc,EAAE,MAAY,CAAC;AAE1C,qBACa,0BAA0B;IACnC;;;;OAIG;IACH,SAAS,CAAC,QAAQ,uEAA8E;IAGhG,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAG9D,SAAS,CAAC,QAA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CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,IAAI;CAwBzD"}
@@ -0,0 +1,206 @@
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.ProvidedTaskConfigurations = exports.ALL_TASK_TYPES = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const task_contribution_1 = require("./task-contribution");
22
+ const task_definition_registry_1 = require("./task-definition-registry");
23
+ const common_1 = require("../common");
24
+ exports.ALL_TASK_TYPES = '*';
25
+ let ProvidedTaskConfigurations = class ProvidedTaskConfigurations {
26
+ constructor() {
27
+ /**
28
+ * Map of source (name of extension, or path of root folder that the task config comes from) and `task config map`.
29
+ * For the second level of inner map, the key is task label.
30
+ * For the third level of inner map, the key is the task scope and value TaskConfiguration.
31
+ */
32
+ this.tasksMap = new Map();
33
+ this.currentToken = 0;
34
+ this.activatedProvidersTypes = [];
35
+ this.nextToken = 1;
36
+ }
37
+ startUserAction() {
38
+ return this.nextToken++;
39
+ }
40
+ updateUserAction(token) {
41
+ if (this.currentToken !== token) {
42
+ this.currentToken = token;
43
+ this.activatedProvidersTypes.length = 0;
44
+ }
45
+ }
46
+ pushActivatedProvidersType(taskType) {
47
+ if (!this.activatedProvidersTypes.includes(taskType)) {
48
+ this.activatedProvidersTypes.push(taskType);
49
+ }
50
+ }
51
+ isTaskProviderActivationNeeded(taskType) {
52
+ if (!taskType || this.activatedProvidersTypes.includes(taskType) || this.activatedProvidersTypes.includes(exports.ALL_TASK_TYPES)) {
53
+ return false;
54
+ }
55
+ return true;
56
+ }
57
+ /**
58
+ * Activate providers for the given taskType
59
+ * @param taskType A specific task type or '*' to indicate all task providers
60
+ */
61
+ async activateProviders(taskType) {
62
+ if (!!taskType) {
63
+ await this.taskProviderRegistry.activateProvider(taskType);
64
+ this.pushActivatedProvidersType(taskType);
65
+ }
66
+ }
67
+ /** returns a list of provided tasks matching an optional given type, or all if '*' is used */
68
+ async getTasks(token, type) {
69
+ await this.refreshTasks(token, type);
70
+ const tasks = [];
71
+ for (const taskLabelMap of this.tasksMap.values()) {
72
+ for (const taskScopeMap of taskLabelMap.values()) {
73
+ for (const task of taskScopeMap.values()) {
74
+ if (!type || task.type === type || type === exports.ALL_TASK_TYPES) {
75
+ tasks.push(task);
76
+ }
77
+ }
78
+ }
79
+ }
80
+ return tasks;
81
+ }
82
+ async refreshTasks(token, taskType) {
83
+ const newProviderActivationNeeded = this.isTaskProviderActivationNeeded(taskType);
84
+ if (token !== this.currentToken || newProviderActivationNeeded) {
85
+ this.updateUserAction(token);
86
+ await this.activateProviders(taskType);
87
+ const providers = await this.taskProviderRegistry.getProviders();
88
+ const providedTasks = (await Promise.all(providers.map(p => this.resolveTaskConfigurations(p))))
89
+ .reduce((acc, taskArray) => acc.concat(taskArray), []);
90
+ this.cacheTasks(providedTasks);
91
+ }
92
+ }
93
+ async resolveTaskConfigurations(taskProvider) {
94
+ return (await taskProvider.provideTasks())
95
+ // Global/User tasks from providers are not supported.
96
+ .filter(task => task.scope !== common_1.TaskScope.Global)
97
+ .map(providedTask => {
98
+ const originalPresentation = providedTask.presentation || {};
99
+ return {
100
+ ...providedTask,
101
+ presentation: {
102
+ ...common_1.TaskOutputPresentation.getDefault(),
103
+ ...originalPresentation
104
+ }
105
+ };
106
+ });
107
+ }
108
+ /** returns the task configuration for a given source and label or undefined if none */
109
+ async getTask(token, source, taskLabel, scope) {
110
+ await this.refreshTasks(token);
111
+ return this.getCachedTask(source, taskLabel, scope);
112
+ }
113
+ /**
114
+ * Finds the detected task for the given task customization.
115
+ * The detected task is considered as a "match" to the task customization if it has all the `required` properties.
116
+ * In case that more than one customization is found, return the one that has the biggest number of matched properties.
117
+ *
118
+ * @param customization the task customization
119
+ * @return the detected task for the given task customization. If the task customization is not found, `undefined` is returned.
120
+ */
121
+ async getTaskToCustomize(token, customization, scope) {
122
+ const definition = this.taskDefinitionRegistry.getDefinition(customization);
123
+ if (!definition) {
124
+ return undefined;
125
+ }
126
+ const matchedTasks = [];
127
+ let highest = -1;
128
+ const tasks = await this.getTasks(token, customization.type);
129
+ for (const task of tasks) { // find detected tasks that match the `definition`
130
+ const required = definition.properties.required || [];
131
+ if (!required.every(requiredProp => customization[requiredProp] !== undefined)) {
132
+ continue;
133
+ }
134
+ let score = required.length; // number of required properties
135
+ const requiredProps = new Set(required);
136
+ // number of optional properties
137
+ score += definition.properties.all.filter(p => !requiredProps.has(p) && customization[p] !== undefined).length;
138
+ if (score >= highest) {
139
+ if (score > highest) {
140
+ highest = score;
141
+ matchedTasks.length = 0;
142
+ }
143
+ matchedTasks.push(task);
144
+ }
145
+ }
146
+ // Tasks with scope set to 'Workspace' can be customized in a workspace root, and will not match
147
+ // providers scope 'TaskScope.Workspace' unless specifically included as below.
148
+ const scopes = [scope, common_1.TaskScope.Workspace];
149
+ // find the task that matches the `customization`.
150
+ // The scenario where more than one match is found should not happen unless users manually enter multiple customizations for one type of task
151
+ // If this does happen, return the first match
152
+ const matchedTask = matchedTasks.find(t => scopes.some(scp => scp === t._scope) && definition.properties.all.every(p => t[p] === customization[p]));
153
+ return matchedTask;
154
+ }
155
+ getCachedTask(source, taskLabel, scope) {
156
+ const labelConfigMap = this.tasksMap.get(source);
157
+ if (labelConfigMap) {
158
+ const scopeConfigMap = labelConfigMap.get(taskLabel);
159
+ if (scopeConfigMap) {
160
+ if (scope) {
161
+ return scopeConfigMap.get(scope.toString());
162
+ }
163
+ return Array.from(scopeConfigMap.values())[0];
164
+ }
165
+ }
166
+ }
167
+ cacheTasks(tasks) {
168
+ this.tasksMap.clear();
169
+ for (const task of tasks) {
170
+ const label = task.label;
171
+ const source = task._source;
172
+ const scope = task._scope;
173
+ if (this.tasksMap.has(source)) {
174
+ const labelConfigMap = this.tasksMap.get(source);
175
+ if (labelConfigMap.has(label)) {
176
+ labelConfigMap.get(label).set(scope.toString(), task);
177
+ }
178
+ else {
179
+ const newScopeConfigMap = new Map();
180
+ newScopeConfigMap.set(scope.toString(), task);
181
+ labelConfigMap.set(label, newScopeConfigMap);
182
+ }
183
+ }
184
+ else {
185
+ const newLabelConfigMap = new Map();
186
+ const newScopeConfigMap = new Map();
187
+ newScopeConfigMap.set(scope.toString(), task);
188
+ newLabelConfigMap.set(label, newScopeConfigMap);
189
+ this.tasksMap.set(source, newLabelConfigMap);
190
+ }
191
+ }
192
+ }
193
+ };
194
+ exports.ProvidedTaskConfigurations = ProvidedTaskConfigurations;
195
+ tslib_1.__decorate([
196
+ (0, inversify_1.inject)(task_contribution_1.TaskProviderRegistry),
197
+ tslib_1.__metadata("design:type", task_contribution_1.TaskProviderRegistry)
198
+ ], ProvidedTaskConfigurations.prototype, "taskProviderRegistry", void 0);
199
+ tslib_1.__decorate([
200
+ (0, inversify_1.inject)(task_definition_registry_1.TaskDefinitionRegistry),
201
+ tslib_1.__metadata("design:type", task_definition_registry_1.TaskDefinitionRegistry)
202
+ ], ProvidedTaskConfigurations.prototype, "taskDefinitionRegistry", void 0);
203
+ exports.ProvidedTaskConfigurations = ProvidedTaskConfigurations = tslib_1.__decorate([
204
+ (0, inversify_1.injectable)()
205
+ ], ProvidedTaskConfigurations);
206
+ //# sourceMappingURL=provided-task-configurations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provided-task-configurations.js","sourceRoot":"","sources":["../../src/browser/provided-task-configurations.ts"],"names":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.spec.d.ts","sourceRoot":"","sources":["../../src/browser/provided-task-configurations.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2019 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
+ const chai_1 = require("chai");
19
+ const inversify_1 = require("@theia/core/shared/inversify");
20
+ const provided_task_configurations_1 = require("./provided-task-configurations");
21
+ const task_definition_registry_1 = require("./task-definition-registry");
22
+ const task_contribution_1 = require("./task-contribution");
23
+ describe('provided-task-configurations', () => {
24
+ let container;
25
+ beforeEach(() => {
26
+ container = new inversify_1.Container();
27
+ container.bind(provided_task_configurations_1.ProvidedTaskConfigurations).toSelf().inSingletonScope();
28
+ container.bind(task_contribution_1.TaskProviderRegistry).toSelf().inSingletonScope();
29
+ container.bind(task_definition_registry_1.TaskDefinitionRegistry).toSelf().inSingletonScope();
30
+ });
31
+ it('provided-task-search', async () => {
32
+ const providerRegistry = container.get(task_contribution_1.TaskProviderRegistry);
33
+ providerRegistry.register('test', {
34
+ provideTasks() {
35
+ return Promise.resolve([{ type: 'test', label: 'task from test', _source: 'test', _scope: 'test' }]);
36
+ }
37
+ });
38
+ const task = await container.get(provided_task_configurations_1.ProvidedTaskConfigurations).getTask(1, 'test', 'task from test', 'test');
39
+ chai_1.assert.isOk(task);
40
+ chai_1.assert.equal(task.type, 'test');
41
+ chai_1.assert.equal(task.label, 'task from test');
42
+ });
43
+ });
44
+ //# sourceMappingURL=provided-task-configurations.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provided-task-configurations.spec.js","sourceRoot":"","sources":["../../src/browser/provided-task-configurations.spec.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,+BAA8B;AAC9B,4DAAyD;AACzD,iFAA4E;AAC5E,yEAAoE;AACpE,2DAA2D;AAG3D,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC1C,IAAI,SAAoB,CAAC;IACzB,UAAU,CAAC,GAAG,EAAE;QACZ,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;QAC5B,SAAS,CAAC,IAAI,CAAC,yDAA0B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACvE,SAAS,CAAC,IAAI,CAAC,wCAAoB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACjE,SAAS,CAAC,IAAI,CAAC,iDAAsB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,gBAAgB,GAAG,SAAS,CAAC,GAAG,CAAC,wCAAoB,CAAC,CAAC;QAC7D,gBAAgB,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC9B,YAAY;gBACR,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,M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