Skip to content

Commit b0f1494

Browse files
committed
restore old case ignore behaviour unless explicitly set
1 parent fcac248 commit b0f1494

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/vs/base/common/map.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import { URI } from 'vs/base/common/uri';
77
import { CharCode } from 'vs/base/common/charCode';
88
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';
911

1012
export function getOrSet<K, V>(map: Map<K, V>, key: K, value: V): V {
1113
let result = map.get(key);
@@ -138,7 +140,7 @@ export class UriIterator implements IKeyIterator<URI> {
138140
private _states: UriIteratorState[] = [];
139141
private _stateIdx: number = 0;
140142

141-
constructor(private readonly _ignorePathCasing: boolean) { }
143+
constructor(private readonly _ignorePathCasing: boolean | undefined) { }
142144

143145
reset(key: URI): this {
144146
this._value = key;
@@ -150,7 +152,10 @@ export class UriIterator implements IKeyIterator<URI> {
150152
this._states.push(UriIteratorState.Authority);
151153
}
152154
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+
);
154159
this._pathIterator.reset(key.path);
155160
if (this._pathIterator.value()) {
156161
this._states.push(UriIteratorState.Path);
@@ -226,7 +231,7 @@ class TernarySearchTreeNode<K, V> {
226231

227232
export class TernarySearchTree<K, V> {
228233

229-
static forUris<E>(ignorePathCasing: boolean = false): TernarySearchTree<URI, E> {
234+
static forUris<E>(ignorePathCasing?: boolean): TernarySearchTree<URI, E> {
230235
return new TernarySearchTree<URI, E>(new UriIterator(ignorePathCasing));
231236
}
232237

0 commit comments

Comments
 (0)