From 5c3e9c716e11a0b795d484403289fe9940b7efda Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Thu, 21 Mar 2019 13:56:25 +0200 Subject: Change enableCargoWatchOnStartup to have three states This fixes #1005. Defaults to `ask` which prompts users each time whether to start `cargo watch` or not. `enabled` always starts `cargo watch` and `disabled` does not. --- editors/code/src/config.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'editors/code/src/config.ts') diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index d8795f3b0..420589068 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -4,12 +4,14 @@ import { Server } from './server'; const RA_LSP_DEBUG = process.env.__RA_LSP_SERVER_DEBUG; +export type CargoWatchOptions = 'ask' | 'enabled' | 'disabled'; + export class Config { public highlightingOn = true; public enableEnhancedTyping = true; public raLspServerPath = RA_LSP_DEBUG || 'ra_lsp_server'; public showWorkspaceLoadedNotification = true; - public enableCargoWatchOnStartup = true; + public enableCargoWatchOnStartup: CargoWatchOptions = 'ask'; private prevEnhancedTyping: null | boolean = null; @@ -71,9 +73,9 @@ export class Config { } if (config.has('enableCargoWatchOnStartup')) { - this.enableCargoWatchOnStartup = config.get( + this.enableCargoWatchOnStartup = config.get( 'enableCargoWatchOnStartup', - true + 'ask' ); } } -- cgit v1.2.3