aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/commands/cargo_watch.ts7
-rw-r--r--editors/code/src/config.ts11
2 files changed, 16 insertions, 2 deletions
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 {
93 args = '"' + args + '"'; 93 args = '"' + args + '"';
94 } 94 }
95 95
96 const ignoreFlags = Server.config.cargoWatchOptions.ignore.reduce(
97 (flags, pattern) => [...flags, '--ignore', pattern],
98 [] as string[]
99 );
100
96 // Start the cargo watch with json message 101 // Start the cargo watch with json message
97 this.cargoProcess = child_process.spawn( 102 this.cargoProcess = child_process.spawn(
98 'cargo', 103 'cargo',
99 ['watch', '-x', args], 104 ['watch', '-x', args, ...ignoreFlags],
100 { 105 {
101 stdio: ['ignore', 'pipe', 'pipe'], 106 stdio: ['ignore', 'pipe', 'pipe'],
102 cwd: vscode.workspace.rootPath, 107 cwd: vscode.workspace.rootPath,
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index 2578bc6d1..331936b5e 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -12,6 +12,7 @@ export interface CargoWatchOptions {
12 arguments: string; 12 arguments: string;
13 command: string; 13 command: string;
14 trace: CargoWatchTraceOptions; 14 trace: CargoWatchTraceOptions;
15 ignore: string[];
15} 16}
16 17
17export class Config { 18export class Config {
@@ -30,7 +31,8 @@ export class Config {
30 enableOnStartup: 'ask', 31 enableOnStartup: 'ask',
31 trace: 'off', 32 trace: 'off',
32 arguments: '', 33 arguments: '',
33 command: '' 34 command: '',
35 ignore: []
34 }; 36 };
35 37
36 private prevEnhancedTyping: null | boolean = null; 38 private prevEnhancedTyping: null | boolean = null;
@@ -125,6 +127,13 @@ export class Config {
125 ); 127 );
126 } 128 }
127 129
130 if (config.has('cargo-watch.ignore')) {
131 this.cargoWatchOptions.ignore = config.get<string[]>(
132 'cargo-watch.ignore',
133 []
134 );
135 }
136
128 if (config.has('lruCapacity')) { 137 if (config.has('lruCapacity')) {
129 this.lruCapacity = config.get('lruCapacity') as number; 138 this.lruCapacity = config.get('lruCapacity') as number;
130 } 139 }