]> Git Repo - pico-vscode.git/blob - src/commands/configureCmake.mts
Merge pull request #42 from paulober/docs-update
[pico-vscode.git] / src / commands / configureCmake.mts
1 import { Command } from "./command.mjs";
2 import Logger from "../logger.mjs";
3 import { window, workspace } from "vscode";
4 import { configureCmakeNinja } from "../utils/cmakeUtil.mjs";
5
6 export default class ConfigureCmakeCommand extends Command {
7   private _logger: Logger = new Logger("ConfigureCmakeCommand");
8
9   public static readonly id = "configureCmake";
10
11   constructor() {
12     super(ConfigureCmakeCommand.id);
13   }
14
15   async execute(): Promise<void> {
16     const workspaceFolder = workspace.workspaceFolders?.[0];
17
18     // check if is a pico project
19     if (workspaceFolder === undefined) {
20       this._logger.warn("No workspace folder found.");
21       await window.showWarningMessage("No workspace folder found.");
22
23       return;
24     }
25
26     await configureCmakeNinja(workspaceFolder.uri);
27     await window.showInformationMessage("CMake has configured your build.");
28   }
29 }
This page took 0.025023 seconds and 4 git commands to generate.