@@ -35,6 +35,7 @@ interface IListElement {
35
35
readonly index : number ;
36
36
readonly item : IQuickPickItem ;
37
37
readonly saneLabel : string ;
38
+ readonly saneSortLabel : string ;
38
39
readonly saneMeta ?: string ;
39
40
readonly saneAriaLabel : string ;
40
41
readonly saneDescription ?: string ;
@@ -52,6 +53,7 @@ class ListElement implements IListElement, IDisposable {
52
53
index ! : number ;
53
54
item ! : IQuickPickItem ;
54
55
saneLabel ! : string ;
56
+ saneSortLabel ! : string ;
55
57
saneMeta ! : string ;
56
58
saneAriaLabel ! : string ;
57
59
saneDescription ?: string ;
@@ -440,6 +442,7 @@ export class QuickInputList {
440
442
if ( item . type !== 'separator' ) {
441
443
const previous = index && inputElements [ index - 1 ] ;
442
444
const saneLabel = item . label && item . label . replace ( / \r ? \n / g, ' ' ) ;
445
+ const saneSortLabel = parseLabelWithIcons ( saneLabel ) . text . trim ( ) ;
443
446
const saneMeta = item . meta && item . meta . replace ( / \r ? \n / g, ' ' ) ;
444
447
const saneDescription = item . description && item . description . replace ( / \r ? \n / g, ' ' ) ;
445
448
const saneDetail = item . detail && item . detail . replace ( / \r ? \n / g, ' ' ) ;
@@ -454,6 +457,7 @@ export class QuickInputList {
454
457
index,
455
458
item,
456
459
saneLabel,
460
+ saneSortLabel,
457
461
saneMeta,
458
462
saneAriaLabel,
459
463
saneDescription,
@@ -738,7 +742,7 @@ function compareEntries(elementA: ListElement, elementB: ListElement, lookFor: s
738
742
return 0 ;
739
743
}
740
744
741
- return compareAnything ( elementA . saneLabel , elementB . saneLabel , lookFor ) ;
745
+ return compareAnything ( elementA . saneSortLabel , elementB . saneSortLabel , lookFor ) ;
742
746
}
743
747
744
748
class QuickInputAccessibilityProvider implements IListAccessibilityProvider < ListElement > {
0 commit comments