about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKirill Bulatov <mail4score@gmail.com>2021-05-23 11:28:06 +0300
committerKirill Bulatov <mail4score@gmail.com>2021-05-23 11:28:06 +0300
commitb8635a8e6096768a5f2e382bed4af255896968f1 (patch)
treec960d5709bd5c218b173017cf7e592ae84366952
parent808ebe4b865176dcc394ea4adcb3a24f60955734 (diff)
Download nightly extension when configured and run from stable extension version
-rw-r--r--editors/code/src/main.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 92c797d47fa..ee2c50dc706 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).",