Skip to content

Commit dfd447d

Browse files
committed
Also early return if install failed.
1 parent e4ae40c commit dfd447d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/extension.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,22 @@ export async function activate(context: vscode.ExtensionContext)
2525
const choice = await vscode.window.showInformationMessage(message, 'Install', 'Not now');
2626
if (choice === 'Install') {
2727
// Wait for extension to be correctly installed.
28-
await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification },
28+
let installed = await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification },
2929
(progress) => {
3030
progress.report({ message: "Installing Microsoft WASM wasi core extension" });
3131
return vscode.commands.executeCommand("workbench.extensions.installExtension", msWasmWasiCoreName);
3232
},
3333
).then(success => {
3434
console.assert(vscode.extensions.getExtension(msWasmWasiCoreName) !== undefined, "Failed to load WASM wasi core.");
3535
vscode.window.showInformationMessage("Microsoft WASM wasi core extension installed with success !");
36+
return true;
3637
}, failure => {
3738
vscode.window.showErrorMessage(`Failed to install Microsoft WASM wasi core: ${failure} You will have to install ms-vscode.wasm-wasi-core yourself through the extensions tab.`);
39+
return false;
3840
});
41+
if (!installed) {
42+
return;
43+
}
3944
} else {
4045
vscode.window.showErrorMessage("Extension shader-validator failed to install dependencies. It will not launch the shader language server.");
4146
return; // Extension failed to launch.

0 commit comments

Comments
 (0)