Skip to content

Commit

Permalink
fix: apply query filter to additionPicks (#213281)
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceerhl authored May 23, 2024
1 parent 878cb47 commit 2b277fc
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/vs/workbench/contrib/search/browser/anythingQuickAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,26 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt

let picks = new Array<IAnythingQuickPickItem | IQuickPickSeparator>();
if (options.additionPicks) {
picks.push(...options.additionPicks);
for (const pick of options.additionPicks) {
if (pick.type === 'separator') {
picks.push(pick);
continue;
}
if (!query.original) {
pick.highlights = undefined;
picks.push(pick);
continue;
}
const { score, labelMatch, descriptionMatch } = scoreItemFuzzy(pick, query, true, quickPickItemScorerAccessor, this.pickState.scorerCache);
if (!score) {
continue;
}
pick.highlights = {
label: labelMatch,
description: descriptionMatch
};
picks.push(pick);
}
}
if (this.pickState.isQuickNavigating) {
if (picks.length > 0) {
Expand Down

0 comments on commit 2b277fc

Please sign in to comment.