22 * Copyright (c) Microsoft Corporation. All rights reserved.
33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
5- import { Emitter } from '../../../base/common/event.js' ;
5+ import { Emitter , Event } from '../../../base/common/event.js' ;
66import { Disposable , IDisposable , toDisposable } from '../../../base/common/lifecycle.js' ;
77import { IFileSystemProviderWithFileReadWriteCapability , IFileChange , IWatchOptions , IStat , IFileOverwriteOptions , FileType , IFileWriteOptions , IFileDeleteOptions , FileSystemProviderCapabilities , IFileSystemProviderWithFileReadStreamCapability , IFileReadStreamOptions , IFileSystemProviderWithFileAtomicReadCapability , hasFileFolderCopyCapability , IFileSystemProviderWithOpenReadWriteCloseCapability , IFileOpenOptions , IFileSystemProviderWithFileAtomicWriteCapability , IFileSystemProviderWithFileAtomicDeleteCapability , IFileSystemProviderWithFileFolderCopyCapability , IFileSystemProviderWithFileCloneCapability , hasFileCloneCapability , IFileAtomicReadOptions , IFileAtomicOptions } from '../../files/common/files.js' ;
88import { URI } from '../../../base/common/uri.js' ;
@@ -29,14 +29,14 @@ export class FileUserDataProvider extends Disposable implements
2929 IFileSystemProviderWithFileAtomicDeleteCapability ,
3030 IFileSystemProviderWithFileCloneCapability {
3131
32- readonly capabilities = this . fileSystemProvider . capabilities ;
33- readonly onDidChangeCapabilities = this . fileSystemProvider . onDidChangeCapabilities ;
32+ readonly capabilities : FileSystemProviderCapabilities ;
33+ readonly onDidChangeCapabilities : Event < void > ;
3434
35- private readonly _onDidChangeFile = this . _register ( new Emitter < readonly IFileChange [ ] > ( ) ) ;
36- readonly onDidChangeFile = this . _onDidChangeFile . event ;
35+ private readonly _onDidChangeFile : Emitter < readonly IFileChange [ ] > ;
36+ readonly onDidChangeFile : Event < readonly IFileChange [ ] > ;
3737
38- private readonly watchResources = TernarySearchTree . forUris < URI > ( ( ) => ! ( this . capabilities & FileSystemProviderCapabilities . PathCaseSensitive ) ) ;
39- private readonly atomicReadWriteResources = new ResourceSet ( ( uri ) => this . uriIdentityService . extUri . getComparisonKey ( this . toFileSystemResource ( uri ) ) ) ;
38+ private readonly watchResources : TernarySearchTree < URI , URI > ;
39+ private readonly atomicReadWriteResources : ResourceSet ;
4040
4141 constructor (
4242 private readonly fileSystemScheme : string ,
@@ -47,6 +47,12 @@ export class FileUserDataProvider extends Disposable implements
4747 private readonly logService : ILogService ,
4848 ) {
4949 super ( ) ;
50+ this . capabilities = this . fileSystemProvider . capabilities ;
51+ this . onDidChangeCapabilities = this . fileSystemProvider . onDidChangeCapabilities ;
52+ this . _onDidChangeFile = this . _register ( new Emitter ( ) ) ;
53+ this . onDidChangeFile = this . _onDidChangeFile . event ;
54+ this . watchResources = TernarySearchTree . forUris ( ( ) => ! ( this . capabilities & 1024 /* FileSystemProviderCapabilities.PathCaseSensitive */ ) ) ;
55+ this . atomicReadWriteResources = new ResourceSet ( ( uri ) => this . uriIdentityService . extUri . getComparisonKey ( this . toFileSystemResource ( uri ) ) ) ;
5056 this . updateAtomicReadWritesResources ( ) ;
5157 this . _register ( userDataProfilesService . onDidChangeProfiles ( ( ) => this . updateAtomicReadWritesResources ( ) ) ) ;
5258 this . _register ( this . fileSystemProvider . onDidChangeFile ( e => this . handleFileChanges ( e ) ) ) ;
0 commit comments