Hi,
I’m developing my first Theia extension and am struggling with the documentation (or lack thereof) about running tasks.
I added @theia/task
to my Theia project, and described three basic tasks (shell processes running commands) in .theia/tasks.json
which ran successfully when started from the command palette.
Next step is to start these tasks from my extension command. I started drafting it up that way:
@injectable()
export class TheiaEmulatorExtensionCommandContribution implements CommandContribution {
constructor(
@inject(MessageService) private readonly messageService: MessageService,
@inject(TaskService) private readonly taskService: TaskService
) { }
registerCommands(registry: CommandRegistry): void {
registry.registerCommand(TheiaEmulatorExtensionCommand, {
execute: () => {
this.taskService.run(???); // not sure about the parameters
this.messageService.info('Build started.');
}
});
}
}
There I inject the TaskService in order to use its run()
method, but I’m not sure about the arguments I should pass there. According to the prototype:
token: number, source: string, taskLabel: string, scope: TaskConfigurationScope
I’m pretty sure I know what my taskLabel
is, but that’s about it …
Could someone provide me with any pointer?
Thank you!