From 02e450f354ccd978c90425929c635139210843a3 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 2 Apr 2019 14:43:02 +0800 Subject: Add cargo-watch.check-arguments --- editors/code/src/config.ts | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'editors/code/src/config.ts') diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index c95d13878..481a5e5f1 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -8,16 +8,21 @@ export type CargoWatchStartupOptions = 'ask' | 'enabled' | 'disabled'; export type CargoWatchTraceOptions = 'off' | 'error' | 'verbose'; export interface CargoWatchOptions { - enableOnStartup: CargoWatchStartupOptions, - trace: CargoWatchTraceOptions, -}; + enableOnStartup: CargoWatchStartupOptions; + checkArguments: string; + trace: CargoWatchTraceOptions; +} export class Config { public highlightingOn = true; public enableEnhancedTyping = true; public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; public showWorkspaceLoadedNotification = true; - public cargoWatchOptions: CargoWatchOptions = { enableOnStartup: 'ask', trace: 'off' }; + public cargoWatchOptions: CargoWatchOptions = { + enableOnStartup: 'ask', + trace: 'off', + checkArguments: '' + }; private prevEnhancedTyping: null | boolean = null; @@ -79,17 +84,23 @@ export class Config { } if (config.has('enableCargoWatchOnStartup')) { - this.cargoWatchOptions.enableOnStartup = - config.get( - 'enableCargoWatchOnStartup', - 'ask' - ); - this.cargoWatchOptions.trace = - config.get( - 'trace.cargo-watch', - 'off' - ); + this.cargoWatchOptions.enableOnStartup = config.get< + CargoWatchStartupOptions + >('enableCargoWatchOnStartup', 'ask'); + } + + if (config.has('trace.cargo-watch')) { + this.cargoWatchOptions.trace = config.get( + 'trace.cargo-watch', + 'off' + ); + } + if (config.has('cargo-watch.check-arguments')) { + this.cargoWatchOptions.checkArguments = config.get( + 'cargo-watch.check-arguments', + '' + ); } } } -- cgit v1.2.3