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.ts34
1 files changed, 29 insertions, 5 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index 420589068..481a5e5f1 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -4,14 +4,25 @@ 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 CargoWatchOptions = 'ask' | 'enabled' | 'disabled'; 7export type CargoWatchStartupOptions = 'ask' | 'enabled' | 'disabled';
8export type CargoWatchTraceOptions = 'off' | 'error' | 'verbose';
9
10export interface CargoWatchOptions {
11 enableOnStartup: CargoWatchStartupOptions;
12 checkArguments: string;
13 trace: CargoWatchTraceOptions;
14}
8 15
9export class Config { 16export class Config {
10 public highlightingOn = true; 17 public highlightingOn = true;
11 public enableEnhancedTyping = true; 18 public enableEnhancedTyping = true;
12 public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; 19 public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server';
13 public showWorkspaceLoadedNotification = true; 20 public showWorkspaceLoadedNotification = true;
14 public enableCargoWatchOnStartup: CargoWatchOptions = 'ask'; 21 public cargoWatchOptions: CargoWatchOptions = {
22 enableOnStartup: 'ask',
23 trace: 'off',
24 checkArguments: ''
25 };
15 26
16 private prevEnhancedTyping: null | boolean = null; 27 private prevEnhancedTyping: null | boolean = null;
17 28
@@ -73,9 +84,22 @@ export class Config {
73 } 84 }
74 85
75 if (config.has('enableCargoWatchOnStartup')) { 86 if (config.has('enableCargoWatchOnStartup')) {
76 this.enableCargoWatchOnStartup = config.get<CargoWatchOptions>( 87 this.cargoWatchOptions.enableOnStartup = config.get<
77 'enableCargoWatchOnStartup', 88 CargoWatchStartupOptions
78 'ask' 89 >('enableCargoWatchOnStartup', 'ask');
90 }
91
92 if (config.has('trace.cargo-watch')) {
93 this.cargoWatchOptions.trace = config.get<CargoWatchTraceOptions>(
94 'trace.cargo-watch',
95 'off'
96 );
97 }
98
99 if (config.has('cargo-watch.check-arguments')) {
100 this.cargoWatchOptions.checkArguments = config.get<string>(
101 'cargo-watch.check-arguments',
102 ''
79 ); 103 );
80 } 104 }
81 } 105 }