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

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,274 @@
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.AbstractLineMatcher = void 0;
19
+ /*---------------------------------------------------------------------------------------------
20
+ * Copyright (c) Microsoft Corporation. All rights reserved.
21
+ * Licensed under the MIT License. See License.txt in the project root for license information.
22
+ *--------------------------------------------------------------------------------------------*/
23
+ const os_1 = require("@theia/core/lib/common/os");
24
+ const vscode_languageserver_protocol_1 = require("@theia/core/shared/vscode-languageserver-protocol");
25
+ const problem_matcher_protocol_1 = require("../common/problem-matcher-protocol");
26
+ const uri_1 = require("@theia/core/lib/common/uri");
27
+ const severity_1 = require("@theia/core/lib/common/severity");
28
+ const numbers_1 = require("@theia/core/lib/common/numbers");
29
+ const path_1 = require("path");
30
+ const endOfLine = os_1.EOL;
31
+ class AbstractLineMatcher {
32
+ constructor(matcher) {
33
+ this.matcher = matcher;
34
+ this.patterns = [];
35
+ this.activePatternIndex = 0;
36
+ if (Array.isArray(matcher.pattern)) {
37
+ this.patterns = matcher.pattern;
38
+ }
39
+ else {
40
+ this.patterns = [matcher.pattern];
41
+ }
42
+ this.cachedProblemData = this.getEmptyProblemData();
43
+ if (this.patterns.slice(0, this.patternCount - 1).some(p => !!p.loop)) {
44
+ console.error('Problem Matcher: Only the last pattern can loop');
45
+ }
46
+ }
47
+ /**
48
+ * Number of problem patterns that the line matcher uses.
49
+ */
50
+ get patternCount() {
51
+ return this.patterns.length;
52
+ }
53
+ getEmptyProblemData() {
54
+ // eslint-disable-next-line no-null/no-null
55
+ return Object.create(null);
56
+ }
57
+ fillProblemData(data, pattern, matches) {
58
+ if (data) {
59
+ this.fillProperty(data, 'file', pattern, matches, true);
60
+ this.appendProperty(data, 'message', pattern, matches, true);
61
+ this.fillProperty(data, 'code', pattern, matches, true);
62
+ this.fillProperty(data, 'severity', pattern, matches, true);
63
+ this.fillProperty(data, 'location', pattern, matches, true);
64
+ this.fillProperty(data, 'line', pattern, matches);
65
+ this.fillProperty(data, 'character', pattern, matches);
66
+ this.fillProperty(data, 'endLine', pattern, matches);
67
+ this.fillProperty(data, 'endCharacter', pattern, matches);
68
+ return true;
69
+ }
70
+ return false;
71
+ }
72
+ appendProperty(data, property, pattern, matches, trim = false) {
73
+ const patternProperty = pattern[property];
74
+ if (data[property] === undefined) {
75
+ this.fillProperty(data, property, pattern, matches, trim);
76
+ }
77
+ else if (patternProperty !== undefined && patternProperty < matches.length) {
78
+ let value = matches[patternProperty];
79
+ if (trim) {
80
+ value = value.trim();
81
+ }
82
+ data[property] += endOfLine + value;
83
+ }
84
+ }
85
+ fillProperty(data, property, pattern, matches, trim = false) {
86
+ const patternAtProperty = pattern[property];
87
+ if (data[property] === undefined && patternAtProperty !== undefined && patternAtProperty < matches.length) {
88
+ let value = matches[patternAtProperty];
89
+ if (value !== undefined) {
90
+ if (trim) {
91
+ value = value.trim();
92
+ }
93
+ data[property] = value;
94
+ }
95
+ }
96
+ }
97
+ getMarkerMatch(data) {
98
+ try {
99
+ const location = this.getLocation(data);
100
+ if (data.file && location && data.message) {
101
+ const marker = {
102
+ severity: this.getSeverity(data),
103
+ range: location,
104
+ message: data.message
105
+ };
106
+ if (data.code !== undefined) {
107
+ marker.code = data.code;
108
+ }
109
+ if (this.matcher.source !== undefined) {
110
+ marker.source = this.matcher.source;
111
+ }
112
+ return {
113
+ description: this.matcher,
114
+ resource: this.getResource(data.file, this.matcher),
115
+ marker
116
+ };
117
+ }
118
+ return {
119
+ description: this.matcher
120
+ };
121
+ }
122
+ catch (err) {
123
+ console.error(`Failed to convert problem data into match: ${JSON.stringify(data)}`);
124
+ }
125
+ return undefined;
126
+ }
127
+ getLocation(data) {
128
+ if (data.kind === problem_matcher_protocol_1.ProblemLocationKind.File) {
129
+ return this.createRange(0, 0, 0, 0);
130
+ }
131
+ if (data.location) {
132
+ return this.parseLocationInfo(data.location);
133
+ }
134
+ if (!data.line) {
135
+ // eslint-disable-next-line no-null/no-null
136
+ return null;
137
+ }
138
+ const startLine = parseInt(data.line);
139
+ const startColumn = data.character ? parseInt(data.character) : undefined;
140
+ const endLine = data.endLine ? parseInt(data.endLine) : undefined;
141
+ const endColumn = data.endCharacter ? parseInt(data.endCharacter) : undefined;
142
+ return this.createRange(startLine, startColumn, endLine, endColumn);
143
+ }
144
+ parseLocationInfo(value) {
145
+ if (!value || !value.match(/(\d+|\d+,\d+|\d+,\d+,\d+,\d+)/)) {
146
+ // eslint-disable-next-line no-null/no-null
147
+ return null;
148
+ }
149
+ const parts = value.split(',');
150
+ const startLine = parseInt(parts[0]);
151
+ const startColumn = parts.length > 1 ? parseInt(parts[1]) : undefined;
152
+ if (parts.length > 3) {
153
+ return this.createRange(startLine, startColumn, parseInt(parts[2]), parseInt(parts[3]));
154
+ }
155
+ else {
156
+ return this.createRange(startLine, startColumn, undefined, undefined);
157
+ }
158
+ }
159
+ createRange(startLine, startColumn, endLine, endColumn) {
160
+ let range;
161
+ if (startColumn !== undefined) {
162
+ if (endColumn !== undefined) {
163
+ range = vscode_languageserver_protocol_1.Range.create(startLine, startColumn, endLine || startLine, endColumn);
164
+ }
165
+ else {
166
+ range = vscode_languageserver_protocol_1.Range.create(startLine, startColumn, startLine, startColumn);
167
+ }
168
+ }
169
+ else {
170
+ range = vscode_languageserver_protocol_1.Range.create(startLine, 1, startLine, numbers_1.MAX_SAFE_INTEGER);
171
+ }
172
+ // range indexes should be zero-based
173
+ return vscode_languageserver_protocol_1.Range.create(this.getZeroBasedRangeIndex(range.start.line), this.getZeroBasedRangeIndex(range.start.character), this.getZeroBasedRangeIndex(range.end.line), this.getZeroBasedRangeIndex(range.end.character));
174
+ }
175
+ getZeroBasedRangeIndex(ind) {
176
+ return ind === 0 ? ind : ind - 1;
177
+ }
178
+ getSeverity(data) {
179
+ // eslint-disable-next-line no-null/no-null
180
+ let result = null;
181
+ if (data.severity) {
182
+ const value = data.severity;
183
+ if (value) {
184
+ result = severity_1.Severity.fromValue(value);
185
+ if (result === severity_1.Severity.Ignore) {
186
+ if (value === 'E') {
187
+ result = severity_1.Severity.Error;
188
+ }
189
+ else if (value === 'W') {
190
+ result = severity_1.Severity.Warning;
191
+ }
192
+ else if (value === 'I') {
193
+ result = severity_1.Severity.Info;
194
+ }
195
+ else if (value.toLowerCase() === 'hint') {
196
+ result = severity_1.Severity.Info;
197
+ }
198
+ else if (value.toLowerCase() === 'note') {
199
+ result = severity_1.Severity.Info;
200
+ }
201
+ }
202
+ }
203
+ }
204
+ // eslint-disable-next-line no-null/no-null
205
+ if (result === null || result === severity_1.Severity.Ignore) {
206
+ result = this.matcher.severity || severity_1.Severity.Error;
207
+ }
208
+ return severity_1.Severity.toDiagnosticSeverity(result);
209
+ }
210
+ getResource(filename, matcher) {
211
+ const kind = matcher.fileLocation;
212
+ let fullPath;
213
+ if (kind === problem_matcher_protocol_1.FileLocationKind.Absolute) {
214
+ fullPath = filename;
215
+ }
216
+ else if ((kind === problem_matcher_protocol_1.FileLocationKind.Relative) && matcher.filePrefix) {
217
+ let relativeFileName = filename.replace(/\\/g, '/');
218
+ if (relativeFileName.startsWith('./')) {
219
+ relativeFileName = relativeFileName.slice(2);
220
+ }
221
+ fullPath = (0, path_1.join)(matcher.filePrefix, relativeFileName);
222
+ }
223
+ if (fullPath === undefined) {
224
+ throw new Error('FileLocationKind is not actionable. Does the matcher have a filePrefix? This should never happen.');
225
+ }
226
+ if (matcher.uriProvider !== undefined) {
227
+ return matcher.uriProvider(fullPath);
228
+ }
229
+ else {
230
+ return uri_1.default.fromFilePath(fullPath);
231
+ }
232
+ }
233
+ resetActivePatternIndex(defaultIndex) {
234
+ if (defaultIndex === undefined) {
235
+ defaultIndex = 0;
236
+ }
237
+ this.activePatternIndex = defaultIndex;
238
+ this.activePattern = this.patterns[defaultIndex];
239
+ }
240
+ nextProblemPattern() {
241
+ this.activePatternIndex++;
242
+ if (this.activePatternIndex > this.patternCount - 1) {
243
+ this.resetActivePatternIndex();
244
+ }
245
+ else {
246
+ this.activePattern = this.patterns[this.activePatternIndex];
247
+ }
248
+ }
249
+ doOneLineMatch(line) {
250
+ var _a;
251
+ var _b;
252
+ if (this.activePattern) {
253
+ const regexp = new RegExp(this.activePattern.regexp);
254
+ const regexMatches = regexp.exec(line);
255
+ if (regexMatches) {
256
+ (_a = (_b = this.cachedProblemData).kind) !== null && _a !== void 0 ? _a : (_b.kind = this.activePattern.kind);
257
+ return this.fillProblemData(this.cachedProblemData, this.activePattern, regexMatches);
258
+ }
259
+ }
260
+ return false;
261
+ }
262
+ // check if active pattern is the last pattern
263
+ isUsingTheLastPattern() {
264
+ return this.patternCount > 0 && this.activePatternIndex === this.patternCount - 1;
265
+ }
266
+ isLastPatternLoop() {
267
+ return this.patternCount > 0 && !!this.patterns[this.patternCount - 1].loop;
268
+ }
269
+ resetCachedProblemData() {
270
+ this.cachedProblemData = this.getEmptyProblemData();
271
+ }
272
+ }
273
+ exports.AbstractLineMatcher = AbstractLineMatcher;
274
+ //# sourceMappingURL=task-abstract-line-matcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-abstract-line-matcher.js","sourceRoot":"","sources":["../../src/node/task-abstract-line-matcher.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;;;gGAGgG;AAEhG,kDAAgD;AAChD,sGAA0G;AAC1G,iFAG4C;AAC5C,oDAA6C;AAC7C,8DAA2D;AAC3D,4DAAkE;AAClE,+BAA4B;AAE5B,MAAM,SAAS,GAAW,QAAG,CAAC;AAe9B,MAAsB,mBAAmB;IAOrC,YACc,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;QAN3B,aAAQ,GAAqB,EAAE,CAAC;QAChC,uBAAkB,GAAW,CAAC,CAAC;QAOrC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;QACpC,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,QAAQ,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAEpD,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CA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C,IAAI,CAAC;IAChF,CAAC;IAES,sBAAsB;QAC5B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;IACxD,CAAC;CACJ;AAxQD,kDAwQC"}
@@ -0,0 +1,9 @@
1
+ import { ContributionProvider } from '@theia/core';
2
+ import { BackendApplicationContribution } from '@theia/core/lib/node';
3
+ import { TaskRunnerContribution, TaskRunnerRegistry } from './task-runner';
4
+ export declare class TaskBackendApplicationContribution implements BackendApplicationContribution {
5
+ protected readonly contributionProvider: ContributionProvider<TaskRunnerContribution>;
6
+ protected readonly taskRunnerRegistry: TaskRunnerRegistry;
7
+ onStart(): void;
8
+ }
9
+ //# sourceMappingURL=task-backend-application-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-backend-application-contribution.d.ts","sourceRoot":"","sources":["../../src/node/task-backend-application-contribution.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE3E,qBACa,kCAAmC,YAAW,8BAA8B;IAGrF,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,sBAAsB,CAAC,CAAC;IAGtF,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAE1D,OAAO,IAAI,IAAI;CAKlB"}
@@ -0,0 +1,41 @@
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.TaskBackendApplicationContribution = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const core_1 = require("@theia/core");
22
+ const task_runner_1 = require("./task-runner");
23
+ let TaskBackendApplicationContribution = class TaskBackendApplicationContribution {
24
+ onStart() {
25
+ this.contributionProvider.getContributions().forEach(contrib => contrib.registerRunner(this.taskRunnerRegistry));
26
+ }
27
+ };
28
+ exports.TaskBackendApplicationContribution = TaskBackendApplicationContribution;
29
+ tslib_1.__decorate([
30
+ (0, inversify_1.inject)(core_1.ContributionProvider),
31
+ (0, inversify_1.named)(task_runner_1.TaskRunnerContribution),
32
+ tslib_1.__metadata("design:type", Object)
33
+ ], TaskBackendApplicationContribution.prototype, "contributionProvider", void 0);
34
+ tslib_1.__decorate([
35
+ (0, inversify_1.inject)(task_runner_1.TaskRunnerRegistry),
36
+ tslib_1.__metadata("design:type", task_runner_1.TaskRunnerRegistry)
37
+ ], TaskBackendApplicationContribution.prototype, "taskRunnerRegistry", void 0);
38
+ exports.TaskBackendApplicationContribution = TaskBackendApplicationContribution = tslib_1.__decorate([
39
+ (0, inversify_1.injectable)()
40
+ ], TaskBackendApplicationContribution);
41
+ //# sourceMappingURL=task-backend-application-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-backend-application-contribution.js","sourceRoot":"","sources":["../../src/node/task-backend-application-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;AACzE,sCAAmD;AAEnD,+CAA2E;AAGpE,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAQ3C,OAAO;QACH,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAC3D,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAClD,CAAC;IACN,CAAC;CACJ,CAAA;AAbY,gFAAkC;AAGxB;IADlB,IAAA,kBAAM,EAAC,2BAAoB,CAAC;IAAE,IAAA,iBAAK,EAAC,oCAAsB,CAAC;;gFAC0B;AAGnE;IADlB,IAAA,kBAAM,EAAC,gCAAkB,CAAC;sCACY,gCAAkB;8EAAC;6CANjD,kCAAkC;IAD9C,IAAA,sBAAU,GAAE;GACA,kCAAkC,CAa9C"}
@@ -0,0 +1,4 @@
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
+ //# sourceMappingURL=task-backend-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/task-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAc/D,wBA4BG"}
@@ -0,0 +1,53 @@
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 inversify_1 = require("@theia/core/shared/inversify");
19
+ const core_1 = require("@theia/core");
20
+ const messaging_1 = require("@theia/core/lib/common/messaging");
21
+ const node_1 = require("@theia/core/lib/node");
22
+ const process_task_runner_backend_module_1 = require("./process/process-task-runner-backend-module");
23
+ const custom_task_runner_backend_module_1 = require("./custom/custom-task-runner-backend-module");
24
+ const task_backend_application_contribution_1 = require("./task-backend-application-contribution");
25
+ const task_manager_1 = require("./task-manager");
26
+ const task_runner_1 = require("./task-runner");
27
+ const task_server_1 = require("./task-server");
28
+ const task_common_module_1 = require("../common/task-common-module");
29
+ const common_1 = require("../common");
30
+ const task_preferences_1 = require("../common/task-preferences");
31
+ exports.default = new inversify_1.ContainerModule(bind => {
32
+ bind(task_manager_1.TaskManager).toSelf().inSingletonScope();
33
+ bind(node_1.BackendApplicationContribution).toService(task_manager_1.TaskManager);
34
+ bind(common_1.TaskServer).to(task_server_1.TaskServerImpl).inSingletonScope();
35
+ bind(messaging_1.ConnectionHandler).toDynamicValue(ctx => new messaging_1.RpcConnectionHandler(common_1.taskPath, client => {
36
+ const taskServer = ctx.container.get(common_1.TaskServer);
37
+ taskServer.setClient(client);
38
+ // when connection closes, cleanup that client of task-server
39
+ client.onDidCloseConnection(() => {
40
+ taskServer.disconnectClient(client);
41
+ });
42
+ return taskServer;
43
+ })).inSingletonScope();
44
+ (0, task_common_module_1.createCommonBindings)(bind);
45
+ bind(task_runner_1.TaskRunnerRegistry).toSelf().inSingletonScope();
46
+ (0, core_1.bindContributionProvider)(bind, task_runner_1.TaskRunnerContribution);
47
+ bind(task_backend_application_contribution_1.TaskBackendApplicationContribution).toSelf().inSingletonScope();
48
+ bind(node_1.BackendApplicationContribution).toService(task_backend_application_contribution_1.TaskBackendApplicationContribution);
49
+ (0, process_task_runner_backend_module_1.bindProcessTaskRunnerModule)(bind);
50
+ (0, custom_task_runner_backend_module_1.bindCustomTaskRunnerModule)(bind);
51
+ (0, task_preferences_1.bindTaskPreferences)(bind);
52
+ });
53
+ //# sourceMappingURL=task-backend-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-backend-module.js","sourceRoot":"","sources":["../../src/node/task-backend-module.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,4DAA+D;AAC/D,sCAAuD;AACvD,gEAA2F;AAC3F,+CAAsE;AACtE,qGAA2F;AAC3F,kGAAwF;AACxF,mGAA6F;AAC7F,iDAA6C;AAC7C,+CAA2E;AAC3E,+CAA+C;AAC/C,qEAAoE;AACpE,sCAA6D;AAC7D,iEAAiE;AAEjE,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IAEtC,IAAI,CAAC,0BAAW,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC9C,IAAI,CAAC,qCAA8B,CAAC,CAAC,SAAS,CAAC,0BAAW,CAAC,CAAC;IAE5D,IAAI,CAAC,mBAAU,CAAC,CAAC,EAAE,CAAC,4BAAc,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACvD,IAAI,CAAC,6BAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CACzC,IAAI,gCAAoB,CAAa,iBAAQ,EAAE,MAAM,CAAC,EAAE;QACpD,MAAM,UAAU,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAa,mBAAU,CAAC,CAAC;QAC7D,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC7B,6DAA6D;QAC7D,MAAM,CAAC,oBAAoB,CAAC,GAAG,EAAE;YAC7B,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QACH,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC,CACL,CAAC,gBAAgB,EAAE,CAAC;IAErB,IAAA,yCAAoB,EAAC,IAAI,CAAC,CAAC;IAE3B,IAAI,CAAC,gCAAkB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACrD,IAAA,+BAAwB,EAAC,IAAI,EAAE,oCAAsB,CAAC,CAAC;IACvD,IAAI,CAAC,0EAAkC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACrE,IAAI,CAAC,qCAA8B,CAAC,CAAC,SAAS,CAAC,0EAAkC,CAAC,CAAC;IAEnF,IAAA,gEAA2B,EAAC,IAAI,CAAC,CAAC;IAClC,IAAA,8DAA0B,EAAC,IAAI,CAAC,CAAC;IACjC,IAAA,sCAAmB,EAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { AbstractLineMatcher } from './task-abstract-line-matcher';
2
+ import { ProblemMatcher, ProblemMatch } from '../common/problem-matcher-protocol';
3
+ export declare class StartStopLineMatcher extends AbstractLineMatcher {
4
+ constructor(matcher: ProblemMatcher);
5
+ /**
6
+ * Finds the problem identified by this line matcher.
7
+ *
8
+ * @param line the line of text to find the problem from
9
+ * @return the identified problem. If the problem is not found, `undefined` is returned.
10
+ */
11
+ match(line: string): ProblemMatch | undefined;
12
+ }
13
+ export declare class WatchModeLineMatcher extends StartStopLineMatcher {
14
+ private beginsPattern;
15
+ private endsPattern;
16
+ activeOnStart: boolean;
17
+ constructor(matcher: ProblemMatcher);
18
+ /**
19
+ * Finds the problem identified by this line matcher.
20
+ *
21
+ * @param line the line of text to find the problem from
22
+ * @return the identified problem. If the problem is not found, `undefined` is returned.
23
+ */
24
+ match(line: string): ProblemMatch | undefined;
25
+ matchBegin(line: string): boolean;
26
+ matchEnd(line: string): boolean;
27
+ }
28
+ //# sourceMappingURL=task-line-matchers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-line-matchers.d.ts","sourceRoot":"","sources":["../../src/node/task-line-matchers.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAmB,MAAM,oCAAoC,CAAC;AAEnG,qBAAa,oBAAqB,SAAQ,mBAAmB;gBAE7C,OAAO,EAAE,cAAc;IAInC;;;;;OAKG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;CA8BhD;AAED,qBAAa,oBAAqB,SAAQ,oBAAoB;IAE1D,OAAO,CAAC,aAAa,CAAkB;IACvC,OAAO,CAAC,WAAW,CAAkB;IACrC,aAAa,EAAE,OAAO,CAAS;gBAEnB,OAAO,EAAE,cAAc;IAQnC;;;;;OAKG;IACM,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAuBtD,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAWjC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CASlC"}
@@ -0,0 +1,122 @@
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.WatchModeLineMatcher = exports.StartStopLineMatcher = void 0;
19
+ const task_abstract_line_matcher_1 = require("./task-abstract-line-matcher");
20
+ class StartStopLineMatcher extends task_abstract_line_matcher_1.AbstractLineMatcher {
21
+ constructor(matcher) {
22
+ super(matcher);
23
+ }
24
+ /**
25
+ * Finds the problem identified by this line matcher.
26
+ *
27
+ * @param line the line of text to find the problem from
28
+ * @return the identified problem. If the problem is not found, `undefined` is returned.
29
+ */
30
+ match(line) {
31
+ if (!this.activePattern) {
32
+ this.resetActivePatternIndex();
33
+ }
34
+ if (this.activePattern) {
35
+ const originalProblemData = Object.assign(this.getEmptyProblemData(), this.cachedProblemData);
36
+ const foundMatch = this.doOneLineMatch(line);
37
+ if (foundMatch) {
38
+ if (this.isUsingTheLastPattern()) {
39
+ const matchResult = this.getMarkerMatch(this.cachedProblemData);
40
+ if (this.isLastPatternLoop()) {
41
+ this.cachedProblemData = originalProblemData;
42
+ }
43
+ else {
44
+ this.resetCachedProblemData();
45
+ this.resetActivePatternIndex();
46
+ }
47
+ return matchResult;
48
+ }
49
+ else {
50
+ this.nextProblemPattern();
51
+ }
52
+ }
53
+ else {
54
+ this.resetCachedProblemData();
55
+ if (this.activePatternIndex !== 0) { // if no match, use the first pattern to parse the same line
56
+ this.resetActivePatternIndex();
57
+ return this.match(line);
58
+ }
59
+ }
60
+ }
61
+ return undefined;
62
+ }
63
+ }
64
+ exports.StartStopLineMatcher = StartStopLineMatcher;
65
+ class WatchModeLineMatcher extends StartStopLineMatcher {
66
+ constructor(matcher) {
67
+ super(matcher);
68
+ this.activeOnStart = false;
69
+ this.beginsPattern = matcher.watching.beginsPattern;
70
+ this.endsPattern = matcher.watching.endsPattern;
71
+ this.activeOnStart = matcher.watching.activeOnStart === true;
72
+ this.resetActivePatternIndex(this.activeOnStart ? 0 : -1);
73
+ }
74
+ /**
75
+ * Finds the problem identified by this line matcher.
76
+ *
77
+ * @param line the line of text to find the problem from
78
+ * @return the identified problem. If the problem is not found, `undefined` is returned.
79
+ */
80
+ match(line) {
81
+ if (this.activeOnStart) {
82
+ this.activeOnStart = false;
83
+ this.resetActivePatternIndex(0);
84
+ this.resetCachedProblemData();
85
+ return super.match(line);
86
+ }
87
+ if (this.matchBegin(line)) {
88
+ const beginsPatternMatch = this.getMarkerMatch(this.cachedProblemData);
89
+ this.resetCachedProblemData();
90
+ return beginsPatternMatch;
91
+ }
92
+ if (this.matchEnd(line)) {
93
+ this.resetCachedProblemData();
94
+ return undefined;
95
+ }
96
+ if (this.activePattern) {
97
+ return super.match(line);
98
+ }
99
+ return undefined;
100
+ }
101
+ matchBegin(line) {
102
+ const beginRegexp = new RegExp(this.beginsPattern.regexp);
103
+ const regexMatches = beginRegexp.exec(line);
104
+ if (regexMatches) {
105
+ this.fillProblemData(this.cachedProblemData, this.beginsPattern, regexMatches);
106
+ this.resetActivePatternIndex(0);
107
+ return true;
108
+ }
109
+ return false;
110
+ }
111
+ matchEnd(line) {
112
+ const endRegexp = new RegExp(this.endsPattern.regexp);
113
+ const match = endRegexp.exec(line);
114
+ if (match) {
115
+ this.resetActivePatternIndex(-1);
116
+ return true;
117
+ }
118
+ return false;
119
+ }
120
+ }
121
+ exports.WatchModeLineMatcher = WatchModeLineMatcher;
122
+ //# sourceMappingURL=task-line-matchers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-line-matchers.js","sourceRoot":"","sources":["../../src/node/task-line-matchers.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,6EAAmE;AAGnE,MAAa,oBAAqB,SAAQ,gDAAmB;IAEzD,YAAY,OAAuB;QAC/B,KAAK,CAAC,OAAO,CAAC,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AAY;QACnB,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC1D,MAAM,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,YAAY,EAAE,CAAC;YACf,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;YAC/E,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;YAChC,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,QAAQ,CAAC,IAAY;QACjB,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACtD,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;YACjC,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AA/DD,oDA+DC"}
@@ -0,0 +1,56 @@
1
+ import { Emitter, Event, ILogger } from '@theia/core/lib/common';
2
+ import { BackendApplicationContribution } from '@theia/core/lib/node';
3
+ import { Task } from './task';
4
+ import { ManagedTaskManager } from '../common';
5
+ /**
6
+ * The {@link TaskManager} is the common component responsible for managing running tasks.
7
+ */
8
+ export declare class TaskManager implements BackendApplicationContribution, ManagedTaskManager<Task> {
9
+ protected readonly logger: ILogger;
10
+ /** contains all running tasks */
11
+ protected readonly tasks: Map<number, Task>;
12
+ /** contains running tasks per context */
13
+ protected readonly tasksPerCtx: Map<string, Task[]>;
14
+ /** each task has this unique task id, for this back-end */
15
+ protected id: number;
16
+ /**
17
+ * Emit when a registered task is deleted.
18
+ */
19
+ protected readonly deleteEmitter: Emitter<number>;
20
+ constructor(logger: ILogger);
21
+ /**
22
+ * Registers a new task (in the given context if present). Each registered
23
+ * task is considered to be currently running.
24
+ * @param task the new task.
25
+ * @param ctx the provided context.
26
+ *
27
+ * @returns the registration id for the given task.
28
+ */
29
+ register(task: Task, ctx?: string): number;
30
+ /**
31
+ * Try to retrieve the registered task for the given id.
32
+ * @param id the task registration id.
33
+ *
34
+ * @returns the task or `undefined` if no task was registered for the given id.
35
+ */
36
+ get(id: number): Task | undefined;
37
+ /**
38
+ * Returns all running tasks. If a context is provided, filter-down to
39
+ * only tasks started from that context.
40
+ * @param ctx the task execution context.
41
+ *
42
+ * @returns all running tasks for the given context or `undefined` if no tasks are registered for the given context.
43
+ */
44
+ getTasks(ctx?: string): Task[] | undefined;
45
+ /**
46
+ * Delete the given task from the task manager.
47
+ * @param task the task to delete.
48
+ */
49
+ delete(task: Task): void;
50
+ get onDelete(): Event<number>;
51
+ /**
52
+ * Is triggered on application stop to cleanup all ongoing tasks.
53
+ */
54
+ onStop(): void;
55
+ }
56
+ //# sourceMappingURL=task-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-manager.d.ts","sourceRoot":"","sources":["../../src/node/task-manager.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C;;GAEG;AACH,qBACa,WAAY,YAAW,8BAA8B,EAAE,kBAAkB,CAAC,IAAI,CAAC;IAcpD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO;IAZtE,iCAAiC;IACjC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAa;IACxD,yCA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