aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
diff options
context:
space:
mode:
authorIgor Matuszewski <[email protected]>2019-03-18 21:35:47 +0000
committerIgor Matuszewski <[email protected]>2019-03-18 21:35:47 +0000
commit7c2595c26820917fa9ad1b1c36f01fc6ac979287 (patch)
treedb71a710ca08293583163677aae0ca07a704adfc /editors/code/src
parent60cac299640912ad1ad75644bfa0088d7ba6e367 (diff)
Guard auto cargo watch behind a config option
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/commands/runnables.ts4
-rw-r--r--editors/code/src/config.ts8
2 files changed, 12 insertions, 0 deletions
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts
index 285afaaf6..74407dc3e 100644
--- a/editors/code/src/commands/runnables.ts
+++ b/editors/code/src/commands/runnables.ts
@@ -153,6 +153,10 @@ export const autoCargoWatchTask: vscode.Task = {
153 * that, when accepted, allow us to `cargo install cargo-watch` and then run it. 153 * that, when accepted, allow us to `cargo install cargo-watch` and then run it.
154 */ 154 */
155export async function interactivelyStartCargoWatch() { 155export async function interactivelyStartCargoWatch() {
156 if (!Server.config.enableCargoWatchOnStartup) {
157 return;
158 }
159
156 const execAsync = util.promisify(exec); 160 const execAsync = util.promisify(exec);
157 161
158 const watch = await vscode.window.showInformationMessage( 162 const watch = await vscode.window.showInformationMessage(
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index afc5cc6af..d8795f3b0 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -9,6 +9,7 @@ export class Config {
9 public enableEnhancedTyping = true; 9 public enableEnhancedTyping = true;
10 public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; 10 public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server';
11 public showWorkspaceLoadedNotification = true; 11 public showWorkspaceLoadedNotification = true;
12 public enableCargoWatchOnStartup = true;
12 13
13 private prevEnhancedTyping: null | boolean = null; 14 private prevEnhancedTyping: null | boolean = null;
14 15
@@ -68,5 +69,12 @@ export class Config {
68 this.raLspServerPath = 69 this.raLspServerPath =
69 RA_LSP_DEBUG || (config.get('raLspServerPath') as string); 70 RA_LSP_DEBUG || (config.get('raLspServerPath') as string);
70 } 71 }
72
73 if (config.has('enableCargoWatchOnStartup')) {
74 this.enableCargoWatchOnStartup = config.get<boolean>(
75 'enableCargoWatchOnStartup',
76 true
77 );
78 }
71 } 79 }
72} 80}