mirror of
https://github.com/Microsoft/vscode
synced 2024-11-05 18:29:38 +00:00
Fixes #29759: More Task API feedback
This commit is contained in:
parent
60a2c5e140
commit
101ff0abb8
3 changed files with 11 additions and 10 deletions
9
src/vs/vscode.proposed.d.ts
vendored
9
src/vs/vscode.proposed.d.ts
vendored
|
@ -117,7 +117,7 @@ declare module 'vscode' {
|
|||
/**
|
||||
* The rebuild all task group;
|
||||
*/
|
||||
public static RebuildAll: TaskGroup;
|
||||
public static Rebuild: TaskGroup;
|
||||
|
||||
/**
|
||||
* The test all task group;
|
||||
|
@ -146,6 +146,11 @@ declare module 'vscode' {
|
|||
* ```
|
||||
*/
|
||||
readonly type: string;
|
||||
|
||||
/**
|
||||
* Additional attributes of a concrete task definition.
|
||||
*/
|
||||
[name: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -298,7 +303,7 @@ declare module 'vscode' {
|
|||
* A human-readable string describing the source of this
|
||||
* shell task, e.g. 'gulp' or 'npm'.
|
||||
*/
|
||||
source?: string;
|
||||
source: string;
|
||||
|
||||
/**
|
||||
* The task group this tasks belongs to. See TaskGroup
|
||||
|
|
|
@ -1040,7 +1040,7 @@ export class TaskGroup implements vscode.TaskGroup {
|
|||
|
||||
public static Build: TaskGroup = new TaskGroup('build', 'Build');
|
||||
|
||||
public static RebuildAll: TaskGroup = new TaskGroup('rebuildAll', 'RebuildAll');
|
||||
public static Rebuild: TaskGroup = new TaskGroup('rebuild', 'Rebuild');
|
||||
|
||||
public static Test: TaskGroup = new TaskGroup('clean', 'Clean');
|
||||
|
||||
|
@ -1248,10 +1248,6 @@ export class Task implements vscode.Task {
|
|||
}
|
||||
|
||||
set source(value: string) {
|
||||
if (value === void 0 || value === null) {
|
||||
this._source = undefined;
|
||||
return;
|
||||
}
|
||||
if (typeof value !== 'string' || value.length === 0) {
|
||||
throw illegalArgument('source must be a string of length > 0');
|
||||
}
|
||||
|
|
|
@ -203,16 +203,16 @@ export namespace TaskGroup {
|
|||
|
||||
export const Build: 'build' = 'build';
|
||||
|
||||
export const RebuildAll: 'rebuildAll' = 'rebuildAll';
|
||||
export const Rebuild: 'rebuild' = 'rebuild';
|
||||
|
||||
export const Test: 'test' = 'test';
|
||||
|
||||
export function is(value: string): value is string {
|
||||
return value === Clean || value === Build || value === RebuildAll || value === Test;
|
||||
return value === Clean || value === Build || value === Rebuild || value === Test;
|
||||
}
|
||||
}
|
||||
|
||||
export type TaskGroup = 'clean' | 'build' | 'rebuildAll' | 'test';
|
||||
export type TaskGroup = 'clean' | 'build' | 'rebuild' | 'test';
|
||||
|
||||
export enum TaskSourceKind {
|
||||
Workspace = 1,
|
||||
|
|
Loading…
Reference in a new issue