From f4d50de2758b38208745d9594ccbcf0227d49d5b Mon Sep 17 00:00:00 2001 From: Roberto Vidal Date: Thu, 17 Oct 2019 15:22:39 +0200 Subject: Adds config option for cargo-watch `--ignore` flag --- editors/code/src/commands/cargo_watch.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'editors/code/src/commands') diff --git a/editors/code/src/commands/cargo_watch.ts b/editors/code/src/commands/cargo_watch.ts index 00b24dbce..59d4ba97a 100644 --- a/editors/code/src/commands/cargo_watch.ts +++ b/editors/code/src/commands/cargo_watch.ts @@ -93,10 +93,15 @@ export class CargoWatchProvider implements vscode.Disposable { args = '"' + args + '"'; } + const ignoreFlags = Server.config.cargoWatchOptions.ignore.reduce( + (flags, pattern) => [...flags, '--ignore', pattern], + [] as string[] + ); + // Start the cargo watch with json message this.cargoProcess = child_process.spawn( 'cargo', - ['watch', '-x', args], + ['watch', '-x', args, ...ignoreFlags], { stdio: ['ignore', 'pipe', 'pipe'], cwd: vscode.workspace.rootPath, -- cgit v1.2.3