Skip to content

Commit a48066a

Browse files
Clarify snapshot refresh promise flow
Use async and await without changing refresh behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6b12d843-8011-4bfc-9ba9-f75761eadee2
1 parent faa729f commit a48066a

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

src/managers/builtin/inlineScript/envManager.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -333,19 +333,18 @@ export class InlineScriptEnvManager implements EnvironmentManager, Disposable {
333333
return followUp;
334334
}
335335

336-
private startSnapshotRefreshAfter(sharedPass: DiscoveryRefreshPass): Promise<boolean> {
337-
return sharedPass.promise.then(() => {
338-
if (this.disposed || !this.activationDiscoveryActive) {
339-
return false;
340-
}
341-
const pending = this.pendingRefresh;
342-
if (pending && pending !== sharedPass) {
343-
return pending.checksForSnapshotChanges
344-
? pending.promise
345-
: this.startSnapshotRefreshAfter(pending);
346-
}
347-
return this.startRefreshPass(true);
348-
});
336+
private async startSnapshotRefreshAfter(sharedPass: DiscoveryRefreshPass): Promise<boolean> {
337+
await sharedPass.promise;
338+
if (this.disposed || !this.activationDiscoveryActive) {
339+
return false;
340+
}
341+
const pending = this.pendingRefresh;
342+
if (pending && pending !== sharedPass) {
343+
return pending.checksForSnapshotChanges
344+
? pending.promise
345+
: this.startSnapshotRefreshAfter(pending);
346+
}
347+
return this.startRefreshPass(true);
349348
}
350349

351350
private runActivationDiscoveryPass(): void {

0 commit comments

Comments
 (0)