From e47a6661c60fefa16e0c1f3d126fcc3561523686 Mon Sep 17 00:00:00 2001 From: Zyad Hassan Date: Wed, 17 May 2023 10:37:02 -0700 Subject: [PATCH] Tweaks suggested by jaisnan --- src/extension.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 976d1d1..5f0fce2 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -34,14 +34,15 @@ export async function activate(context: vscode.ExtensionContext): Promise if (!checkCargoExist()) { showErrorWithReportIssueButton('Cannot find Cargo.toml to run Cargo Kani on crate'); } - getKaniPath('cargo-kani').catch((error) => { + try { + // GET binary path + const kaniBinaryPath = await getKaniPath('cargo-kani'); + } catch (error) { showErrorWithReportIssueButton( - 'The Kani executable was not found in PATH. Please install it using the instructions at https://model-checking.github.io/kani/install-guide.html and/or make sure it is in your PATH.', + 'The Kani executable was not found in PATH. Please install it using the instructions at https://model-checking.github.io/kani/install-guide.html and/or make sure it is in your PATH.', ); - return new Promise((resolve, reject) => { - reject(new Error(`Failed to launch Kani extension`)); - }); - }); + return; + } const controller: vscode.TestController = vscode.tests.createTestController( 'Kani Proofs',