From 5e5fa3edde19d38ac512d65ccefe2a12ecab025a Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Thu, 16 Jul 2020 14:42:02 +0200 Subject: [PATCH] Tasks without a registered definition should run (#102696) Fixes #102684 --- .../src/singlefolder-tests/workspace.tasks.test.ts | 6 +++--- .../workbench/contrib/tasks/browser/abstractTaskService.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.tasks.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.tasks.test.ts index fc670adc225..4ec107c23be 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.tasks.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.tasks.test.ts @@ -18,7 +18,7 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx disposables.length = 0; }); - test.skip('CustomExecution task should start and shutdown successfully', (done) => { + test('CustomExecution task should start and shutdown successfully', (done) => { interface CustomTestingTaskDefinition extends TaskDefinition { /** * One of the task properties. This can be used to customize the task in the tasks.json @@ -110,7 +110,7 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx commands.executeCommand('workbench.action.tasks.runTask', `${taskType}: ${taskName}`); }); - test.skip('sync CustomExecution task should flush all data on close', (done) => { + test('sync CustomExecution task should flush all data on close', (done) => { interface CustomTestingTaskDefinition extends TaskDefinition { /** * One of the task properties. This can be used to customize the task in the tasks.json @@ -222,7 +222,7 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx }); // https://github.com/microsoft/vscode/issues/100577 - test.skip('A CustomExecution task can be fetched and executed', () => { + test('A CustomExecution task can be fetched and executed', () => { return new Promise(async (resolve, reject) => { class CustomTerminal implements Pseudoterminal { private readonly writeEmitter = new EventEmitter(); diff --git a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts index 315f7f78bda..1f84fabf713 100644 --- a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts +++ b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts @@ -1584,7 +1584,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer private isTaskProviderEnabled(type: string) { const definition = TaskDefinitionRegistry.get(type); - return !definition.when || this.contextKeyService.contextMatchesRules(definition.when); + return !definition || !definition.when || this.contextKeyService.contextMatchesRules(definition.when); } private getGroupedTasks(type?: string): Promise { -- GitLab