Allow workspace tasks to be executed through API

Fixes #104408
This commit is contained in:
Alex Ross
2020-08-12 14:46:04 +02:00
parent a1b655340b
commit 52e38713f2
3 changed files with 32 additions and 12 deletions

View File

@@ -192,12 +192,16 @@ export namespace CustomExecutionDTO {
export namespace TaskHandleDTO {
export function from(value: types.Task): tasks.TaskHandleDTO {
export function from(value: types.Task, workspaceService?: IExtHostWorkspace): tasks.TaskHandleDTO {
let folder: UriComponents | string;
if (value.scope !== undefined && typeof value.scope !== 'number') {
folder = value.scope.uri;
} else if (value.scope !== undefined && typeof value.scope === 'number') {
folder = USER_TASKS_GROUP_KEY;
if ((value.scope === types.TaskScope.Workspace) && workspaceService && workspaceService.workspaceFile) {
folder = workspaceService.workspaceFile;
} else {
folder = USER_TASKS_GROUP_KEY;
}
}
return {
id: value._id!,