diff options
author | Edwin Cheng <[email protected]> | 2019-04-02 07:43:02 +0100 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-04-02 08:03:31 +0100 |
commit | 02e450f354ccd978c90425929c635139210843a3 (patch) | |
tree | 008e2bc12c024b480d86a4dae7194b976cad494d /editors/code/src/config.ts | |
parent | ee05eafe6c657c3d3710655e11d88d61bc5febf0 (diff) |
Add cargo-watch.check-arguments
Diffstat (limited to 'editors/code/src/config.ts')
-rw-r--r-- | editors/code/src/config.ts | 39 |
1 files changed, 25 insertions, 14 deletions
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'; | |||
8 | export type CargoWatchTraceOptions = 'off' | 'error' | 'verbose'; | 8 | export type CargoWatchTraceOptions = 'off' | 'error' | 'verbose'; |
9 | 9 | ||
10 | export interface CargoWatchOptions { | 10 | export interface CargoWatchOptions { |
11 | enableOnStartup: CargoWatchStartupOptions, | 11 | enableOnStartup: CargoWatchStartupOptions; |
12 | trace: CargoWatchTraceOptions, | 12 | checkArguments: string; |
13 | }; | 13 | trace: CargoWatchTraceOptions; |
14 | } | ||
14 | 15 | ||
15 | export class Config { | 16 | export class Config { |
16 | public highlightingOn = true; | 17 | public highlightingOn = true; |
17 | public enableEnhancedTyping = true; | 18 | public enableEnhancedTyping = true; |
18 | public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; | 19 | public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; |
19 | public showWorkspaceLoadedNotification = true; | 20 | public showWorkspaceLoadedNotification = true; |
20 | public cargoWatchOptions: CargoWatchOptions = { enableOnStartup: 'ask', trace: 'off' }; | 21 | public cargoWatchOptions: CargoWatchOptions = { |
22 | enableOnStartup: 'ask', | ||
23 | trace: 'off', | ||
24 | checkArguments: '' | ||
25 | }; | ||
21 | 26 | ||
22 | private prevEnhancedTyping: null | boolean = null; | 27 | private prevEnhancedTyping: null | boolean = null; |
23 | 28 | ||
@@ -79,17 +84,23 @@ export class Config { | |||
79 | } | 84 | } |
80 | 85 | ||
81 | if (config.has('enableCargoWatchOnStartup')) { | 86 | if (config.has('enableCargoWatchOnStartup')) { |
82 | this.cargoWatchOptions.enableOnStartup = | 87 | this.cargoWatchOptions.enableOnStartup = config.get< |
83 | config.get<CargoWatchStartupOptions>( | 88 | CargoWatchStartupOptions |
84 | 'enableCargoWatchOnStartup', | 89 | >('enableCargoWatchOnStartup', 'ask'); |
85 | 'ask' | 90 | } |
86 | ); | 91 | |
87 | this.cargoWatchOptions.trace = | 92 | if (config.has('trace.cargo-watch')) { |
88 | config.get<CargoWatchTraceOptions>( | 93 | this.cargoWatchOptions.trace = config.get<CargoWatchTraceOptions>( |
89 | 'trace.cargo-watch', | 94 | 'trace.cargo-watch', |
90 | 'off' | 95 | 'off' |
91 | ); | 96 | ); |
97 | } | ||
92 | 98 | ||
99 | if (config.has('cargo-watch.check-arguments')) { | ||
100 | this.cargoWatchOptions.checkArguments = config.get<string>( | ||
101 | 'cargo-watch.check-arguments', | ||
102 | '' | ||
103 | ); | ||
93 | } | 104 | } |
94 | } | 105 | } |
95 | } | 106 | } |