@@ -1762,6 +1762,10 @@ namespace ts {
1762
1762
return compareComparableValues ( a , b ) ;
1763
1763
}
1764
1764
1765
+ export function getStringComparer ( ignoreCase ?: boolean ) {
1766
+ return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive ;
1767
+ }
1768
+
1765
1769
/**
1766
1770
* Creates a string comparer for use with string collation in the UI.
1767
1771
*/
@@ -2274,7 +2278,7 @@ namespace ts {
2274
2278
const aComponents = getNormalizedPathComponents ( a , currentDirectory ) ;
2275
2279
const bComponents = getNormalizedPathComponents ( b , currentDirectory ) ;
2276
2280
const sharedLength = Math . min ( aComponents . length , bComponents . length ) ;
2277
- const comparer = ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive ;
2281
+ const comparer = getStringComparer ( ignoreCase ) ;
2278
2282
for ( let i = 0 ; i < sharedLength ; i ++ ) {
2279
2283
const result = comparer ( aComponents [ i ] , bComponents [ i ] ) ;
2280
2284
if ( result !== Comparison . EqualTo ) {
@@ -2615,7 +2619,7 @@ namespace ts {
2615
2619
}
2616
2620
2617
2621
// Sort the offsets array using either the literal or canonical path representations.
2618
- includeBasePaths . sort ( useCaseSensitiveFileNames ? compareStringsCaseSensitive : compareStringsCaseInsensitive ) ;
2622
+ includeBasePaths . sort ( getStringComparer ( ! useCaseSensitiveFileNames ) ) ;
2619
2623
2620
2624
// Iterate over each include base path and include unique base paths that are not a
2621
2625
// subpath of an existing base path
0 commit comments