diff options
Diffstat (limited to 'editors/code/src/tasks.ts')
-rw-r--r-- | editors/code/src/tasks.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/editors/code/src/tasks.ts b/editors/code/src/tasks.ts index 14abbd5b7..a3ff15102 100644 --- a/editors/code/src/tasks.ts +++ b/editors/code/src/tasks.ts | |||
@@ -13,6 +13,7 @@ export interface CargoTaskDefinition extends vscode.TaskDefinition { | |||
13 | args?: string[]; | 13 | args?: string[]; |
14 | cwd?: string; | 14 | cwd?: string; |
15 | env?: { [key: string]: string }; | 15 | env?: { [key: string]: string }; |
16 | overrideCargo?: string; | ||
16 | } | 17 | } |
17 | 18 | ||
18 | class CargoTaskProvider implements vscode.TaskProvider { | 19 | class CargoTaskProvider implements vscode.TaskProvider { |
@@ -98,7 +99,14 @@ export async function buildCargoTask( | |||
98 | } | 99 | } |
99 | 100 | ||
100 | if (!exec) { | 101 | if (!exec) { |
101 | exec = new vscode.ShellExecution(toolchain.cargoPath(), args, definition); | 102 | // Check whether we must use a user-defined substitute for cargo. |
103 | const cargoCommand = definition.overrideCargo ? definition.overrideCargo : toolchain.cargoPath(); | ||
104 | |||
105 | // Prepare the whole command as one line. It is required if user has provided override command which contains spaces, | ||
106 | // for example "wrapper cargo". Without manual preparation the overridden command will be quoted and fail to execute. | ||
107 | const fullCommand = [cargoCommand, ...args].join(" "); | ||
108 | |||
109 | exec = new vscode.ShellExecution(fullCommand, definition); | ||
102 | } | 110 | } |
103 | 111 | ||
104 | return new vscode.Task( | 112 | return new vscode.Task( |