提交 101ff0ab 编写于 作者: D Dirk Baeumer

Fixes #29759: More Task API feedback

上级 60a2c5e1
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册