From 4225b24808492120e4aec8dec3f9b084a3d81ca8 Mon Sep 17 00:00:00 2001 From: Sam Miller Date: Wed, 18 Sep 2024 23:24:55 -0700 Subject: [PATCH] Fix extension activation 'Illegal argument: commandLine' --- src/extension.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/extension.ts b/src/extension.ts index 6445580..62fd9b7 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -92,6 +92,10 @@ export function activate(context: vscode.ExtensionContext): IMyExtensionApi { context.subscriptions.push( vscode.tasks.registerTaskProvider("phpunit", { provideTasks: () => { + // If taskCommand hasn't been initialized yet we aren't ready to register tasks yet. + // Fail silently because this will be called again later once taskCommand has been initialized. + if (!taskCommand) return []; + return [ new vscode.Task( { type: "phpunit", task: "run" },