diff options
| author | Vadzim Dambrouski <vadzim.dambrouski@promwad.com> | 2019-12-15 23:02:13 +0530 |
|---|---|---|
| committer | Vadzim Dambrouski <vadzim.dambrouski@promwad.com> | 2019-12-15 23:32:13 +0530 |
| commit | a85cd6455a66ca75ba9991d91acf36f55cb74e8c (patch) | |
| tree | 356d7b61e93d1aad261dba959afafc231d163441 /editors/code/src | |
| parent | 4e24b25c669965cf6a68c4b8e775cc83615d978a (diff) | |
| download | rust-a85cd6455a66ca75ba9991d91acf36f55cb74e8c.tar.gz rust-a85cd6455a66ca75ba9991d91acf36f55cb74e8c.zip | |
Add option to disable all-targets.
Can be useful in embedded.
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/commands/cargo_watch.ts | 5 | ||||
| -rw-r--r-- | editors/code/src/config.ts | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/editors/code/src/commands/cargo_watch.ts b/editors/code/src/commands/cargo_watch.ts index 512362eb188..45f1dd49f46 100644 --- a/editors/code/src/commands/cargo_watch.ts +++ b/editors/code/src/commands/cargo_watch.ts @@ -83,7 +83,10 @@ export class CargoWatchProvider implements vscode.Disposable { let args = Server.config.cargoWatchOptions.command + - ' --all-targets --message-format json'; + ' --message-format json'; + if (Server.config.cargoWatchOptions.allTargets) { + args += ' --all-targets'; + } if (Server.config.cargoWatchOptions.command.length > 0) { // Excape the double quote string: args += ' ' + Server.config.cargoWatchOptions.arguments; diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index defdfeb9c4b..a6e0f6454f1 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -13,6 +13,7 @@ export interface CargoWatchOptions { command: string; trace: CargoWatchTraceOptions; ignore: string[]; + allTargets: boolean; } export interface CargoFeatures { @@ -40,6 +41,7 @@ export class Config { arguments: '', command: '', ignore: [], + allTargets: true, }; public cargoFeatures: CargoFeatures = { noDefaultFeatures: false, @@ -132,6 +134,13 @@ export class Config { ); } + if (config.has('cargo-watch.allTargets')) { + this.cargoWatchOptions.allTargets = config.get<boolean>( + 'cargo-watch.allTargets', + true, + ); + } + if (config.has('lruCapacity')) { this.lruCapacity = config.get('lruCapacity') as number; } |
