@@ -177,7 +177,7 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi
177
177
if ( ! shouldCheckForNewNightly ) return ;
178
178
}
179
179
180
- const release = await performDownloadWithRetryDialog ( state , async ( ) => {
180
+ const release = await downloadWithRetryDialog ( state , async ( ) => {
181
181
return await fetchRelease ( "nightly" , state . githubToken ) ;
182
182
} ) . catch ( ( e ) => {
183
183
log . error ( e ) ;
@@ -199,7 +199,7 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi
199
199
200
200
const dest = path . join ( config . globalStoragePath , "rust-analyzer.vsix" ) ;
201
201
202
- await performDownloadWithRetryDialog ( state , async ( ) => {
202
+ await downloadWithRetryDialog ( state , async ( ) => {
203
203
// Unlinking the exe file before moving new one on its place should prevent ETXTBSY error.
204
204
await fs . unlink ( dest ) . catch ( err => {
205
205
if ( err . code !== "ENOENT" ) throw err ;
@@ -323,13 +323,13 @@ async function getServer(config: Config, state: PersistentState): Promise<string
323
323
}
324
324
325
325
const releaseTag = config . package . releaseTag ;
326
- const release = await performDownloadWithRetryDialog ( state , async ( ) => {
326
+ const release = await downloadWithRetryDialog ( state , async ( ) => {
327
327
return await fetchRelease ( releaseTag , state . githubToken ) ;
328
328
} ) ;
329
329
const artifact = release . assets . find ( artifact => artifact . name === `rust-analyzer-${ platform } .gz` ) ;
330
330
assert ( ! ! artifact , `Bad release: ${ JSON . stringify ( release ) } ` ) ;
331
331
332
- await performDownloadWithRetryDialog ( state , async ( ) => {
332
+ await downloadWithRetryDialog ( state , async ( ) => {
333
333
// Unlinking the exe file before moving new one on its place should prevent ETXTBSY error.
334
334
await fs . unlink ( dest ) . catch ( err => {
335
335
if ( err . code !== "ENOENT" ) throw err ;
@@ -353,7 +353,7 @@ async function getServer(config: Config, state: PersistentState): Promise<string
353
353
return dest ;
354
354
}
355
355
356
- async function performDownloadWithRetryDialog < T > ( state : PersistentState , downloadFunc : ( ) => Promise < T > ) : Promise < T > {
356
+ async function downloadWithRetryDialog < T > ( state : PersistentState , downloadFunc : ( ) => Promise < T > ) : Promise < T > {
357
357
while ( true ) {
358
358
try {
359
359
return await downloadFunc ( ) ;
0 commit comments