diff --git a/src/Toolchain/DefaultToolchain.ts b/src/Toolchain/DefaultToolchain.ts index 1f711ca7..110b9c09 100644 --- a/src/Toolchain/DefaultToolchain.ts +++ b/src/Toolchain/DefaultToolchain.ts @@ -17,6 +17,7 @@ import * as vscode from "vscode"; import { Toolchain } from "../Backend/Toolchain"; +import { Logger } from "../Utils/Logger"; import { ToolchainEnv } from "./ToolchainEnv"; class DefaultToolchain { @@ -32,49 +33,15 @@ class DefaultToolchain { return this._instance || (this._instance = new this()); } - /* istanbul ignore next */ - public async ask( - toolchainEnv: ToolchainEnv, - toolchain: Toolchain - ): Promise { - return new Promise((resolve, reject) => { - const name = `${toolchain.info.name}-${toolchain.info.version?.str()}`; - vscode.window - .showInformationMessage( - `Do you want to use ${name} as a default toolchain?`, - "Yes", - "No" - ) - .then((answer) => { - if (answer === "Yes") { - this.set(toolchainEnv, toolchain); - return resolve(true); - } else { - return reject(null); - } - }); - }); - } - public set(toolchainEnv: ToolchainEnv, toolchain: Toolchain) { if (this.isEqual(toolchain)) { return; } this._toolchainEnv = toolchainEnv; this._toolchain = toolchain; + const name = `${toolchain.info.name}-${toolchain.info.version?.str()}`; - /* istanbul ignore next */ - vscode.window - .showInformationMessage( - `${name} was set as a default toolchain.`, - "OK", - `See Instructions` - ) - .then((value) => { - if (value === "See Instructions") { - this.openDocument(); - } - }); + Logger.debug("DefaultToolchain", `${name} was set as a default toolchain.`); } public unset() { diff --git a/src/Toolchain/ToolchainProvider.ts b/src/Toolchain/ToolchainProvider.ts index 99b86a16..697e7864 100644 --- a/src/Toolchain/ToolchainProvider.ts +++ b/src/Toolchain/ToolchainProvider.ts @@ -175,14 +175,6 @@ export class ToolchainProvider implements vscode.TreeDataProvider { public _notifyInstalled(toolchainEnv: ToolchainEnv, toolchain: Toolchain) { const name = `${toolchain.info.name}-${toolchain.info.version?.str()}`; vscode.window.showInformationMessage(`Installed ${name} successfully.`); - if ( - Object.keys(gToolchainEnvMap).length > 1 || - toolchainEnv.listInstalled().length > 1 - ) { - DefaultToolchain.getInstance() - .ask(toolchainEnv, toolchain) - .then(() => this.refresh()); - } this.refresh(); vscode.commands.executeCommand("one.device.refresh"); }