Skip to content

Commit

Permalink
Passes debouncer's cancelation token to the getCategorizedItems method
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeibbb committed Nov 5, 2024
1 parent ea221ee commit 1465bab
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/plus/launchpad/launchpad.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { QuickInputButton, QuickPick, QuickPickItem } from 'vscode';
import type { CancellationToken, QuickInputButton, QuickPick, QuickPickItem } from 'vscode';
import { commands, ThemeIcon, Uri } from 'vscode';
import { getAvatarUri } from '../../avatars';
import type {
Expand Down Expand Up @@ -524,7 +524,12 @@ export class LaunchpadCommand extends QuickCommand<State> {
quickpick.busy = true;
try {
await this.updateItemsDebouncer(async cancellationToken => {
await updateContextItems(this.container, context, { force: true, search: search });
await updateContextItems(
this.container,
context,
{ force: true, search: search },
cancellationToken,
);
if (cancellationToken.isCancellationRequested) {
return;
}
Expand Down Expand Up @@ -1345,8 +1350,9 @@ async function updateContextItems(
container: Container,
context: Context,
options?: { force?: boolean; search?: string },
cancellation?: CancellationToken,
) {
context.result = await container.launchpad.getCategorizedItems(options);
context.result = await container.launchpad.getCategorizedItems(options, cancellation);
if (container.telemetry.enabled) {
updateTelemetryContext(context);
}
Expand Down

0 comments on commit 1465bab

Please sign in to comment.