From a4ecaa70969067c1149711dbf1f40a8a95cb5b72 Mon Sep 17 00:00:00 2001 From: vsrs Date: Fri, 15 May 2020 15:31:09 +0300 Subject: Fix occasional test run during debug configuration --- editors/code/src/cargo.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/editors/code/src/cargo.ts b/editors/code/src/cargo.ts index 4ff24ea7d..28c7de992 100644 --- a/editors/code/src/cargo.ts +++ b/editors/code/src/cargo.ts @@ -48,9 +48,13 @@ export class Cargo { async executableFromArgs(args: readonly string[]): Promise { const cargoArgs = [...args, "--message-format=json"]; + + // 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") { - // a runnable from the quick pick. cargoArgs[0] = "build"; + } else if (cargoArgs.indexOf("--no-run") === -1) { + cargoArgs.push("--no-run"); } let artifacts = await this.artifactsFromArgs(cargoArgs); -- cgit v1.2.3