diff options
Diffstat (limited to 'editors/code/src/config.ts')
-rw-r--r-- | editors/code/src/config.ts | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index c06dddb1c..a88be6e35 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -5,15 +5,10 @@ import { Server } from './server'; | |||
5 | 5 | ||
6 | const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG; | 6 | const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG; |
7 | 7 | ||
8 | export type CargoWatchStartupOptions = 'ask' | 'enabled' | 'disabled'; | ||
9 | export type CargoWatchTraceOptions = 'off' | 'error' | 'verbose'; | ||
10 | |||
11 | export interface CargoWatchOptions { | 8 | export interface CargoWatchOptions { |
12 | enableOnStartup: CargoWatchStartupOptions; | 9 | enable: boolean; |
13 | arguments: string; | 10 | arguments: string[]; |
14 | command: string; | 11 | command: string; |
15 | trace: CargoWatchTraceOptions; | ||
16 | ignore: string[]; | ||
17 | allTargets: boolean; | 12 | allTargets: boolean; |
18 | } | 13 | } |
19 | 14 | ||
@@ -37,11 +32,9 @@ export class Config { | |||
37 | // for internal use | 32 | // for internal use |
38 | public withSysroot: null | boolean = null; | 33 | public withSysroot: null | boolean = null; |
39 | public cargoWatchOptions: CargoWatchOptions = { | 34 | public cargoWatchOptions: CargoWatchOptions = { |
40 | enableOnStartup: 'ask', | 35 | enable: true, |
41 | trace: 'off', | 36 | arguments: [], |
42 | arguments: '', | ||
43 | command: '', | 37 | command: '', |
44 | ignore: [], | ||
45 | allTargets: true, | 38 | allTargets: true, |
46 | }; | 39 | }; |
47 | public cargoFeatures: CargoFeatures = { | 40 | public cargoFeatures: CargoFeatures = { |
@@ -104,23 +97,17 @@ export class Config { | |||
104 | RA_LSP_DEBUG || (config.get('raLspServerPath') as string); | 97 | RA_LSP_DEBUG || (config.get('raLspServerPath') as string); |
105 | } | 98 | } |
106 | 99 | ||
107 | if (config.has('enableCargoWatchOnStartup')) { | 100 | if (config.has('cargo-watch.enable')) { |
108 | this.cargoWatchOptions.enableOnStartup = config.get< | 101 | this.cargoWatchOptions.enable = config.get<boolean>( |
109 | CargoWatchStartupOptions | 102 | 'cargo-watch.enable', |
110 | >('enableCargoWatchOnStartup', 'ask'); | 103 | true, |
111 | } | ||
112 | |||
113 | if (config.has('trace.cargo-watch')) { | ||
114 | this.cargoWatchOptions.trace = config.get<CargoWatchTraceOptions>( | ||
115 | 'trace.cargo-watch', | ||
116 | 'off', | ||
117 | ); | 104 | ); |
118 | } | 105 | } |
119 | 106 | ||
120 | if (config.has('cargo-watch.arguments')) { | 107 | if (config.has('cargo-watch.arguments')) { |
121 | this.cargoWatchOptions.arguments = config.get<string>( | 108 | this.cargoWatchOptions.arguments = config.get<string[]>( |
122 | 'cargo-watch.arguments', | 109 | 'cargo-watch.arguments', |
123 | '', | 110 | [], |
124 | ); | 111 | ); |
125 | } | 112 | } |
126 | 113 | ||
@@ -131,13 +118,6 @@ export class Config { | |||
131 | ); | 118 | ); |
132 | } | 119 | } |
133 | 120 | ||
134 | if (config.has('cargo-watch.ignore')) { | ||
135 | this.cargoWatchOptions.ignore = config.get<string[]>( | ||
136 | 'cargo-watch.ignore', | ||
137 | [], | ||
138 | ); | ||
139 | } | ||
140 | |||
141 | if (config.has('cargo-watch.allTargets')) { | 121 | if (config.has('cargo-watch.allTargets')) { |
142 | this.cargoWatchOptions.allTargets = config.get<boolean>( | 122 | this.cargoWatchOptions.allTargets = config.get<boolean>( |
143 | 'cargo-watch.allTargets', | 123 | 'cargo-watch.allTargets', |