From d264d7b9f264c31fe2b1ea7e623611a816979789 Mon Sep 17 00:00:00 2001 From: vsrs Date: Wed, 20 May 2020 09:42:00 +0300 Subject: Debug lens fix for a binary. --- editors/code/src/cargo.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'editors/code') diff --git a/editors/code/src/cargo.ts b/editors/code/src/cargo.ts index 28c7de992..6a41873d0 100644 --- a/editors/code/src/cargo.ts +++ b/editors/code/src/cargo.ts @@ -51,10 +51,14 @@ export class Cargo { // arguments for a runnable from the quick pick should be updated. // see crates\rust-analyzer\src\main_loop\handlers.rs, handle_code_lens - if (cargoArgs[0] === "run") { - cargoArgs[0] = "build"; - } else if (cargoArgs.indexOf("--no-run") === -1) { - cargoArgs.push("--no-run"); + switch (cargoArgs[0]) { + case "run": cargoArgs[0] = "build"; break; + case "test": { + if (cargoArgs.indexOf("--no-run") === -1) { + cargoArgs.push("--no-run"); + } + break; + } } let artifacts = await this.artifactsFromArgs(cargoArgs); -- cgit v1.2.3