@@ -23,6 +23,7 @@ import type { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'
2323import type { IAriaProvider } from 'vs/base/browser/ui/list/listView' ;
2424import { IconLabel } from 'vs/base/browser/ui/iconLabel/iconLabel' ;
2525import { basename } from 'vs/base/common/resources' ;
26+ import { ThemeIcon } from 'vs/platform/theme/common/themeService' ;
2627
2728// --- VIEW MODEL
2829
@@ -201,7 +202,7 @@ export class BulkEditIdentityProvider implements IIdentityProvider<BulkEditEleme
201202 } else if ( element instanceof TextEditElement ) {
202203 return element . parent . uri . toString ( ) + JSON . stringify ( element . edit . textEdit ) ;
203204 } else {
204- return element . label || '<default>' ;
205+ return JSON . stringify ( element . metadata ) ;
205206 }
206207 }
207208}
@@ -225,9 +226,13 @@ export class BulkEditAriaProvider implements IAriaProvider<BulkEditElement> {
225226
226227class CategoryElementTemplate {
227228
229+ readonly icon : HTMLDivElement ;
228230 readonly label : IconLabel ;
229231
230232 constructor ( container : HTMLElement ) {
233+ container . classList . add ( 'category' ) ;
234+ this . icon = document . createElement ( 'div' ) ;
235+ container . appendChild ( this . icon ) ;
231236 this . label = new IconLabel ( container ) ;
232237 }
233238}
@@ -243,7 +248,26 @@ export class CategoryElementRenderer implements ITreeRenderer<BulkCategory, Fuzz
243248 }
244249
245250 renderElement ( node : ITreeNode < BulkCategory , FuzzyScore > , _index : number , template : CategoryElementTemplate ) : void {
246- template . label . setLabel ( node . element . label || localize ( 'default' , "Other" ) ) ;
251+
252+ template . icon . style . setProperty ( '--background-dark' , null ) ;
253+ template . icon . style . setProperty ( '--background-light' , null ) ;
254+
255+ const { metadata } = node . element ;
256+ if ( ThemeIcon . isThemeIcon ( metadata . icon ) ) {
257+ // css
258+ const className = ThemeIcon . asClassName ( metadata . icon ) ;
259+ template . icon . className = className ? `theme-icon ${ className } ` : '' ;
260+
261+ } else if ( metadata . icon ) {
262+ // background-image
263+ template . icon . className = 'uri-icon' ;
264+ template . icon . style . setProperty ( '--background-dark' , `url("${ metadata . icon . dark . toString ( true ) } ")` ) ;
265+ template . icon . style . setProperty ( '--background-light' , `url("${ metadata . icon . light . toString ( true ) } ")` ) ;
266+ }
267+
268+ template . label . setLabel ( metadata . label , metadata . description , {
269+ descriptionMatches : createMatches ( node . filterData ) ,
270+ } ) ;
247271 }
248272
249273 disposeTemplate ( template : CategoryElementTemplate ) : void {
@@ -431,7 +455,7 @@ export class BulkEditNaviLabelProvider implements IKeyboardNavigationLabelProvid
431455 if ( element instanceof FileElement ) {
432456 return basename ( element . uri ) ;
433457 } else if ( element instanceof BulkCategory ) {
434- return element . label ;
458+ return element . metadata . label ;
435459 }
436460 return undefined ;
437461 }
0 commit comments