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

Use a better id for QuickPickList #184733

Merged
merged 1 commit into from Jun 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/vs/platform/quickinput/browser/quickInputList.ts
Expand Up @@ -466,7 +466,17 @@ export class QuickInputList {
const delegate = new ListElementDelegate();
const accessibilityProvider = new QuickInputAccessibilityProvider();
this.list = options.createList('QuickInput', this.container, delegate, [new ListElementRenderer(this.options.styles.colorScheme)], {
identityProvider: { getId: element => element.saneLabel },
identityProvider: {
getId: element => {
// always prefer item over separator because if item is defined, it must be the main item type
// always prefer a defined id if one was specified and use label as a fallback
return element.item?.id
?? element.item?.label
?? element.separator?.id
?? element.separator?.label
?? '';
}
},
setRowLineHeight: false,
multipleSelectionSupport: false,
horizontalScrolling: false,
Expand Down