Skip to content

Commit 5ffadee

Browse files
Use description & detail when calculating id for the identity provider (microsoft#210803)
* Use description & detail when calculating id for the identity provider Fixes microsoft#209842 * better logic
1 parent 7d04d4d commit 5ffadee

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/vs/platform/quickinput/browser/quickInputTree.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -744,12 +744,20 @@ export class QuickInputTree extends Disposable {
744744
identityProvider: {
745745
getId: element => {
746746
// always prefer item over separator because if item is defined, it must be the main item type
747-
// always prefer a defined id if one was specified and use label as a fallback
748-
return element.item?.id
749-
?? element.item?.label
750-
?? element.separator?.id
751-
?? element.separator?.label
752-
?? '';
747+
const mainItem = element.item || element.separator;
748+
if (mainItem === undefined) {
749+
return '';
750+
}
751+
// always prefer a defined id if one was specified and use "label + description + detail" as a fallback
752+
if (mainItem.id !== undefined) {
753+
return mainItem.id;
754+
}
755+
let id = `label:${mainItem.label}`;
756+
id += `$$description:${mainItem.description}`;
757+
if (mainItem.type !== 'separator') {
758+
id += `$$detail:${mainItem.detail}`;
759+
}
760+
return id;
753761
},
754762
},
755763
alwaysConsumeMouseWheel: true

0 commit comments

Comments
 (0)