aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands/runnables.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/commands/runnables.ts')
-rw-r--r--editors/code/src/commands/runnables.ts23
1 files changed, 13 insertions, 10 deletions
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts
index ea2883ad4..420635f41 100644
--- a/editors/code/src/commands/runnables.ts
+++ b/editors/code/src/commands/runnables.ts
@@ -153,22 +153,25 @@ 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) { 156 if (Server.config.enableCargoWatchOnStartup === 'disabled') {
157 return; 157 return;
158 } 158 }
159 159
160 const execPromise = util.promisify(child_process.exec); 160 if (Server.config.enableCargoWatchOnStartup === 'ask') {
161 161 const watch = await vscode.window.showInformationMessage(
162 const watch = await vscode.window.showInformationMessage( 162 'Start watching changes with cargo? (Executes `cargo watch`, provides inline diagnostics)',
163 'Start watching changes with cargo? (Executes `cargo watch`, provides inline diagnostics)', 163 'yes',
164 'yes', 164 'no'
165 'no' 165 );
166 ); 166 if (watch === 'no') {
167 if (watch === 'no') { 167 return;
168 return; 168 }
169 } 169 }
170 170
171 const execPromise = util.promisify(child_process.exec);
172
171 const { stderr } = await execPromise('cargo watch --version').catch(e => e); 173 const { stderr } = await execPromise('cargo watch --version').catch(e => e);
174
172 if (stderr.includes('no such subcommand: `watch`')) { 175 if (stderr.includes('no such subcommand: `watch`')) {
173 const msg = 176 const msg =
174 'The `cargo-watch` subcommand is not installed. Install? (takes ~1-2 minutes)'; 177 'The `cargo-watch` subcommand is not installed. Install? (takes ~1-2 minutes)';