aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2021-05-23 09:28:06 +0100
committerKirill Bulatov <[email protected]>2021-05-23 09:28:06 +0100
commitb8635a8e6096768a5f2e382bed4af255896968f1 (patch)
treec960d5709bd5c218b173017cf7e592ae84366952 /editors
parent808ebe4b865176dcc394ea4adcb3a24f60955734 (diff)
Download nightly extension when configured and run from stable extension version
Diffstat (limited to 'editors')
-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 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
192 }).catch(async (e) => { 192 }).catch(async (e) => {
193 log.error(e); 193 log.error(e);
194 if (state.releaseId === undefined) { // Show error only for the initial download 194 if (state.releaseId === undefined) { // Show error only for the initial download
195 await vscode.window.showErrorMessage(`Failed to download rust-analyzer nightly ${e}`); 195 await vscode.window.showErrorMessage(`Failed to download rust-analyzer nightly: ${e}`);
196 } 196 }
197 return undefined; 197 return;
198 }); 198 });
199 if (release === undefined || release.id === state.releaseId) return; 199 if (release === undefined) {
200 if (state.releaseId === undefined) { // Show error only for the initial download
201 await vscode.window.showErrorMessage("Failed to download rust-analyzer nightly: empty release contents returned");
202 }
203 return;
204 }
205 // If currently used extension is nightly and its release id matches the downloaded release id, we're already on the latest nightly version
206 if (config.package.releaseTag === NIGHTLY_TAG && release.id === state.releaseId) return;
200 207
201 const userResponse = await vscode.window.showInformationMessage( 208 const userResponse = await vscode.window.showInformationMessage(
202 "New version of rust-analyzer (nightly) is available (requires reload).", 209 "New version of rust-analyzer (nightly) is available (requires reload).",