aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-04-03 10:02:24 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-04-03 10:02:24 +0100
commitb8e58d4a2f317fe300f13416858f33e860138c4d (patch)
tree9ca28e044e110fba364bbb77d90d08464bd26a2a
parentfdbebccd71d38c4dffffe918b036bbfa39355c5f (diff)
parentb8ea91ae2d94f11f003df6ab36c3761dd2932362 (diff)
Merge #1097
1097: Fix VSCode cargo-watch functionality on Linux. r=matklad a=kiljacken As of #1079 the VSCode cargo-watch functionality has been broken on Linux systems. The cause seems to be that linux takes the added quotes inside process arguments literally, so it attempts to make cargo-watch run the command `cargo "check --message-format json"` with the entire quoted part being treated as a single long subcommand, which cargo doesn't know how to handle. Removing the extra quotes solves the issue. Closes #1096 Co-authored-by: Emil Lauridsen <[email protected]>
-rw-r--r--editors/code/src/commands/cargo_watch.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/editors/code/src/commands/cargo_watch.ts b/editors/code/src/commands/cargo_watch.ts
index d45d0e7d1..32bd38a1c 100644
--- a/editors/code/src/commands/cargo_watch.ts
+++ b/editors/code/src/commands/cargo_watch.ts
@@ -46,12 +46,15 @@ export class CargoWatchProvider {
46 'Cargo Watch Trace' 46 'Cargo Watch Trace'
47 ); 47 );
48 48
49 let args = '"check --message-format json'; 49 let args = 'check --message-format json';
50 if (Server.config.cargoWatchOptions.checkArguments.length > 0) { 50 if (Server.config.cargoWatchOptions.checkArguments.length > 0) {
51 // Excape the double quote string: 51 // Excape the double quote string:
52 args += ' ' + Server.config.cargoWatchOptions.checkArguments; 52 args += ' ' + Server.config.cargoWatchOptions.checkArguments;
53 } 53 }
54 args += '"'; 54 // Windows handles arguments differently than the unix-likes, so we need to wrap the args in double quotes
55 if (process.platform === 'win32') {
56 args = '"' + args + '"';
57 }
55 58
56 // Start the cargo watch with json message 59 // Start the cargo watch with json message
57 this.cargoProcess = child_process.spawn( 60 this.cargoProcess = child_process.spawn(