4528: Debug lens fix for a binary. r=matklad a=vsrs

Fixes an issue reported here: https://github.com/rust-analyzer/rust-analyzer/pull/4222#issuecomment-631073448

Co-authored-by: vsrs <vit@conrlab.com>
This commit is contained in:
bors[bot] 2020-05-20 07:57:49 +00:00 committed by GitHub
commit 5d080dd024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);