6
6
import { URI } from 'vs/base/common/uri' ;
7
7
import { CharCode } from 'vs/base/common/charCode' ;
8
8
import { compareSubstringIgnoreCase , compare , compareSubstring , compareIgnoreCase } from 'vs/base/common/strings' ;
9
+ import { isLinux } from 'vs/base/common/platform' ;
10
+ import { Schemas } from 'vs/base/common/network' ;
9
11
10
12
export function getOrSet < K , V > ( map : Map < K , V > , key : K , value : V ) : V {
11
13
let result = map . get ( key ) ;
@@ -138,7 +140,7 @@ export class UriIterator implements IKeyIterator<URI> {
138
140
private _states : UriIteratorState [ ] = [ ] ;
139
141
private _stateIdx : number = 0 ;
140
142
141
- constructor ( private readonly _ignorePathCasing : boolean ) { }
143
+ constructor ( private readonly _ignorePathCasing : boolean | undefined ) { }
142
144
143
145
reset ( key : URI ) : this {
144
146
this . _value = key ;
@@ -150,7 +152,10 @@ export class UriIterator implements IKeyIterator<URI> {
150
152
this . _states . push ( UriIteratorState . Authority ) ;
151
153
}
152
154
if ( this . _value . path ) {
153
- this . _pathIterator = new PathIterator ( false , ! this . _ignorePathCasing ) ;
155
+ this . _pathIterator = new PathIterator ( false , this . _ignorePathCasing === undefined
156
+ ? key . scheme === Schemas . file && isLinux
157
+ : ! this . _ignorePathCasing
158
+ ) ;
154
159
this . _pathIterator . reset ( key . path ) ;
155
160
if ( this . _pathIterator . value ( ) ) {
156
161
this . _states . push ( UriIteratorState . Path ) ;
@@ -226,7 +231,7 @@ class TernarySearchTreeNode<K, V> {
226
231
227
232
export class TernarySearchTree < K , V > {
228
233
229
- static forUris < E > ( ignorePathCasing : boolean = false ) : TernarySearchTree < URI , E > {
234
+ static forUris < E > ( ignorePathCasing ? : boolean ) : TernarySearchTree < URI , E > {
230
235
return new TernarySearchTree < URI , E > ( new UriIterator ( ignorePathCasing ) ) ;
231
236
}
232
237
0 commit comments