@@ -652,6 +652,11 @@ namespace CommandPalette {
652
652
*/
653
653
readonly isToggled : boolean ;
654
654
655
+ /**
656
+ * Whether the command item is toggleable.
657
+ */
658
+ readonly isToggleable : boolean ;
659
+
655
660
/**
656
661
* Whether the command item is visible.
657
662
*/
@@ -779,8 +784,24 @@ namespace CommandPalette {
779
784
renderItem ( data : IItemRenderData ) : VirtualElement {
780
785
let className = this . createItemClass ( data ) ;
781
786
let dataset = this . createItemDataset ( data ) ;
787
+ if ( data . item . isToggleable ) {
788
+ return (
789
+ h . li ( {
790
+ className,
791
+ dataset,
792
+ role : 'checkbox' ,
793
+ 'aria-checked' : `${ data . item . isToggled } `
794
+ } ,
795
+ this . renderItemIcon ( data ) ,
796
+ this . renderItemContent ( data ) ,
797
+ this . renderItemShortcut ( data ) )
798
+ )
799
+ }
782
800
return (
783
- h . li ( { className, dataset } ,
801
+ h . li ( {
802
+ className,
803
+ dataset
804
+ } ,
784
805
this . renderItemIcon ( data ) ,
785
806
this . renderItemContent ( data ) ,
786
807
this . renderItemShortcut ( data ) ,
@@ -1551,6 +1572,13 @@ namespace Private {
1551
1572
return this . _commands . isToggled ( this . command , this . args ) ;
1552
1573
}
1553
1574
1575
+ /**
1576
+ * Whether the command item is toggleable.
1577
+ */
1578
+ get isToggleable ( ) : boolean {
1579
+ return this . _commands . isToggleable ( this . command , this . args ) ;
1580
+ }
1581
+
1554
1582
/**
1555
1583
* Whether the command item is visible.
1556
1584
*/
0 commit comments