From 91dd61b9a662caf628a376d1e3b52b56b7ee8d31 Mon Sep 17 00:00:00 2001 From: Sahandevs Date: Tue, 9 Feb 2021 17:42:46 +0330 Subject: use await instead --- editors/code/src/run.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'editors/code/src/run.ts') diff --git a/editors/code/src/run.ts b/editors/code/src/run.ts index 331f85cd3..7ac7ca3cb 100644 --- a/editors/code/src/run.ts +++ b/editors/code/src/run.ts @@ -45,8 +45,7 @@ export async function selectRunnable(ctx: Ctx, prevRunnable?: RunnableQuickPick, if (items.length === 0) { // it is the debug case, run always has at least 'cargo check ...' // see crates\rust-analyzer\src\main_loop\handlers.rs, handle_runnables - vscode.window.showErrorMessage("There's no debug target!") - .then(() => { }, console.error); + await vscode.window.showErrorMessage("There's no debug target!"); return; } @@ -66,8 +65,8 @@ export async function selectRunnable(ctx: Ctx, prevRunnable?: RunnableQuickPick, disposables.push( quickPick.onDidHide(() => close()), quickPick.onDidAccept(() => close(quickPick.selectedItems[0])), - quickPick.onDidTriggerButton((_button) => { - makeDebugConfig(ctx, quickPick.activeItems[0].runnable).catch(console.error); + quickPick.onDidTriggerButton(async (_button) => { + await makeDebugConfig(ctx, quickPick.activeItems[0].runnable); close(); }), quickPick.onDidChangeActive((active) => { -- cgit v1.2.3