Skip to content

Commit 11f4586

Browse files
authored
adds filtering for constant rows in extension qucik access (microsoft#208741)
* adds filtering for constant rows in extension qucik access * quick fix and cleanup * last bit of cleaning * removed unused imports
1 parent 262d4bf commit 11f4586

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

src/vs/workbench/contrib/issue/browser/issueQuickAccess.ts

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,31 @@ export class IssueQuickAccess extends PickerQuickAccessProvider<IPickerQuickAcce
3939
// Add default items
4040
const productLabel = this.productService.nameLong;
4141
const marketPlaceLabel = localize("reportExtensionMarketplace", "Extension Marketplace");
42-
issuePicksConst.push(
43-
{ label: productLabel, ariaLabel: productLabel, accept: () => this.commandService.executeCommand('workbench.action.openIssueReporter', { issueSource: IssueSource.VSCode }) },
44-
{ label: marketPlaceLabel, ariaLabel: marketPlaceLabel, accept: () => this.commandService.executeCommand('workbench.action.openIssueReporter', { issueSource: IssueSource.Marketplace }) },
45-
{ type: 'separator', label: localize('extensions', "Extensions") }
46-
);
42+
const productFilter = matchesFuzzy(filter, productLabel, true);
43+
const marketPlaceFilter = matchesFuzzy(filter, marketPlaceLabel, true);
44+
45+
// Add product pick if product filter matches
46+
if (productFilter) {
47+
issuePicksConst.push({
48+
label: productLabel,
49+
ariaLabel: productLabel,
50+
highlights: { label: productFilter },
51+
accept: () => this.commandService.executeCommand('workbench.action.openIssueReporter', { issueSource: IssueSource.VSCode })
52+
});
53+
}
54+
55+
// Add marketplace pick if marketplace filter matches
56+
if (marketPlaceFilter) {
57+
issuePicksConst.push({
58+
label: marketPlaceLabel,
59+
ariaLabel: marketPlaceLabel,
60+
highlights: { label: marketPlaceFilter },
61+
accept: () => this.commandService.executeCommand('workbench.action.openIssueReporter', { issueSource: IssueSource.Marketplace })
62+
});
63+
}
64+
65+
issuePicksConst.push({ type: 'separator', label: localize('extensions', "Extensions") });
66+
4767

4868
// creates menu from contributed
4969
const menu = this.menuService.createMenu(MenuId.IssueReporter, this.contextKeyService);

0 commit comments

Comments
 (0)