File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
src/vs/platform/quickinput/browser Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -744,12 +744,20 @@ export class QuickInputTree extends Disposable {
744
744
identityProvider : {
745
745
getId : element => {
746
746
// 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 ;
753
761
} ,
754
762
} ,
755
763
alwaysConsumeMouseWheel : true
You can’t perform that action at this time.
0 commit comments