Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

don't prompt the user if only one toolcahin is present #388

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down