From 422f4ac080c1347421a1ba6efcbc8f5b40414f46 Mon Sep 17 00:00:00 2001 From: Bernardo Date: Fri, 19 Apr 2019 18:28:14 +0200 Subject: start cargo watch if not started interactively --- editors/code/src/extension.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'editors/code/src/extension.ts') diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts index b48ad9b29..48dd2a614 100644 --- a/editors/code/src/extension.ts +++ b/editors/code/src/extension.ts @@ -3,7 +3,10 @@ import * as lc from 'vscode-languageclient'; import * as commands from './commands'; import { CargoWatchProvider } from './commands/cargo_watch'; -import { interactivelyStartCargoWatch } from './commands/runnables'; +import { + interactivelyStartCargoWatch, + startCargoWatch +} from './commands/runnables'; import { SyntaxTreeContentProvider } from './commands/syntaxTree'; import * as events from './events'; import * as notifications from './notifications'; @@ -134,6 +137,10 @@ export function activate(context: vscode.ExtensionContext) { registerCommand('rust-analyzer.startCargoWatch', () => { if (provider) { provider.start(); + } else { + startCargoWatch(context).then(p => { + provider = p; + }); } }); registerCommand('rust-analyzer.stopCargoWatch', () => { -- cgit v1.2.3