@opensumi/ide-task 2.21.13 → 2.22.0
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.
- package/lib/browser/index.js +2 -2
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/parser.js +4 -4
- package/lib/browser/parser.js.map +1 -1
- package/lib/browser/task-config.d.ts +4 -4
- package/lib/browser/task-config.d.ts.map +1 -1
- package/lib/browser/task-config.js +31 -31
- package/lib/browser/task-config.js.map +1 -1
- package/lib/browser/task-executor.d.ts.map +1 -1
- package/lib/browser/task-executor.js +16 -22
- package/lib/browser/task-executor.js.map +1 -1
- package/lib/browser/task-preferences.contribution.js.map +1 -1
- package/lib/browser/task-preferences.provider.d.ts +2 -2
- package/lib/browser/task-preferences.provider.d.ts.map +1 -1
- package/lib/browser/task-preferences.provider.js +2 -2
- package/lib/browser/task-preferences.provider.js.map +1 -1
- package/lib/browser/task.contribution.js.map +1 -1
- package/lib/browser/task.schema.d.ts +2 -2
- package/lib/browser/task.schema.d.ts.map +1 -1
- package/lib/browser/task.schema.js +5 -1
- package/lib/browser/task.schema.js.map +1 -1
- package/lib/browser/task.service.d.ts +3 -1
- package/lib/browser/task.service.d.ts.map +1 -1
- package/lib/browser/task.service.js +10 -5
- package/lib/browser/task.service.js.map +1 -1
- package/lib/browser/terminal-task-system.js +11 -11
- package/lib/browser/terminal-task-system.js.map +1 -1
- package/lib/common/index.d.ts +1 -1
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/task.d.ts +4 -4
- package/lib/common/task.d.ts.map +1 -1
- package/lib/common/task.js +7 -7
- package/lib/common/task.js.map +1 -1
- package/package.json +15 -14
- package/src/browser/index.ts +33 -0
- package/src/browser/parser.ts +944 -0
- package/src/browser/problem-collector.ts +71 -0
- package/src/browser/problem-line-matcher.ts +461 -0
- package/src/browser/task-config.ts +2302 -0
- package/src/browser/task-executor.ts +296 -0
- package/src/browser/task-preferences.contribution.ts +9 -0
- package/src/browser/task-preferences.provider.ts +23 -0
- package/src/browser/task-preferences.ts +14 -0
- package/src/browser/task.contribution.ts +70 -0
- package/src/browser/task.schema.ts +368 -0
- package/src/browser/task.service.ts +504 -0
- package/src/browser/terminal-task-system.ts +340 -0
- package/src/common/index.ts +165 -0
- package/src/common/task.ts +1174 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { Injectable, Autowired } from '@opensumi/di';
|
|
2
|
+
import {
|
|
3
|
+
Event,
|
|
4
|
+
formatLocalize,
|
|
5
|
+
Disposable,
|
|
6
|
+
Deferred,
|
|
7
|
+
strings,
|
|
8
|
+
Emitter,
|
|
9
|
+
DisposableCollection,
|
|
10
|
+
ProblemMatch,
|
|
11
|
+
ProblemMatchData,
|
|
12
|
+
rangeAreEqual,
|
|
13
|
+
} from '@opensumi/ide-core-common';
|
|
14
|
+
import {
|
|
15
|
+
ITerminalController,
|
|
16
|
+
ITerminalGroupViewService,
|
|
17
|
+
ITerminalClient,
|
|
18
|
+
ITerminalService,
|
|
19
|
+
IShellLaunchConfig,
|
|
20
|
+
} from '@opensumi/ide-terminal-next/lib/common';
|
|
21
|
+
|
|
22
|
+
import { ITaskExecutor } from '../common';
|
|
23
|
+
import { Task } from '../common/task';
|
|
24
|
+
|
|
25
|
+
import { ProblemCollector } from './problem-collector';
|
|
26
|
+
|
|
27
|
+
const { removeAnsiEscapeCodes } = strings;
|
|
28
|
+
|
|
29
|
+
export enum TaskStatus {
|
|
30
|
+
PROCESS_INIT,
|
|
31
|
+
PROCESS_READY,
|
|
32
|
+
PROCESS_RUNNING,
|
|
33
|
+
PROCESS_EXITED,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function problemAreEquals(a: ProblemMatchData | ProblemMatch, b: ProblemMatchData | ProblemMatch) {
|
|
37
|
+
return (
|
|
38
|
+
a.resource?.toString() === b.resource?.toString() &&
|
|
39
|
+
a.description.owner === b.description.owner &&
|
|
40
|
+
a.description.severity === b.description.severity &&
|
|
41
|
+
a.description.source === b.description.source &&
|
|
42
|
+
(a as ProblemMatchData)?.marker?.code === (b as ProblemMatchData)?.marker?.code &&
|
|
43
|
+
(a as ProblemMatchData)?.marker?.message === (b as ProblemMatchData)?.marker?.message &&
|
|
44
|
+
(a as ProblemMatchData)?.marker?.source === (b as ProblemMatchData)?.marker?.source &&
|
|
45
|
+
rangeAreEqual((a as ProblemMatchData)?.marker?.range, (b as ProblemMatchData)?.marker?.range)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@Injectable({ multiple: true })
|
|
50
|
+
export class TerminalTaskExecutor extends Disposable implements ITaskExecutor {
|
|
51
|
+
@Autowired(ITerminalGroupViewService)
|
|
52
|
+
protected readonly terminalView: ITerminalGroupViewService;
|
|
53
|
+
|
|
54
|
+
@Autowired(ITerminalController)
|
|
55
|
+
protected readonly terminalController: ITerminalController;
|
|
56
|
+
|
|
57
|
+
@Autowired(ITerminalService)
|
|
58
|
+
protected readonly terminalService: ITerminalService;
|
|
59
|
+
|
|
60
|
+
private _terminalClient: ITerminalClient | undefined;
|
|
61
|
+
|
|
62
|
+
get terminalClient() {
|
|
63
|
+
return this._terminalClient;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set terminalClient(v) {
|
|
67
|
+
// 重新赋值之前,先清除之前的事件绑定,否则给 this.terminalClient 赋值之后就无法清除以前的事件监听了。
|
|
68
|
+
this.resetEventDispose();
|
|
69
|
+
this._terminalClient = v;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private pid: number | undefined;
|
|
73
|
+
|
|
74
|
+
private exitDefer: Deferred<{ exitCode?: number }> = new Deferred();
|
|
75
|
+
|
|
76
|
+
private _onDidTerminalCreated: Emitter<string> = new Emitter();
|
|
77
|
+
public onDidTerminalCreated: Event<string> = this._onDidTerminalCreated.event;
|
|
78
|
+
|
|
79
|
+
private _onDidTaskProcessExit: Emitter<number | undefined> = new Emitter();
|
|
80
|
+
public onDidTaskProcessExit: Event<number | undefined> = this._onDidTaskProcessExit.event;
|
|
81
|
+
|
|
82
|
+
private _onDidBackgroundTaskBegin: Emitter<void> = new Emitter();
|
|
83
|
+
public onDidBackgroundTaskBegin: Event<void> = this._onDidBackgroundTaskBegin.event;
|
|
84
|
+
|
|
85
|
+
private _onDidBackgroundTaskEnd: Emitter<void> = new Emitter();
|
|
86
|
+
public onDidBackgroundTaskEnd: Event<void> = this._onDidBackgroundTaskEnd.event;
|
|
87
|
+
|
|
88
|
+
private _onDidProblemMatched: Emitter<ProblemMatch[]> = new Emitter();
|
|
89
|
+
public onDidProblemMatched: Event<ProblemMatch[]> = this._onDidProblemMatched.event;
|
|
90
|
+
|
|
91
|
+
private _onDidTerminalWidgetRemove: Emitter<void> = new Emitter();
|
|
92
|
+
public onDidTerminalWidgetRemove: Event<void> = this._onDidTerminalWidgetRemove.event;
|
|
93
|
+
|
|
94
|
+
public processReady: Deferred<void> = new Deferred<void>();
|
|
95
|
+
|
|
96
|
+
private processExited = false;
|
|
97
|
+
|
|
98
|
+
private eventToDispose: DisposableCollection = new DisposableCollection();
|
|
99
|
+
resetEventDispose() {
|
|
100
|
+
this.eventToDispose.dispose();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public taskStatus: TaskStatus = TaskStatus.PROCESS_INIT;
|
|
104
|
+
|
|
105
|
+
constructor(
|
|
106
|
+
private task: Task,
|
|
107
|
+
private shellLaunchConfig: IShellLaunchConfig,
|
|
108
|
+
private collector: ProblemCollector,
|
|
109
|
+
public executorId: number,
|
|
110
|
+
) {
|
|
111
|
+
super();
|
|
112
|
+
|
|
113
|
+
this.addDispose(
|
|
114
|
+
this.terminalView.onWidgetDisposed((e) => {
|
|
115
|
+
if (this.terminalClient && e.id === this.terminalClient.id) {
|
|
116
|
+
this._onDidTerminalWidgetRemove.fire();
|
|
117
|
+
}
|
|
118
|
+
}),
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
terminate(): Promise<{ success: boolean }> {
|
|
123
|
+
return new Promise((resolve) => {
|
|
124
|
+
if (this.terminalClient) {
|
|
125
|
+
this.terminalClient.dispose();
|
|
126
|
+
if (this.processExited) {
|
|
127
|
+
// 如果在调 terminate 之前进程已经退出,直接删掉 terminalWidget 即可
|
|
128
|
+
this.terminalView.removeWidget(this.terminalClient.id);
|
|
129
|
+
resolve({ success: true });
|
|
130
|
+
} else {
|
|
131
|
+
this.terminalService.onExit((e) => {
|
|
132
|
+
if (e.sessionId === this.terminalClient?.id) {
|
|
133
|
+
this.terminalView.removeWidget(this.terminalClient.id);
|
|
134
|
+
resolve({ success: true });
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
resolve({ success: true });
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
private handleTaskExit(code?: number) {
|
|
145
|
+
if (!this.terminalClient) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const { id, term } = this.terminalClient;
|
|
149
|
+
term.options.disableStdin = true;
|
|
150
|
+
term.writeln(`\r\n${formatLocalize('terminal.integrated.exitedWithCode', code)}`);
|
|
151
|
+
term.writeln(`\r\n\x1b[1m${formatLocalize('reuseTerminal')}\x1b[0m\r\n`);
|
|
152
|
+
this._onDidTaskProcessExit.fire(code);
|
|
153
|
+
|
|
154
|
+
// 按任意键退出
|
|
155
|
+
this.eventToDispose.push(
|
|
156
|
+
Event.once(term.onKey)(() => {
|
|
157
|
+
id && this.terminalView.removeWidget(id);
|
|
158
|
+
}),
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* 监听 Terminal 的相关事件,一个 Executor 仅需监听一次即可,否则多次监听会导致输出重复内容。
|
|
164
|
+
* 仅需要在 createTerminal 中设置一次监听即可
|
|
165
|
+
* 注意里面的 event 用完要及时 dispose
|
|
166
|
+
*/
|
|
167
|
+
private bindTerminalClientEvent() {
|
|
168
|
+
if (!this.terminalClient) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
this.resetEventDispose();
|
|
172
|
+
this.eventToDispose.push(
|
|
173
|
+
this.terminalClient.onOutput((e) => {
|
|
174
|
+
const output = removeAnsiEscapeCodes(e.data.toString());
|
|
175
|
+
const isBegin = this.collector.matchBeginMatcher(output);
|
|
176
|
+
if (isBegin) {
|
|
177
|
+
this._onDidBackgroundTaskBegin.fire();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// process multi-line output
|
|
181
|
+
const lines = output.split(/\r?\n/g).filter((e) => e);
|
|
182
|
+
const markerResults: ProblemMatch[] = [];
|
|
183
|
+
for (const l of lines) {
|
|
184
|
+
const markers = this.collector.processLine(l);
|
|
185
|
+
if (markers && markers.length > 0) {
|
|
186
|
+
for (const marker of markers) {
|
|
187
|
+
const existing = markerResults.findIndex((e) => problemAreEquals(e, marker));
|
|
188
|
+
if (existing === -1) {
|
|
189
|
+
markerResults.push(marker);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (markerResults.length > 0) {
|
|
196
|
+
this._onDidProblemMatched.fire(markerResults);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const isEnd = this.collector.matchEndMatcher(output);
|
|
200
|
+
if (isEnd) {
|
|
201
|
+
this._onDidBackgroundTaskEnd.fire();
|
|
202
|
+
}
|
|
203
|
+
}),
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
this.eventToDispose.push(
|
|
207
|
+
Event.once(this.terminalClient.onExit)(async (e) => {
|
|
208
|
+
if (e.id === this.terminalClient?.id && this.taskStatus !== TaskStatus.PROCESS_EXITED) {
|
|
209
|
+
this.taskStatus = TaskStatus.PROCESS_EXITED;
|
|
210
|
+
this.handleTaskExit(e.code);
|
|
211
|
+
this.processExited = true;
|
|
212
|
+
this.exitDefer.resolve({ exitCode: e.code });
|
|
213
|
+
}
|
|
214
|
+
}),
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
private async createTerminal(reuse?: boolean) {
|
|
219
|
+
if (reuse && this.terminalClient) {
|
|
220
|
+
this.terminalClient.updateLaunchConfig(this.shellLaunchConfig);
|
|
221
|
+
this.terminalClient.reset();
|
|
222
|
+
} else {
|
|
223
|
+
this.terminalClient = await this.terminalController.createTerminalWithWidget({
|
|
224
|
+
config: this.shellLaunchConfig,
|
|
225
|
+
closeWhenExited: false,
|
|
226
|
+
isTaskExecutor: true,
|
|
227
|
+
taskId: this.task._id,
|
|
228
|
+
beforeCreate: (terminalId) => {
|
|
229
|
+
this._onDidTerminalCreated.fire(terminalId);
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
this.bindTerminalClientEvent();
|
|
234
|
+
this.terminalController.showTerminalPanel();
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
async attach(terminalClient: ITerminalClient): Promise<{ exitCode?: number }> {
|
|
238
|
+
this.taskStatus = TaskStatus.PROCESS_READY;
|
|
239
|
+
this.terminalClient = terminalClient;
|
|
240
|
+
this.shellLaunchConfig = terminalClient.launchConfig;
|
|
241
|
+
this.taskStatus = TaskStatus.PROCESS_RUNNING;
|
|
242
|
+
this.pid = await this.terminalClient?.pid;
|
|
243
|
+
this.processReady.resolve();
|
|
244
|
+
|
|
245
|
+
this._onDidTerminalCreated.fire(terminalClient.id);
|
|
246
|
+
|
|
247
|
+
return this.exitDefer.promise;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
async execute(task: Task, reuse?: boolean): Promise<{ exitCode?: number }> {
|
|
251
|
+
this.taskStatus = TaskStatus.PROCESS_READY;
|
|
252
|
+
|
|
253
|
+
await this.createTerminal(reuse);
|
|
254
|
+
|
|
255
|
+
this.terminalClient?.term.writeln(`\x1b[3m> Executing task: ${task._label} <\x1b[0m\n`);
|
|
256
|
+
const { args } = this.shellLaunchConfig;
|
|
257
|
+
|
|
258
|
+
// extensionTerminal 由插件自身接管,不需要执行和输出 Command
|
|
259
|
+
if (!this.shellLaunchConfig.isExtensionOwnedTerminal && args) {
|
|
260
|
+
this.terminalClient?.term.writeln(`\x1b[3m> Command: ${typeof args === 'string' ? args : args[1]} <\x1b[0m\n`);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
await this.terminalClient?.attached.promise;
|
|
264
|
+
this.taskStatus = TaskStatus.PROCESS_RUNNING;
|
|
265
|
+
this.pid = await this.terminalClient?.pid;
|
|
266
|
+
this.processReady.resolve();
|
|
267
|
+
this.terminalClient?.term.write('\x1b[G');
|
|
268
|
+
return this.exitDefer.promise;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
get processId(): number | undefined {
|
|
272
|
+
return this.pid;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
get terminalId(): string | undefined {
|
|
276
|
+
return this.terminalClient && this.terminalClient.id;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
get widgetId(): string | undefined {
|
|
280
|
+
return this.terminalClient && this.terminalClient.widget.id;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
public updateLaunchConfig(launchConfig: IShellLaunchConfig) {
|
|
284
|
+
this.shellLaunchConfig = launchConfig;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
public updateProblemCollector(collector: ProblemCollector) {
|
|
288
|
+
this.collector = collector;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
public reset() {
|
|
292
|
+
this.resetEventDispose();
|
|
293
|
+
this.taskStatus = TaskStatus.PROCESS_INIT;
|
|
294
|
+
this.exitDefer = new Deferred();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PreferenceContribution, PreferenceSchema, Domain, PreferenceConfiguration } from '@opensumi/ide-core-browser';
|
|
2
|
+
|
|
3
|
+
import { taskPreferencesSchema } from './task-preferences';
|
|
4
|
+
|
|
5
|
+
@Domain(PreferenceContribution, PreferenceConfiguration)
|
|
6
|
+
export class TaskPreferencesContribution implements PreferenceContribution, PreferenceConfiguration {
|
|
7
|
+
schema: PreferenceSchema = taskPreferencesSchema;
|
|
8
|
+
name = 'tasks';
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Injectable } from '@opensumi/di';
|
|
2
|
+
import { FolderFilePreferenceProvider } from '@opensumi/ide-preferences/lib/browser/folder-file-preference-provider';
|
|
3
|
+
|
|
4
|
+
@Injectable()
|
|
5
|
+
export class TaskFolderPreferenceProvider extends FolderFilePreferenceProvider {
|
|
6
|
+
protected parse(content: string): any {
|
|
7
|
+
const tasks = super.parse(content);
|
|
8
|
+
if (tasks === undefined) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
return { tasks: { ...tasks } };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
protected getPath(preferenceName: string): string[] | undefined {
|
|
15
|
+
if (preferenceName === 'tasks') {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
if (preferenceName.startsWith('tasks.')) {
|
|
19
|
+
return [preferenceName.substr('tasks.'.length)];
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PreferenceSchema } from '@opensumi/ide-core-browser';
|
|
2
|
+
|
|
3
|
+
import { taskSchemaUri } from './task.schema';
|
|
4
|
+
|
|
5
|
+
export const taskPreferencesSchema: PreferenceSchema = {
|
|
6
|
+
type: 'object',
|
|
7
|
+
scope: 'resource',
|
|
8
|
+
properties: {
|
|
9
|
+
tasks: {
|
|
10
|
+
$ref: taskSchemaUri,
|
|
11
|
+
defaultValue: { tasks: [] },
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Autowired } from '@opensumi/di';
|
|
2
|
+
import {
|
|
3
|
+
CommandContribution,
|
|
4
|
+
CommandRegistry,
|
|
5
|
+
Domain,
|
|
6
|
+
Command,
|
|
7
|
+
JsonSchemaContribution,
|
|
8
|
+
IJSONSchemaRegistry,
|
|
9
|
+
WithEventBus,
|
|
10
|
+
TerminalClientAttachEvent,
|
|
11
|
+
OnEvent,
|
|
12
|
+
} from '@opensumi/ide-core-browser';
|
|
13
|
+
import { ITerminalController } from '@opensumi/ide-terminal-next/lib/common/controller';
|
|
14
|
+
|
|
15
|
+
import { ITaskService } from '../common';
|
|
16
|
+
|
|
17
|
+
import { schema, taskSchemaUri } from './task.schema';
|
|
18
|
+
|
|
19
|
+
const Category = 'Tasks';
|
|
20
|
+
|
|
21
|
+
@Domain(CommandContribution, JsonSchemaContribution)
|
|
22
|
+
export class TaskContribution extends WithEventBus implements CommandContribution, JsonSchemaContribution {
|
|
23
|
+
// 因为部分插件会执行 Task 相关的命令,所以如果你要添加 Task 相关的命令:
|
|
24
|
+
// 请注意要和 VSCode 的同功能命名对齐,可以通过插件进程的 delegate 逻辑做命令调用的转发
|
|
25
|
+
static readonly RUN_TASK_COMMAND: Command = {
|
|
26
|
+
id: 'workbench.action.tasks.runTask',
|
|
27
|
+
label: '%workbench.action.tasks.runTask%',
|
|
28
|
+
category: Category,
|
|
29
|
+
};
|
|
30
|
+
static readonly RERUN_TASK: Command = {
|
|
31
|
+
id: 'workbench.action.tasks.reRunTask',
|
|
32
|
+
label: '%workbench.action.tasks.reRunTask%',
|
|
33
|
+
category: Category,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
@Autowired(ITerminalController)
|
|
37
|
+
protected readonly terminalController: ITerminalController;
|
|
38
|
+
|
|
39
|
+
@Autowired(ITaskService)
|
|
40
|
+
private readonly taskService: ITaskService;
|
|
41
|
+
|
|
42
|
+
@OnEvent(TerminalClientAttachEvent)
|
|
43
|
+
handleTerminalClientAttach(event: TerminalClientAttachEvent) {
|
|
44
|
+
const client = this.terminalController.clients.get(event.payload.clientId);
|
|
45
|
+
if (!client) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (client.isTaskExecutor && client.taskId) {
|
|
50
|
+
this.taskService.attach(client.taskId, client);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
registerSchema(registry: IJSONSchemaRegistry) {
|
|
55
|
+
registry.registerSchema(taskSchemaUri, schema, ['tasks.json']);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
registerCommands(commandRegister: CommandRegistry) {
|
|
59
|
+
commandRegister.registerCommand(TaskContribution.RUN_TASK_COMMAND, {
|
|
60
|
+
execute: () => {
|
|
61
|
+
this.taskService.runTaskCommand();
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
commandRegister.registerCommand(TaskContribution.RERUN_TASK, {
|
|
65
|
+
execute: () => {
|
|
66
|
+
this.taskService.rerunLastTask();
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|