Skip to content

Commit

Permalink
[GR-27376] Fix removal of configurations when not accepted.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondrej-Douda committed Nov 12, 2020
1 parent d6fa468 commit bf44f05
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions vscode/graalvm/src/graalVMConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,22 @@ async function configureInteractive(graalVMHome: string) {
return show;
});
if (toShow.length > 0) {
const selected: ConfigurationPickItem[] = await vscode.window.showQuickPick(
const selected: ConfigurationPickItem[] | undefined = await vscode.window.showQuickPick(
toShow, {
canPickMany: true,
placeHolder: 'Configure active GraalVM'
}) || [];

for (const shown of toShow) {
try {
if (selected.includes(shown)) {
await shown.set(graalVMHome);
} else {
await shown.unset(graalVMHome);
});
if (selected) {
for (const shown of toShow) {
try {
if (selected.includes(shown)) {
await shown.set(graalVMHome);
} else {
await shown.unset(graalVMHome);
}
} catch (error) {
vscode.window.showErrorMessage(error?.message);
}
} catch (error) {
vscode.window.showErrorMessage(error?.message);
}
}
}
Expand Down

0 comments on commit bf44f05

Please sign in to comment.