Skip to content

Commit 5e5fa3e

Browse files
authored
Tasks without a registered definition should run (microsoft#102696)
Fixes microsoft#102684
1 parent a786284 commit 5e5fa3e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

extensions/vscode-api-tests/src/singlefolder-tests/workspace.tasks.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx
1818
disposables.length = 0;
1919
});
2020

21-
test.skip('CustomExecution task should start and shutdown successfully', (done) => {
21+
test('CustomExecution task should start and shutdown successfully', (done) => {
2222
interface CustomTestingTaskDefinition extends TaskDefinition {
2323
/**
2424
* 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
110110
commands.executeCommand('workbench.action.tasks.runTask', `${taskType}: ${taskName}`);
111111
});
112112

113-
test.skip('sync CustomExecution task should flush all data on close', (done) => {
113+
test('sync CustomExecution task should flush all data on close', (done) => {
114114
interface CustomTestingTaskDefinition extends TaskDefinition {
115115
/**
116116
* 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
222222
});
223223

224224
// https://github.com/microsoft/vscode/issues/100577
225-
test.skip('A CustomExecution task can be fetched and executed', () => {
225+
test('A CustomExecution task can be fetched and executed', () => {
226226
return new Promise(async (resolve, reject) => {
227227
class CustomTerminal implements Pseudoterminal {
228228
private readonly writeEmitter = new EventEmitter<string>();

src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
15841584

15851585
private isTaskProviderEnabled(type: string) {
15861586
const definition = TaskDefinitionRegistry.get(type);
1587-
return !definition.when || this.contextKeyService.contextMatchesRules(definition.when);
1587+
return !definition || !definition.when || this.contextKeyService.contextMatchesRules(definition.when);
15881588
}
15891589

15901590
private getGroupedTasks(type?: string): Promise<TaskMap> {

0 commit comments

Comments
 (0)