]> Git Repo - pico-vscode.git/blob - src/commands/compileProject.mts
Add support for cmake-tools extension
[pico-vscode.git] / src / commands / compileProject.mts
1 import { tasks, window } from "vscode";
2 import { Command } from "./command.mjs";
3 import Logger from "../logger.mjs";
4
5 export default class CompileProjectCommand extends Command {
6   private _logger: Logger = new Logger("CompileProjectCommand");
7
8   public static readonly id = "compileProject";
9
10   constructor() {
11     super(CompileProjectCommand.id);
12   }
13
14   async execute(): Promise<void> {
15     // Get the task with the specified name
16     const task = (await tasks.fetchTasks()).find(task => () => {
17       console.log(`[TASK] ${task.name}`);
18
19       return task.name === "Compile Project";
20     });
21
22     if (task) {
23       // Execute the task
24       await tasks.executeTask(task);
25     } else {
26       // Task not found
27       this._logger.error("Task 'Compile Project' not found.");
28       void window.showErrorMessage("Task 'Compile Project' not found.");
29     }
30
31     return;
32   }
33 }
This page took 0.02724 seconds and 4 git commands to generate.