From 5ffadeeb9bc920cd8eee1575c41bf4a3f7ac2402 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Fri, 19 Apr 2024 17:09:50 -0700 Subject: [PATCH] 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 --- .../quickinput/browser/quickInputTree.ts | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/vs/platform/quickinput/browser/quickInputTree.ts b/src/vs/platform/quickinput/browser/quickInputTree.ts index bcabf51e92d..09e4ea9b4e7 100644 --- a/src/vs/platform/quickinput/browser/quickInputTree.ts +++ b/src/vs/platform/quickinput/browser/quickInputTree.ts @@ -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