From 07427d3d3cccd11fbd1c890f135257051c710b32 Mon Sep 17 00:00:00 2001 From: shakram02 Date: Sat, 20 Oct 2018 18:40:07 +0200 Subject: [PATCH] don't prompt the user if one toolcahin only is present --- src/extension.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index 39efcf5..d317efb 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -429,12 +429,18 @@ async function handleMissingRustupUserToolchain( } const functionLogger = logger.createChildLogger('handleMissingRustupUserToolchain: '); functionLogger.debug(`toolchainKind=${toolchainKind}`); - await window.showInformationMessage(`To properly function, the extension needs to know what ${toolchainKind} you want to use`); const toolchains = getToolchains(); if (toolchains.length === 0) { functionLogger.error('no toolchains'); return; } + + if(toolchains.length === 1){ + setToolchain(toolchains[0]); + return; + } + + await window.showInformationMessage(`To properly function, the extension needs to know what ${toolchainKind} you want to use`); const toolchainsHaveOneHost = toolchains.every(t => t.host === toolchains[0].host); const items = toolchains.map(t => new Item(t, !toolchainsHaveOneHost)); const item = await window.showQuickPick(items);