@@ -8,7 +8,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
8
8
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar' ;
9
9
import { AriaRole } from 'vs/base/browser/ui/aria/aria' ;
10
10
import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget' ;
11
- import { IHoverWidget } from 'vs/base/browser/ui/iconLabel/iconHoverDelegate' ;
11
+ import { IHoverDelegate , IHoverWidget } from 'vs/base/browser/ui/iconLabel/iconHoverDelegate' ;
12
12
import { IconLabel , IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel' ;
13
13
import { KeybindingLabel } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel' ;
14
14
import { IListRenderer , IListVirtualDelegate } from 'vs/base/browser/ui/list/list' ;
@@ -234,7 +234,10 @@ class ListElementRenderer implements IListRenderer<IListElement, IListElementTem
234
234
235
235
static readonly ID = 'listelement' ;
236
236
237
- constructor ( private readonly themeService : IThemeService ) { }
237
+ constructor (
238
+ private readonly themeService : IThemeService ,
239
+ private readonly hoverDelegate : IHoverDelegate | undefined ,
240
+ ) { }
238
241
239
242
get templateId ( ) {
240
243
return ListElementRenderer . ID ;
@@ -266,7 +269,7 @@ class ListElementRenderer implements IListRenderer<IListElement, IListElementTem
266
269
const row2 = dom . append ( rows , $ ( '.quick-input-list-row' ) ) ;
267
270
268
271
// Label
269
- data . label = new IconLabel ( row1 , { supportHighlights : true , supportDescriptionHighlights : true , supportIcons : true } ) ;
272
+ data . label = new IconLabel ( row1 , { supportHighlights : true , supportDescriptionHighlights : true , supportIcons : true , hoverDelegate : this . hoverDelegate } ) ;
270
273
data . toDisposeTemplate . push ( data . label ) ;
271
274
data . icon = < HTMLInputElement > dom . prepend ( data . label . element , $ ( '.quick-input-list-icon' ) ) ;
272
275
@@ -276,14 +279,14 @@ class ListElementRenderer implements IListRenderer<IListElement, IListElementTem
276
279
277
280
// Detail
278
281
const detailContainer = dom . append ( row2 , $ ( '.quick-input-list-label-meta' ) ) ;
279
- data . detail = new IconLabel ( detailContainer , { supportHighlights : true , supportIcons : true } ) ;
282
+ data . detail = new IconLabel ( detailContainer , { supportHighlights : true , supportIcons : true , hoverDelegate : this . hoverDelegate } ) ;
280
283
data . toDisposeTemplate . push ( data . detail ) ;
281
284
282
285
// Separator
283
286
data . separator = dom . append ( data . entry , $ ( '.quick-input-list-separator' ) ) ;
284
287
285
288
// Actions
286
- data . actionBar = new ActionBar ( data . entry ) ;
289
+ data . actionBar = new ActionBar ( data . entry , this . hoverDelegate ? { hoverDelegate : this . hoverDelegate } : undefined ) ;
287
290
data . actionBar . domNode . classList . add ( 'quick-input-list-entry-action-bar' ) ;
288
291
data . toDisposeTemplate . push ( data . actionBar ) ;
289
292
@@ -313,7 +316,8 @@ class ListElementRenderer implements IListRenderer<IListElement, IListElementTem
313
316
// Label
314
317
const options : IIconLabelValueOptions = {
315
318
matches : labelHighlights || [ ] ,
316
- descriptionTitle : element . saneDescription ,
319
+ // If we have a tooltip, we want that to be shown and not any other hover
320
+ descriptionTitle : element . saneTooltip ? undefined : element . saneDescription ,
317
321
descriptionMatches : descriptionHighlights || [ ] ,
318
322
labelEscapeNewLines : true
319
323
} ;
@@ -335,7 +339,8 @@ class ListElementRenderer implements IListRenderer<IListElement, IListElementTem
335
339
data . detail . element . style . display = '' ;
336
340
data . detail . setLabel ( element . saneDetail , undefined , {
337
341
matches : detailHighlights ,
338
- title : element . saneDetail ,
342
+ // If we have a tooltip, we want that to be shown and not any other hover
343
+ title : element . saneTooltip ? undefined : element . saneDetail ,
339
344
labelEscapeNewLines : true
340
345
} ) ;
341
346
} else {
@@ -450,7 +455,7 @@ export class QuickInputList {
450
455
this . container = dom . append ( this . parent , $ ( '.quick-input-list' ) ) ;
451
456
const delegate = new ListElementDelegate ( ) ;
452
457
const accessibilityProvider = new QuickInputAccessibilityProvider ( ) ;
453
- this . list = options . createList ( 'QuickInput' , this . container , delegate , [ new ListElementRenderer ( themeService ) ] , {
458
+ this . list = options . createList ( 'QuickInput' , this . container , delegate , [ new ListElementRenderer ( themeService , options . hoverDelegate ) ] , {
454
459
identityProvider : {
455
460
getId : element => {
456
461
// always prefer item over separator because if item is defined, it must be the main item type
0 commit comments