aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/proc_macro_srv/src/tests/utils.rs2
-rw-r--r--editors/code/src/tasks.ts12
2 files changed, 7 insertions, 7 deletions
diff --git a/crates/proc_macro_srv/src/tests/utils.rs b/crates/proc_macro_srv/src/tests/utils.rs
index f0a514b32..2e950c113 100644
--- a/crates/proc_macro_srv/src/tests/utils.rs
+++ b/crates/proc_macro_srv/src/tests/utils.rs
@@ -16,7 +16,7 @@ pub mod fixtures {
16 let name = "proc_macro_test"; 16 let name = "proc_macro_test";
17 let version = "0.0.0"; 17 let version = "0.0.0";
18 let command = Command::new(toolchain::cargo()) 18 let command = Command::new(toolchain::cargo())
19 .args(&["build", "-p", name, "--message-format", "json"]) 19 .args(&["check", "--tests", "--message-format", "json"])
20 .output() 20 .output()
21 .unwrap() 21 .unwrap()
22 .stdout; 22 .stdout;
diff --git a/editors/code/src/tasks.ts b/editors/code/src/tasks.ts
index 694ee1e41..947b3f2e4 100644
--- a/editors/code/src/tasks.ts
+++ b/editors/code/src/tasks.ts
@@ -80,7 +80,7 @@ export async function buildCargoTask(
80 throwOnError: boolean = false 80 throwOnError: boolean = false
81): Promise<vscode.Task> { 81): Promise<vscode.Task> {
82 82
83 let exec: vscode.ShellExecution | undefined = undefined; 83 let exec: vscode.ProcessExecution | vscode.ShellExecution | undefined = undefined;
84 84
85 if (customRunner) { 85 if (customRunner) {
86 const runnerCommand = `${customRunner}.buildShellExecution`; 86 const runnerCommand = `${customRunner}.buildShellExecution`;
@@ -105,13 +105,13 @@ export async function buildCargoTask(
105 105
106 if (!exec) { 106 if (!exec) {
107 // Check whether we must use a user-defined substitute for cargo. 107 // Check whether we must use a user-defined substitute for cargo.
108 const cargoCommand = definition.overrideCargo ? definition.overrideCargo : toolchain.cargoPath(); 108 // Split on spaces to allow overrides like "wrapper cargo".
109 const overrideCargo = definition.overrideCargo ?? definition.overrideCargo;
110 const cargoCommand = overrideCargo?.split(" ") ?? [toolchain.cargoPath()];
109 111
110 // Prepare the whole command as one line. It is required if user has provided override command which contains spaces, 112 const fullCommand = [...cargoCommand, ...args];
111 // for example "wrapper cargo". Without manual preparation the overridden command will be quoted and fail to execute.
112 const fullCommand = [cargoCommand, ...args].join(" ");
113 113
114 exec = new vscode.ShellExecution(fullCommand, definition); 114 exec = new vscode.ProcessExecution(fullCommand[0], fullCommand.slice(1), definition);
115 } 115 }
116 116
117 return new vscode.Task( 117 return new vscode.Task(