Skip to content

Commit e87183e

Browse files
committed
make UriIterator accept ignorePathCasing arg, microsoft#93368
1 parent e5ad2b2 commit e87183e

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/vs/base/common/map.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import { URI } from 'vs/base/common/uri';
77
import { CharCode } from 'vs/base/common/charCode';
88
import { compareSubstringIgnoreCase, compare, compareSubstring } from 'vs/base/common/strings';
9-
import { Schemas } from 'vs/base/common/network';
10-
import { isLinux } from 'vs/base/common/platform';
119

1210
/**
1311
* @deprecated ES6: use `[...SetOrMap.values()]`
@@ -161,6 +159,8 @@ export class UriIterator implements IKeyIterator<URI> {
161159
private _states: UriIteratorState[] = [];
162160
private _stateIdx: number = 0;
163161

162+
constructor(private readonly _ignorePathCasing: boolean = false) { }
163+
164164
reset(key: URI): this {
165165
this._value = key;
166166
this._states = [];
@@ -171,10 +171,7 @@ export class UriIterator implements IKeyIterator<URI> {
171171
this._states.push(UriIteratorState.Authority);
172172
}
173173
if (this._value.path) {
174-
//todo@jrieken the case-sensitive logic is copied form `resources.ts#hasToIgnoreCase`
175-
// which cannot be used because it depends on this
176-
const caseSensitive = key.scheme === Schemas.file && isLinux;
177-
this._pathIterator = new PathIterator(false, caseSensitive);
174+
this._pathIterator = new PathIterator(false, !this._ignorePathCasing);
178175
this._pathIterator.reset(key.path);
179176
if (this._pathIterator.value()) {
180177
this._states.push(UriIteratorState.Path);

0 commit comments

Comments
 (0)