]> git.lizzy.rs Git - rust.git/commitdiff
Debug lens fix for a binary.
authorvsrs <vit@conrlab.com>
Wed, 20 May 2020 06:42:00 +0000 (09:42 +0300)
committervsrs <vit@conrlab.com>
Wed, 20 May 2020 06:42:00 +0000 (09:42 +0300)
editors/code/src/cargo.ts

index 28c7de992b4dd4cf335e7daa4690f5b26fc67f40..6a41873d0067b5438472a7c9ae140582be946983 100644 (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);