mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Check exit code of cargo watch
This commit is contained in:
parent
503920532d
commit
4c175fbe8a
1 changed files with 3 additions and 3 deletions
|
@ -161,7 +161,7 @@ export async function startCargoWatch(
|
||||||
): Promise<CargoWatchProvider | undefined> {
|
): Promise<CargoWatchProvider | undefined> {
|
||||||
const execPromise = util.promisify(child_process.exec);
|
const execPromise = util.promisify(child_process.exec);
|
||||||
|
|
||||||
const { stderr } = await execPromise('cargo watch --version').catch(e => e);
|
const { stderr, code = 0 } = await execPromise('cargo watch --version').catch(e => e);
|
||||||
|
|
||||||
if (stderr.includes('no such subcommand: `watch`')) {
|
if (stderr.includes('no such subcommand: `watch`')) {
|
||||||
const msg =
|
const msg =
|
||||||
|
@ -201,9 +201,9 @@ export async function startCargoWatch(
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (stderr !== '') {
|
} else if (code !== 0) {
|
||||||
vscode.window.showErrorMessage(
|
vscode.window.showErrorMessage(
|
||||||
`Couldn't run \`cargo watch\`: ${stderr}`
|
`\`cargo watch\` failed with ${code}: ${stderr}`
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue