From b8635a8e6096768a5f2e382bed4af255896968f1 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 23 May 2021 11:28:06 +0300 Subject: Download nightly extension when configured and run from stable extension version --- editors/code/src/main.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'editors/code/src') diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 92c797d47..ee2c50dc7 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -192,11 +192,18 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi }).catch(async (e) => { log.error(e); if (state.releaseId === undefined) { // Show error only for the initial download - await vscode.window.showErrorMessage(`Failed to download rust-analyzer nightly ${e}`); + await vscode.window.showErrorMessage(`Failed to download rust-analyzer nightly: ${e}`); } - return undefined; + return; }); - if (release === undefined || release.id === state.releaseId) return; + if (release === undefined) { + if (state.releaseId === undefined) { // Show error only for the initial download + await vscode.window.showErrorMessage("Failed to download rust-analyzer nightly: empty release contents returned"); + } + return; + } + // If currently used extension is nightly and its release id matches the downloaded release id, we're already on the latest nightly version + if (config.package.releaseTag === NIGHTLY_TAG && release.id === state.releaseId) return; const userResponse = await vscode.window.showInformationMessage( "New version of rust-analyzer (nightly) is available (requires reload).", -- cgit v1.2.3