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.ts25
1 files changed, 19 insertions, 6 deletions
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';
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 trace: CargoWatchTraceOptions,
13};
8 14
9export class Config { 15export class Config {
10 public highlightingOn = true; 16 public highlightingOn = true;
11 public enableEnhancedTyping = true; 17 public enableEnhancedTyping = true;
12 public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; 18 public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server';
13 public showWorkspaceLoadedNotification = true; 19 public showWorkspaceLoadedNotification = true;
14 public enableCargoWatchOnStartup: CargoWatchOptions = 'ask'; 20 public cargoWatchOptions: CargoWatchOptions = { enableOnStartup: 'ask', trace: 'off' };
15 21
16 private prevEnhancedTyping: null | boolean = null; 22 private prevEnhancedTyping: null | boolean = null;
17 23
@@ -73,10 +79,17 @@ export class Config {
73 } 79 }
74 80
75 if (config.has('enableCargoWatchOnStartup')) { 81 if (config.has('enableCargoWatchOnStartup')) {
76 this.enableCargoWatchOnStartup = config.get<CargoWatchOptions>( 82 this.cargoWatchOptions.enableOnStartup =
77 'enableCargoWatchOnStartup', 83 config.get<CargoWatchStartupOptions>(
78 'ask' 84 'enableCargoWatchOnStartup',
79 ); 85 'ask'
86 );
87 this.cargoWatchOptions.trace =
88 config.get<CargoWatchTraceOptions>(
89 'trace.cargo-watch',
90 'off'
91 );
92
80 } 93 }
81 } 94 }
82} 95}