Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't set quick pick items every time value changes #165113

Merged
merged 8 commits into from
Nov 2, 2022
8 changes: 6 additions & 2 deletions src/vs/platform/quickinput/browser/quickPickPin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ export async function showWithPinnedItems(storageService: IStorageService, stora
}
});
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
quickPick.onDidChangeValue(async value => {
// Return pinned items if there is no search value
quickPick.items = value ? itemsWithoutPinned : itemsWithPinned;
// If the items are pinnable (top level quick pick), update items such that
// pinned are excluded from the search results
if (quickPick.items.some(i => i.buttons?.some(b => b.iconClass === pinButtonClass))) {
quickPick.items = value ? itemsWithoutPinned : itemsWithPinned;
}
});

quickPick.items = quickPick.value ? itemsWithoutPinned : itemsWithPinned;
quickPick.show();
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/tasks/browser/taskQuickPick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ export class TaskQuickPick extends Disposable {
// Proceed to second level of quick pick
if (selectedEntry && !selectedEntry.settingType && selectedEntry.task === null) {
// The user has chosen to go back to the first level
firstLevelTask = await this._doPickerFirstLevel(picker, (await this.getTopLevelEntries(defaultEntry)).entries);
picker.value = '';
firstLevelTask = await this._doPickerFirstLevel(picker, (await this.getTopLevelEntries(defaultEntry)).entries);
} else if (selectedEntry && Types.isString(selectedEntry.settingType)) {
picker.dispose();
return this.handleSettingOption(selectedEntry.settingType);
Expand Down