1
>
/*---------------------------------------------------------------------------------------------
uriIdentityService.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { IUriIdentityService } from './uriIdentity.js';
7
>
import { URI } from '../../../base/common/uri.js';
8
>
import { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';
9
>
import { IFileService, FileSystemProviderCapabilities, IFileSystemProviderCapabilitiesChangeEvent, IFileSystemProviderRegistrationEvent } from '../../files/common/files.js';
10
>
import { ExtUri, IExtUri, normalizePath } from '../../../base/common/resources.js';
11
>
import { Event } from '../../../base/common/event.js';
12
>
import { DisposableStore } from '../../../base/common/lifecycle.js';
13
>
import { quickSelect } from '../../../base/common/arrays.js';
14
>
15
>
class Entry {
16
>
static _clock = 0;
17
>
time: number = Entry._clock++;
18
>
constructor(readonly uri: URI) { }
19
>
touch() {
20
this.time = Entry._clock++;
21
return this;
22
}
24
>
25
>
export class UriIdentityService implements IUriIdentityService {
26
>
27
>
declare readonly _serviceBrand: undefined;
28
>
29
>
readonly extUri: IExtUri;
30
>
31
>
private readonly _dispooables = new DisposableStore();
32
>
private readonly _canonicalUris: Map<string, Entry>;
33
>
private readonly _limit = 2 ** 16;
34
>
35
>
constructor(@IFileService private readonly _fileService: IFileService) {
36
37
const schemeIgnoresPathCasingCache = new Map<string, boolean>();