Use description & detail when calculating id for the identity provider (#210803)

* Use description & detail when calculating id for the identity provider

Fixes #209842

* better logic
This commit is contained in:
Tyler James Leonhardt
2024-04-19 17:09:50 -07:00
committed by GitHub
parent 7d04d4df43
commit 5ffadeeb9b
@@ -744,12 +744,20 @@ export class QuickInputTree extends Disposable {
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
?? '';
const mainItem = element.item || element.separator;
if (mainItem === undefined) {
return '';
}
// always prefer a defined id if one was specified and use "label + description + detail" as a fallback
if (mainItem.id !== undefined) {
return mainItem.id;
}
let id = `label:${mainItem.label}`;
id += `$$description:${mainItem.description}`;
if (mainItem.type !== 'separator') {
id += `$$detail:${mainItem.detail}`;
}
return id;
},
},
alwaysConsumeMouseWheel: true