Skip to content

Commit 5d080dd

Browse files
bors[bot]vsrs
andauthored
Merge #4528
4528: Debug lens fix for a binary. r=matklad a=vsrs Fixes an issue reported here: #4222 (comment) Co-authored-by: vsrs <vit@conrlab.com>
2 parents c0bcaea + d264d7b commit 5d080dd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

editors/code/src/cargo.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,14 @@ export class Cargo {
5151

5252
// arguments for a runnable from the quick pick should be updated.
5353
// see crates\rust-analyzer\src\main_loop\handlers.rs, handle_code_lens
54-
if (cargoArgs[0] === "run") {
55-
cargoArgs[0] = "build";
56-
} else if (cargoArgs.indexOf("--no-run") === -1) {
57-
cargoArgs.push("--no-run");
54+
switch (cargoArgs[0]) {
55+
case "run": cargoArgs[0] = "build"; break;
56+
case "test": {
57+
if (cargoArgs.indexOf("--no-run") === -1) {
58+
cargoArgs.push("--no-run");
59+
}
60+
break;
61+
}
5862
}
5963

6064
let artifacts = await this.artifactsFromArgs(cargoArgs);

0 commit comments

Comments
 (0)