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