adds filtering for constant rows in extension qucik access (#208741)

* adds filtering for constant rows in extension qucik access

* quick fix and cleanup

* last bit of cleaning

* removed unused imports
This commit is contained in:
Justin Chen 2024-03-25 16:02:53 -07:00 committed by GitHub
parent 262d4bfaf6
commit 11f4586955
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -39,11 +39,31 @@ export class IssueQuickAccess extends PickerQuickAccessProvider<IPickerQuickAcce
// Add default items
const productLabel = this.productService.nameLong;
const marketPlaceLabel = localize("reportExtensionMarketplace", "Extension Marketplace");
issuePicksConst.push(
{ label: productLabel, ariaLabel: productLabel, accept: () => this.commandService.executeCommand('workbench.action.openIssueReporter', { issueSource: IssueSource.VSCode }) },
{ label: marketPlaceLabel, ariaLabel: marketPlaceLabel, accept: () => this.commandService.executeCommand('workbench.action.openIssueReporter', { issueSource: IssueSource.Marketplace }) },
{ type: 'separator', label: localize('extensions', "Extensions") }
);
const productFilter = matchesFuzzy(filter, productLabel, true);
const marketPlaceFilter = matchesFuzzy(filter, marketPlaceLabel, true);
// Add product pick if product filter matches
if (productFilter) {
issuePicksConst.push({
label: productLabel,
ariaLabel: productLabel,
highlights: { label: productFilter },
accept: () => this.commandService.executeCommand('workbench.action.openIssueReporter', { issueSource: IssueSource.VSCode })
});
}
// Add marketplace pick if marketplace filter matches
if (marketPlaceFilter) {
issuePicksConst.push({
label: marketPlaceLabel,
ariaLabel: marketPlaceLabel,
highlights: { label: marketPlaceFilter },
accept: () => this.commandService.executeCommand('workbench.action.openIssueReporter', { issueSource: IssueSource.Marketplace })
});
}
issuePicksConst.push({ type: 'separator', label: localize('extensions', "Extensions") });
// creates menu from contributed
const menu = this.menuService.createMenu(MenuId.IssueReporter, this.contextKeyService);