@@ -612,6 +612,8 @@ export class QuickInputList {
612
612
this . list . layout ( ) ;
613
613
return false ;
614
614
}
615
+
616
+ const queryWithWhitespace = query ;
615
617
query = query . trim ( ) ;
616
618
617
619
// Reset filtering
@@ -634,7 +636,7 @@ export class QuickInputList {
634
636
if ( this . matchOnLabelMode === 'fuzzy' ) {
635
637
labelHighlights = this . matchOnLabel ? withNullAsUndefined ( matchesFuzzyIconAware ( query , parseLabelWithIcons ( element . saneLabel ) ) ) : undefined ;
636
638
} else {
637
- labelHighlights = this . matchOnLabel ? withNullAsUndefined ( matchesContiguousIconAware ( query , parseLabelWithIcons ( element . saneLabel ) ) ) : undefined ;
639
+ labelHighlights = this . matchOnLabel ? withNullAsUndefined ( matchesContiguousIconAware ( queryWithWhitespace , parseLabelWithIcons ( element . saneLabel ) ) ) : undefined ;
638
640
}
639
641
const descriptionHighlights = this . matchOnDescription ? withNullAsUndefined ( matchesFuzzyIconAware ( query , parseLabelWithIcons ( element . saneDescription || '' ) ) ) : undefined ;
640
642
const detailHighlights = this . matchOnDetail ? withNullAsUndefined ( matchesFuzzyIconAware ( query , parseLabelWithIcons ( element . saneDetail || '' ) ) ) : undefined ;
@@ -733,13 +735,13 @@ export class QuickInputList {
733
735
}
734
736
}
735
737
736
- export function matchesContiguousIconAware ( query : string , target : IParsedLabelWithIcons , enableSeparateSubstringMatching = false ) : IMatch [ ] | null {
738
+ export function matchesContiguousIconAware ( query : string , target : IParsedLabelWithIcons ) : IMatch [ ] | null {
737
739
738
740
const { text, iconOffsets } = target ;
739
741
740
742
// Return early if there are no icon markers in the word to match against
741
743
if ( ! iconOffsets || iconOffsets . length === 0 ) {
742
- return matchesContiguous ( query , text , enableSeparateSubstringMatching ) ;
744
+ return matchesContiguous ( query , text ) ;
743
745
}
744
746
745
747
// Trim the word to match against because it could have leading
@@ -748,7 +750,7 @@ export function matchesContiguousIconAware(query: string, target: IParsedLabelWi
748
750
const leadingWhitespaceOffset = text . length - wordToMatchAgainstWithoutIconsTrimmed . length ;
749
751
750
752
// match on value without icon
751
- const matches = matchesContiguous ( query , wordToMatchAgainstWithoutIconsTrimmed , enableSeparateSubstringMatching ) ;
753
+ const matches = matchesContiguous ( query , wordToMatchAgainstWithoutIconsTrimmed ) ;
752
754
753
755
// Map matches back to offsets with icon and trimming
754
756
if ( matches ) {
@@ -762,7 +764,7 @@ export function matchesContiguousIconAware(query: string, target: IParsedLabelWi
762
764
return matches ;
763
765
}
764
766
765
- function matchesContiguous ( word : string , wordToMatchAgainst : string , enableSeparateSubstringMatching = false ) : IMatch [ ] | null {
767
+ function matchesContiguous ( word : string , wordToMatchAgainst : string ) : IMatch [ ] | null {
766
768
const matchIndex = wordToMatchAgainst . toLowerCase ( ) . indexOf ( word . toLowerCase ( ) ) ;
767
769
if ( matchIndex !== - 1 ) {
768
770
return [ { start : matchIndex , end : matchIndex + word . length } ] ;
0 commit comments