aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands
diff options
context:
space:
mode:
authorBernardo <[email protected]>2019-04-19 17:28:14 +0100
committerBernardo <[email protected]>2019-04-19 19:54:36 +0100
commit422f4ac080c1347421a1ba6efcbc8f5b40414f46 (patch)
tree01c72b5c48746b5dfb9b1155375cb86c631f7290 /editors/code/src/commands
parent3d3adabbef9290097fd890218d5d8ea6c1d8c002 (diff)
start cargo watch if not started interactively
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r--editors/code/src/commands/runnables.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts
index 5790252b7..26372c1e8 100644
--- a/editors/code/src/commands/runnables.ts
+++ b/editors/code/src/commands/runnables.ts
@@ -153,6 +153,12 @@ export async function interactivelyStartCargoWatch(
153 } 153 }
154 } 154 }
155 155
156 return startCargoWatch(context);
157}
158
159export async function startCargoWatch(
160 context: vscode.ExtensionContext
161): Promise<CargoWatchProvider | undefined> {
156 const execPromise = util.promisify(child_process.exec); 162 const execPromise = util.promisify(child_process.exec);
157 163
158 const { stderr } = await execPromise('cargo watch --version').catch(e => e); 164 const { stderr } = await execPromise('cargo watch --version').catch(e => e);
@@ -197,5 +203,9 @@ export async function interactivelyStartCargoWatch(
197 } 203 }
198 } 204 }
199 205
200 return registerCargoWatchProvider(context.subscriptions); 206 const provider = await registerCargoWatchProvider(context.subscriptions);
207 if (provider) {
208 provider.start();
209 }
210 return provider;
201} 211}