Skip to content

Commit

Permalink
Call promise resolvers for debounced check (fixes #77)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sander Ronde committed May 10, 2024
1 parent 01c8e48 commit 733c7a5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/src/lib/phpstan/checkManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ export class PHPStanCheckManager implements AsyncDisposable {
...(existing?.promiseResolvers ?? []),
resolve,
],
timeout: setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-misused-promises
timeout: setTimeout(async () => {
const promiseResolvers =
this._queuedCalls.get(identifier)!.promiseResolvers;
this._queuedCalls.delete(identifier);
void callback();
await callback();
promiseResolvers.forEach((resolve) => resolve());
}, CHECK_DEBOUNCE),
});
});
Expand Down

0 comments on commit 733c7a5

Please sign in to comment.