@opensumi/sumi 2.12.1-next-079c1930
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/README.md +1 -0
- package/build.ts +18 -0
- package/index.d.ts +5 -0
- package/manifest.json +414 -0
- package/package.json +18 -0
- package/sumi-browser.d.ts +273 -0
- package/sumi-worker/sumi-worker.d.ts +2788 -0
- package/sumi-worker/worker.command.d.ts +86 -0
- package/sumi-worker/worker.comments.d.ts +273 -0
- package/sumi-worker/worker.doc.d.ts +356 -0
- package/sumi-worker/worker.editor.d.ts +725 -0
- package/sumi-worker/worker.extensions.d.ts +63 -0
- package/sumi-worker/worker.language.d.ts +2220 -0
- package/sumi-worker/worker.window.d.ts +318 -0
- package/sumi-worker.d.ts +7 -0
- package/sumi.d.ts +822 -0
- package/vscode/typings/vscode.authentication.d.ts +231 -0
- package/vscode/typings/vscode.command.d.ts +86 -0
- package/vscode/typings/vscode.comments.d.ts +292 -0
- package/vscode/typings/vscode.d.ts +3789 -0
- package/vscode/typings/vscode.debug.d.ts +684 -0
- package/vscode/typings/vscode.doc.d.ts +272 -0
- package/vscode/typings/vscode.editor.d.ts +1017 -0
- package/vscode/typings/vscode.env.d.ts +153 -0
- package/vscode/typings/vscode.extension.d.ts +67 -0
- package/vscode/typings/vscode.language.d.ts +2630 -0
- package/vscode/typings/vscode.message.d.ts +195 -0
- package/vscode/typings/vscode.proposed.d.ts +662 -0
- package/vscode/typings/vscode.quickpick.d.ts +491 -0
- package/vscode/typings/vscode.scm.d.ts +254 -0
- package/vscode/typings/vscode.tasks.d.ts +676 -0
- package/vscode/typings/vscode.theme.d.ts +370 -0
- package/vscode/typings/vscode.window.d.ts +870 -0
- package/vscode/typings/vscode.workspace.d.ts +664 -0
- package/vscode/typings-pending/vscode.d.ts +27 -0
- package/vscode/typings-pending/vscode.proposed.d.ts +3 -0
- package/vscode.d.ts +23 -0
|
@@ -0,0 +1,676 @@
|
|
|
1
|
+
declare module 'vscode' {
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Controls how the task channel is used between tasks
|
|
6
|
+
*/
|
|
7
|
+
export enum TaskPanelKind {
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Shares a panel with other tasks. This is the default.
|
|
11
|
+
*/
|
|
12
|
+
Shared = 1,
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Uses a dedicated panel for this tasks. The panel is not
|
|
16
|
+
* shared with other tasks.
|
|
17
|
+
*/
|
|
18
|
+
Dedicated = 2,
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Creates a new panel whenever this task is executed.
|
|
22
|
+
*/
|
|
23
|
+
New = 3,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Controls the behaviour of the terminal's visibility.
|
|
29
|
+
*/
|
|
30
|
+
export enum TaskRevealKind {
|
|
31
|
+
/**
|
|
32
|
+
* Always brings the terminal to front if the task is executed.
|
|
33
|
+
*/
|
|
34
|
+
Always = 1,
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Only brings the terminal to front if a problem is detected executing the task
|
|
38
|
+
* (e.g. the task couldn't be started because).
|
|
39
|
+
*/
|
|
40
|
+
Silent = 2,
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The terminal never comes to front when the task is executed.
|
|
44
|
+
*/
|
|
45
|
+
Never = 3,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Controls how the task is presented in the UI.
|
|
50
|
+
*/
|
|
51
|
+
export interface TaskPresentationOptions {
|
|
52
|
+
/**
|
|
53
|
+
* Controls whether the task output is reveal in the user interface.
|
|
54
|
+
* Defaults to `RevealKind.Always`.
|
|
55
|
+
*/
|
|
56
|
+
reveal?: TaskRevealKind;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Controls whether the command associated with the task is echoed
|
|
60
|
+
* in the user interface.
|
|
61
|
+
*/
|
|
62
|
+
echo?: boolean;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Controls whether the panel showing the task output is taking focus.
|
|
66
|
+
*/
|
|
67
|
+
focus?: boolean;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Controls if the task panel is used for this task only (dedicated),
|
|
71
|
+
* shared between tasks (shared) or if a new panel is created on
|
|
72
|
+
* every task execution (new). Defaults to `TaskInstanceKind.Shared`
|
|
73
|
+
*/
|
|
74
|
+
panel?: TaskPanelKind;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Controls whether to show the "Terminal will be reused by tasks, press any key to close it" message.
|
|
78
|
+
*/
|
|
79
|
+
showReuseMessage?: boolean;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Controls whether the terminal is cleared before executing the task.
|
|
83
|
+
*/
|
|
84
|
+
clear?: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* A grouping for tasks. The editor by default supports the
|
|
89
|
+
* 'Clean', 'Build', 'RebuildAll' and 'Test' group.
|
|
90
|
+
*/
|
|
91
|
+
export class TaskGroup {
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The clean task group;
|
|
95
|
+
*/
|
|
96
|
+
static Clean: TaskGroup;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The build task group;
|
|
100
|
+
*/
|
|
101
|
+
static Build: TaskGroup;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The rebuild all task group;
|
|
105
|
+
*/
|
|
106
|
+
static Rebuild: TaskGroup;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The test all task group;
|
|
110
|
+
*/
|
|
111
|
+
static Test: TaskGroup;
|
|
112
|
+
|
|
113
|
+
private constructor(id: string, label: string);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* A structure that defines a task kind in the system.
|
|
118
|
+
* The value must be JSON-stringifyable.
|
|
119
|
+
*/
|
|
120
|
+
export interface TaskDefinition {
|
|
121
|
+
/**
|
|
122
|
+
* The task definition describing the task provided by an extension.
|
|
123
|
+
* Usually a task provider defines more properties to identify
|
|
124
|
+
* a task. They need to be defined in the package.json of the
|
|
125
|
+
* extension under the 'taskDefinitions' extension point. The npm
|
|
126
|
+
* task definition for example looks like this
|
|
127
|
+
* ```typescript
|
|
128
|
+
* interface NpmTaskDefinition extends TaskDefinition {
|
|
129
|
+
* script: string;
|
|
130
|
+
* }
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* Note that type identifier starting with a '$' are reserved for internal
|
|
134
|
+
* usages and shouldn't be used by extensions.
|
|
135
|
+
*/
|
|
136
|
+
readonly type: string;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Additional attributes of a concrete task definition.
|
|
140
|
+
*/
|
|
141
|
+
[name: string]: any;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Options for a process execution
|
|
146
|
+
*/
|
|
147
|
+
export interface ProcessExecutionOptions {
|
|
148
|
+
/**
|
|
149
|
+
* The current working directory of the executed program or shell.
|
|
150
|
+
* If omitted the tools current workspace root is used.
|
|
151
|
+
*/
|
|
152
|
+
cwd?: string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The additional environment of the executed program or shell. If omitted
|
|
156
|
+
* the parent process' environment is used. If provided it is merged with
|
|
157
|
+
* the parent process' environment.
|
|
158
|
+
*/
|
|
159
|
+
env?: { [key: string]: string };
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The execution of a task happens as an external process
|
|
164
|
+
* without shell interaction.
|
|
165
|
+
*/
|
|
166
|
+
export class ProcessExecution {
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Creates a process execution.
|
|
170
|
+
*
|
|
171
|
+
* @param process The process to start.
|
|
172
|
+
* @param options Optional options for the started process.
|
|
173
|
+
*/
|
|
174
|
+
constructor(process: string, options?: ProcessExecutionOptions);
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Creates a process execution.
|
|
178
|
+
*
|
|
179
|
+
* @param process The process to start.
|
|
180
|
+
* @param args Arguments to be passed to the process.
|
|
181
|
+
* @param options Optional options for the started process.
|
|
182
|
+
*/
|
|
183
|
+
constructor(process: string, args: string[], options?: ProcessExecutionOptions);
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The process to be executed.
|
|
187
|
+
*/
|
|
188
|
+
process: string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* The arguments passed to the process. Defaults to an empty array.
|
|
192
|
+
*/
|
|
193
|
+
args: string[];
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* The process options used when the process is executed.
|
|
197
|
+
* Defaults to undefined.
|
|
198
|
+
*/
|
|
199
|
+
options?: ProcessExecutionOptions;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* The shell quoting options.
|
|
204
|
+
*/
|
|
205
|
+
export interface ShellQuotingOptions {
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* The character used to do character escaping. If a string is provided only spaces
|
|
209
|
+
* are escaped. If a `{ escapeChar, charsToEscape }` literal is provide all characters
|
|
210
|
+
* in `charsToEscape` are escaped using the `escapeChar`.
|
|
211
|
+
*/
|
|
212
|
+
escape?: string | {
|
|
213
|
+
/**
|
|
214
|
+
* The escape character.
|
|
215
|
+
*/
|
|
216
|
+
escapeChar: string;
|
|
217
|
+
/**
|
|
218
|
+
* The characters to escape.
|
|
219
|
+
*/
|
|
220
|
+
charsToEscape: string;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The character used for strong quoting. The string's length must be 1.
|
|
225
|
+
*/
|
|
226
|
+
strong?: string;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* The character used for weak quoting. The string's length must be 1.
|
|
230
|
+
*/
|
|
231
|
+
weak?: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Options for a shell execution
|
|
236
|
+
*/
|
|
237
|
+
export interface ShellExecutionOptions {
|
|
238
|
+
/**
|
|
239
|
+
* The shell executable.
|
|
240
|
+
*/
|
|
241
|
+
executable?: string;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* The arguments to be passed to the shell executable used to run the task. Most shells
|
|
245
|
+
* require special arguments to execute a command. For example `bash` requires the `-c`
|
|
246
|
+
* argument to execute a command, `PowerShell` requires `-Command` and `cmd` requires both
|
|
247
|
+
* `/d` and `/c`.
|
|
248
|
+
*/
|
|
249
|
+
shellArgs?: string[];
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* The shell quotes supported by this shell.
|
|
253
|
+
*/
|
|
254
|
+
shellQuoting?: ShellQuotingOptions;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The current working directory of the executed shell.
|
|
258
|
+
* If omitted the tools current workspace root is used.
|
|
259
|
+
*/
|
|
260
|
+
cwd?: string;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* The additional environment of the executed shell. If omitted
|
|
264
|
+
* the parent process' environment is used. If provided it is merged with
|
|
265
|
+
* the parent process' environment.
|
|
266
|
+
*/
|
|
267
|
+
env?: { [key: string]: string };
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Defines how an argument should be quoted if it contains
|
|
272
|
+
* spaces or unsupported characters.
|
|
273
|
+
*/
|
|
274
|
+
export enum ShellQuoting {
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Character escaping should be used. This for example
|
|
278
|
+
* uses \ on bash and ` on PowerShell.
|
|
279
|
+
*/
|
|
280
|
+
Escape = 1,
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Strong string quoting should be used. This for example
|
|
284
|
+
* uses " for Windows cmd and ' for bash and PowerShell.
|
|
285
|
+
* Strong quoting treats arguments as literal strings.
|
|
286
|
+
* Under PowerShell echo 'The value is $(2 * 3)' will
|
|
287
|
+
* print `The value is $(2 * 3)`
|
|
288
|
+
*/
|
|
289
|
+
Strong = 2,
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Weak string quoting should be used. This for example
|
|
293
|
+
* uses " for Windows cmd, bash and PowerShell. Weak quoting
|
|
294
|
+
* still performs some kind of evaluation inside the quoted
|
|
295
|
+
* string. Under PowerShell echo "The value is $(2 * 3)"
|
|
296
|
+
* will print `The value is 6`
|
|
297
|
+
*/
|
|
298
|
+
Weak = 3,
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* A string that will be quoted depending on the used shell.
|
|
303
|
+
*/
|
|
304
|
+
export interface ShellQuotedString {
|
|
305
|
+
/**
|
|
306
|
+
* The actual string value.
|
|
307
|
+
*/
|
|
308
|
+
value: string;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* The quoting style to use.
|
|
312
|
+
*/
|
|
313
|
+
quoting: ShellQuoting;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export class ShellExecution {
|
|
317
|
+
/**
|
|
318
|
+
* Creates a shell execution with a full command line.
|
|
319
|
+
*
|
|
320
|
+
* @param commandLine The command line to execute.
|
|
321
|
+
* @param options Optional options for the started the shell.
|
|
322
|
+
*/
|
|
323
|
+
constructor(commandLine: string, options?: ShellExecutionOptions);
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Creates a shell execution with a command and arguments. For the real execution VS Code will
|
|
327
|
+
* construct a command line from the command and the arguments. This is subject to interpretation
|
|
328
|
+
* especially when it comes to quoting. If full control over the command line is needed please
|
|
329
|
+
* use the constructor that creates a `ShellExecution` with the full command line.
|
|
330
|
+
*
|
|
331
|
+
* @param command The command to execute.
|
|
332
|
+
* @param args The command arguments.
|
|
333
|
+
* @param options Optional options for the started the shell.
|
|
334
|
+
*/
|
|
335
|
+
constructor(command: string | ShellQuotedString, args: (string | ShellQuotedString)[], options?: ShellExecutionOptions);
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* The shell command line. Is `undefined` if created with a command and arguments.
|
|
339
|
+
*/
|
|
340
|
+
commandLine: string;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* The shell command. Is `undefined` if created with a full command line.
|
|
344
|
+
*/
|
|
345
|
+
command: string | ShellQuotedString;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* The shell args. Is `undefined` if created with a full command line.
|
|
349
|
+
*/
|
|
350
|
+
args: (string | ShellQuotedString)[];
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* The shell options used when the command line is executed in a shell.
|
|
354
|
+
* Defaults to undefined.
|
|
355
|
+
*/
|
|
356
|
+
options?: ShellExecutionOptions;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* The scope of a task.
|
|
361
|
+
*/
|
|
362
|
+
export enum TaskScope {
|
|
363
|
+
/**
|
|
364
|
+
* The task is a global task
|
|
365
|
+
*/
|
|
366
|
+
Global = 1,
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* The task is a workspace task
|
|
370
|
+
*/
|
|
371
|
+
Workspace = 2,
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Run options for a task.
|
|
376
|
+
*/
|
|
377
|
+
export interface RunOptions {
|
|
378
|
+
/**
|
|
379
|
+
* Controls whether task variables are re-evaluated on rerun.
|
|
380
|
+
*/
|
|
381
|
+
reevaluateOnRerun?: boolean;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* A task to execute
|
|
386
|
+
*/
|
|
387
|
+
export class Task {
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Creates a new task.
|
|
391
|
+
*
|
|
392
|
+
* @param definition The task definition as defined in the taskDefinitions extension point.
|
|
393
|
+
* @param scope Specifies the task's scope. It is either a global or a workspace task or a task for a specific workspace folder.
|
|
394
|
+
* @param name The task's name. Is presented in the user interface.
|
|
395
|
+
* @param source The task's source (e.g. 'gulp', 'npm', ...). Is presented in the user interface.
|
|
396
|
+
* @param execution The process or shell execution.
|
|
397
|
+
* @param problemMatchers the names of problem matchers to use, like '$tsc'
|
|
398
|
+
* or '$eslint'. Problem matchers can be contributed by an extension using
|
|
399
|
+
* the `problemMatchers` extension point.
|
|
400
|
+
*/
|
|
401
|
+
constructor(taskDefinition: TaskDefinition, scope: WorkspaceFolder | TaskScope.Global | TaskScope.Workspace, name: string, source: string, execution?: ProcessExecution | ShellExecution | CustomExecution, problemMatchers?: string | string[]);
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* ~~Creates a new task.~~
|
|
405
|
+
*
|
|
406
|
+
* @deprecated Use the new constructors that allow specifying a scope for the task.
|
|
407
|
+
*
|
|
408
|
+
* @param definition The task definition as defined in the taskDefinitions extension point.
|
|
409
|
+
* @param name The task's name. Is presented in the user interface.
|
|
410
|
+
* @param source The task's source (e.g. 'gulp', 'npm', ...). Is presented in the user interface.
|
|
411
|
+
* @param execution The process or shell execution.
|
|
412
|
+
* @param problemMatchers the names of problem matchers to use, like '$tsc'
|
|
413
|
+
* or '$eslint'. Problem matchers can be contributed by an extension using
|
|
414
|
+
* the `problemMatchers` extension point.
|
|
415
|
+
*/
|
|
416
|
+
constructor(taskDefinition: TaskDefinition, name: string, source: string, execution?: ProcessExecution | ShellExecution | CustomExecution, problemMatchers?: string | string[]);
|
|
417
|
+
/**
|
|
418
|
+
* ~~Creates a new task.~~
|
|
419
|
+
*
|
|
420
|
+
* @deprecated Use the new constructors that allow specifying a scope for the task.
|
|
421
|
+
*
|
|
422
|
+
* @param definition The task definition as defined in the taskDefinitions extension point.
|
|
423
|
+
* @param name The task's name. Is presented in the user interface.
|
|
424
|
+
* @param source The task's source (e.g. 'gulp', 'npm', ...). Is presented in the user interface.
|
|
425
|
+
* @param execution The process or shell execution.
|
|
426
|
+
* @param problemMatchers the names of problem matchers to use, like '$tsc'
|
|
427
|
+
* or '$eslint'. Problem matchers can be contributed by an extension using
|
|
428
|
+
* the `problemMatchers` extension point.
|
|
429
|
+
*/
|
|
430
|
+
constructor(taskDefinition: TaskDefinition, name: string, source: string, execution?: ProcessExecution | ShellExecution, problemMatchers?: string | string[]);
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* The task's definition.
|
|
434
|
+
*/
|
|
435
|
+
definition: TaskDefinition;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* The task's scope.
|
|
439
|
+
*/
|
|
440
|
+
readonly scope?: TaskScope.Global | TaskScope.Workspace | WorkspaceFolder;
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* The task's name
|
|
444
|
+
*/
|
|
445
|
+
name: string;
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* A human-readable string which is rendered less prominently on a separate line in places
|
|
449
|
+
* where the task's name is displayed. Supports rendering of {@link ThemeIcon theme icons}
|
|
450
|
+
* via the `$(<name>)`-syntax.
|
|
451
|
+
*/
|
|
452
|
+
detail?: string;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* The task's execution engine
|
|
456
|
+
*/
|
|
457
|
+
execution?: ProcessExecution | ShellExecution | CustomExecution;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Whether the task is a background task or not.
|
|
461
|
+
*/
|
|
462
|
+
isBackground: boolean;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* A human-readable string describing the source of this
|
|
466
|
+
* shell task, e.g. 'gulp' or 'npm'.
|
|
467
|
+
*/
|
|
468
|
+
source: string;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* The task group this tasks belongs to. See TaskGroup
|
|
472
|
+
* for a predefined set of available groups.
|
|
473
|
+
* Defaults to undefined meaning that the task doesn't
|
|
474
|
+
* belong to any special group.
|
|
475
|
+
*/
|
|
476
|
+
group?: TaskGroup;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* The presentation options. Defaults to an empty literal.
|
|
480
|
+
*/
|
|
481
|
+
presentationOptions: TaskPresentationOptions;
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* The problem matchers attached to the task. Defaults to an empty
|
|
485
|
+
* array.
|
|
486
|
+
*/
|
|
487
|
+
problemMatchers: string[];
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Run options for the task
|
|
491
|
+
*/
|
|
492
|
+
runOptions: RunOptions;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* A task provider allows to add tasks to the task service.
|
|
497
|
+
* A task provider is registered via #tasks.registerTaskProvider.
|
|
498
|
+
*/
|
|
499
|
+
export interface TaskProvider<T extends Task = Task> {
|
|
500
|
+
/**
|
|
501
|
+
* Provides tasks.
|
|
502
|
+
* @param token A cancellation token.
|
|
503
|
+
* @return an array of tasks
|
|
504
|
+
*/
|
|
505
|
+
provideTasks(token: CancellationToken): ProviderResult<T[]>;
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Resolves a task that has no {@link Task.execution `execution`} set. Tasks are
|
|
509
|
+
* often created from information found in the `tasks.json`-file. Such tasks miss
|
|
510
|
+
* the information on how to execute them and a task provider must fill in
|
|
511
|
+
* the missing information in the `resolveTask`-method. This method will not be
|
|
512
|
+
* called for tasks returned from the above `provideTasks` method since those
|
|
513
|
+
* tasks are always fully resolved. A valid default implementation for the
|
|
514
|
+
* `resolveTask` method is to return `undefined`.
|
|
515
|
+
*
|
|
516
|
+
* Note that when filling in the properties of `task`, you _must_ be sure to
|
|
517
|
+
* use the exact same `TaskDefinition` and not create a new one. Other properties
|
|
518
|
+
* may be changed.
|
|
519
|
+
*
|
|
520
|
+
* @param task The task to resolve.
|
|
521
|
+
* @param token A cancellation token.
|
|
522
|
+
* @return The resolved task
|
|
523
|
+
*/
|
|
524
|
+
resolveTask(task: T, token: CancellationToken): ProviderResult<T>;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* An object representing an executed Task. It can be used
|
|
529
|
+
* to terminate a task.
|
|
530
|
+
*
|
|
531
|
+
* This interface is not intended to be implemented.
|
|
532
|
+
*/
|
|
533
|
+
export interface TaskExecution {
|
|
534
|
+
/**
|
|
535
|
+
* The task that got started.
|
|
536
|
+
*/
|
|
537
|
+
task: Task;
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Terminates the task execution.
|
|
541
|
+
*/
|
|
542
|
+
terminate(): void;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* An event signaling the start of a task execution.
|
|
547
|
+
*
|
|
548
|
+
* This interface is not intended to be implemented.
|
|
549
|
+
*/
|
|
550
|
+
interface TaskStartEvent {
|
|
551
|
+
/**
|
|
552
|
+
* The task item representing the task that got started.
|
|
553
|
+
*/
|
|
554
|
+
readonly execution: TaskExecution;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* An event signaling the end of an executed task.
|
|
559
|
+
*
|
|
560
|
+
* This interface is not intended to be implemented.
|
|
561
|
+
*/
|
|
562
|
+
interface TaskEndEvent {
|
|
563
|
+
/**
|
|
564
|
+
* The task item representing the task that finished.
|
|
565
|
+
*/
|
|
566
|
+
readonly execution: TaskExecution;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* An event signaling the start of a process execution
|
|
571
|
+
* triggered through a task
|
|
572
|
+
*/
|
|
573
|
+
export interface TaskProcessStartEvent {
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* The task execution for which the process got started.
|
|
577
|
+
*/
|
|
578
|
+
readonly execution: TaskExecution;
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* The underlying process id.
|
|
582
|
+
*/
|
|
583
|
+
readonly processId: number;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* An event signaling the end of a process execution
|
|
588
|
+
* triggered through a task
|
|
589
|
+
*/
|
|
590
|
+
export interface TaskProcessEndEvent {
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* The task execution for which the process got started.
|
|
594
|
+
*/
|
|
595
|
+
readonly execution: TaskExecution;
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* The process's exit code.
|
|
599
|
+
*/
|
|
600
|
+
readonly exitCode: number;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export interface TaskFilter {
|
|
604
|
+
/**
|
|
605
|
+
* The task version as used in the tasks.json file.
|
|
606
|
+
* The string support the package.json semver notation.
|
|
607
|
+
*/
|
|
608
|
+
version?: string;
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* The task type to return;
|
|
612
|
+
*/
|
|
613
|
+
type?: string;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Namespace for tasks functionality.
|
|
618
|
+
*/
|
|
619
|
+
export namespace tasks {
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Register a task provider.
|
|
623
|
+
*
|
|
624
|
+
* @param type The task kind type this provider is registered for.
|
|
625
|
+
* @param provider A task provider.
|
|
626
|
+
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
|
|
627
|
+
*/
|
|
628
|
+
export function registerTaskProvider(type: string, provider: TaskProvider): Disposable;
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Fetches all tasks available in the systems. This includes tasks
|
|
632
|
+
* from `tasks.json` files as well as tasks from task providers
|
|
633
|
+
* contributed through extensions.
|
|
634
|
+
*
|
|
635
|
+
* @param filter Optional filter to select tasks of a certain type or version.
|
|
636
|
+
*/
|
|
637
|
+
export function fetchTasks(filter?: TaskFilter): Thenable<Task[]>;
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Executes a task that is managed by VS Code. The returned
|
|
641
|
+
* task execution can be used to terminate the task.
|
|
642
|
+
*
|
|
643
|
+
* @param task the task to execute
|
|
644
|
+
*/
|
|
645
|
+
export function executeTask(task: Task): Thenable<TaskExecution>;
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* The currently active task executions or an empty array.
|
|
649
|
+
*/
|
|
650
|
+
export const taskExecutions: ReadonlyArray<TaskExecution>;
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Fires when a task starts.
|
|
654
|
+
*/
|
|
655
|
+
export const onDidStartTask: Event<TaskStartEvent>;
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Fires when a task ends.
|
|
659
|
+
*/
|
|
660
|
+
export const onDidEndTask: Event<TaskEndEvent>;
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Fires when the underlying process has been started.
|
|
664
|
+
* This event will not fire for tasks that don't
|
|
665
|
+
* execute an underlying process.
|
|
666
|
+
*/
|
|
667
|
+
export const onDidStartTaskProcess: Event<TaskProcessStartEvent>;
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Fires when the underlying process has ended.
|
|
671
|
+
* This event will not fire for tasks that don't
|
|
672
|
+
* execute an underlying process.
|
|
673
|
+
*/
|
|
674
|
+
export const onDidEndTaskProcess: Event<TaskProcessEndEvent>;
|
|
675
|
+
}
|
|
676
|
+
}
|