diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 0ee5280cc02..f865639a14d 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -177,7 +177,7 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi if (!shouldCheckForNewNightly) return; } - const release = await performDownloadWithRetryDialog(state, async () => { + const release = await downloadWithRetryDialog(state, async () => { return await fetchRelease("nightly", state.githubToken); }).catch((e) => { log.error(e); @@ -199,7 +199,7 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi const dest = path.join(config.globalStoragePath, "rust-analyzer.vsix"); - await performDownloadWithRetryDialog(state, async () => { + await downloadWithRetryDialog(state, async () => { // Unlinking the exe file before moving new one on its place should prevent ETXTBSY error. await fs.unlink(dest).catch(err => { if (err.code !== "ENOENT") throw err; @@ -323,13 +323,13 @@ async function getServer(config: Config, state: PersistentState): Promise { + const release = await downloadWithRetryDialog(state, async () => { return await fetchRelease(releaseTag, state.githubToken); }); const artifact = release.assets.find(artifact => artifact.name === `rust-analyzer-${platform}.gz`); assert(!!artifact, `Bad release: ${JSON.stringify(release)}`); - await performDownloadWithRetryDialog(state, async () => { + await downloadWithRetryDialog(state, async () => { // Unlinking the exe file before moving new one on its place should prevent ETXTBSY error. await fs.unlink(dest).catch(err => { if (err.code !== "ENOENT") throw err; @@ -353,7 +353,7 @@ async function getServer(config: Config, state: PersistentState): Promise(state: PersistentState, downloadFunc: () => Promise): Promise { +async function downloadWithRetryDialog(state: PersistentState, downloadFunc: () => Promise): Promise { while (true) { try { return await downloadFunc();