From ee05eafe6c657c3d3710655e11d88d61bc5febf0 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 2 Apr 2019 13:07:40 +0800 Subject: Add config for cargo-watch trace --- editors/code/src/config.ts | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'editors/code/src/config.ts') diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 420589068..c95d13878 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -4,14 +4,20 @@ import { Server } from './server'; const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG; -export type CargoWatchOptions = 'ask' | 'enabled' | 'disabled'; +export type CargoWatchStartupOptions = 'ask' | 'enabled' | 'disabled'; +export type CargoWatchTraceOptions = 'off' | 'error' | 'verbose'; + +export interface CargoWatchOptions { + enableOnStartup: CargoWatchStartupOptions, + trace: CargoWatchTraceOptions, +}; export class Config { public highlightingOn = true; public enableEnhancedTyping = true; public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; public showWorkspaceLoadedNotification = true; - public enableCargoWatchOnStartup: CargoWatchOptions = 'ask'; + public cargoWatchOptions: CargoWatchOptions = { enableOnStartup: 'ask', trace: 'off' }; private prevEnhancedTyping: null | boolean = null; @@ -73,10 +79,17 @@ export class Config { } if (config.has('enableCargoWatchOnStartup')) { - this.enableCargoWatchOnStartup = config.get( - 'enableCargoWatchOnStartup', - 'ask' - ); + this.cargoWatchOptions.enableOnStartup = + config.get( + 'enableCargoWatchOnStartup', + 'ask' + ); + this.cargoWatchOptions.trace = + config.get( + 'trace.cargo-watch', + 'off' + ); + } } } -- cgit v1.2.3 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