mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-26 10:16:01 +01:00
files - some more readonly use
This commit is contained in:
@@ -63,8 +63,6 @@ export class IndexedDB {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class IndexedDBFileSystemProvider extends KeyValueFileSystemProvider {
|
||||
|
||||
constructor(scheme: string, private readonly database: IDBDatabase, private readonly store: string) {
|
||||
|
||||
@@ -26,19 +26,19 @@ export class FileService extends Disposable implements IFileService {
|
||||
|
||||
private readonly BUFFER_SIZE = 64 * 1024;
|
||||
|
||||
constructor(@ILogService private logService: ILogService) {
|
||||
constructor(@ILogService private readonly logService: ILogService) {
|
||||
super();
|
||||
}
|
||||
|
||||
//#region File System Provider
|
||||
|
||||
private _onDidChangeFileSystemProviderRegistrations = this._register(new Emitter<IFileSystemProviderRegistrationEvent>());
|
||||
private readonly _onDidChangeFileSystemProviderRegistrations = this._register(new Emitter<IFileSystemProviderRegistrationEvent>());
|
||||
readonly onDidChangeFileSystemProviderRegistrations = this._onDidChangeFileSystemProviderRegistrations.event;
|
||||
|
||||
private _onWillActivateFileSystemProvider = this._register(new Emitter<IFileSystemProviderActivationEvent>());
|
||||
private readonly _onWillActivateFileSystemProvider = this._register(new Emitter<IFileSystemProviderActivationEvent>());
|
||||
readonly onWillActivateFileSystemProvider = this._onWillActivateFileSystemProvider.event;
|
||||
|
||||
private _onDidChangeFileSystemProviderCapabilities = this._register(new Emitter<IFileSystemProviderCapabilitiesChangeEvent>());
|
||||
private readonly _onDidChangeFileSystemProviderCapabilities = this._register(new Emitter<IFileSystemProviderCapabilitiesChangeEvent>());
|
||||
readonly onDidChangeFileSystemProviderCapabilities = this._onDidChangeFileSystemProviderCapabilities.event;
|
||||
|
||||
private readonly provider = new Map<string, IFileSystemProvider>();
|
||||
@@ -146,10 +146,10 @@ export class FileService extends Disposable implements IFileService {
|
||||
|
||||
//#endregion
|
||||
|
||||
private _onDidRunOperation = this._register(new Emitter<FileOperationEvent>());
|
||||
private readonly _onDidRunOperation = this._register(new Emitter<FileOperationEvent>());
|
||||
readonly onDidRunOperation = this._onDidRunOperation.event;
|
||||
|
||||
private _onError = this._register(new Emitter<Error>());
|
||||
private readonly _onError = this._register(new Emitter<Error>());
|
||||
readonly onError = this._onError.event;
|
||||
|
||||
//#region File Metadata Resolving
|
||||
@@ -881,10 +881,10 @@ export class FileService extends Disposable implements IFileService {
|
||||
|
||||
//#region File Watching
|
||||
|
||||
private _onDidFilesChange = this._register(new Emitter<FileChangesEvent>());
|
||||
private readonly _onDidFilesChange = this._register(new Emitter<FileChangesEvent>());
|
||||
readonly onDidFilesChange = this._onDidFilesChange.event;
|
||||
|
||||
private activeWatchers = new Map<string, { disposable: IDisposable, count: number }>();
|
||||
private readonly activeWatchers = new Map<string, { disposable: IDisposable, count: number }>();
|
||||
|
||||
watch(resource: URI, options: IWatchOptions = { recursive: false, excludes: [] }): IDisposable {
|
||||
let watchDisposed = false;
|
||||
@@ -950,7 +950,7 @@ export class FileService extends Disposable implements IFileService {
|
||||
|
||||
//#region Helpers
|
||||
|
||||
private writeQueues: Map<string, Queue<void>> = new Map();
|
||||
private readonly writeQueues: Map<string, Queue<void>> = new Map();
|
||||
|
||||
private ensureWriteQueue(provider: IFileSystemProvider, resource: URI): Queue<void> {
|
||||
const { extUri } = this.getExtUri(provider);
|
||||
|
||||
@@ -15,7 +15,7 @@ export class DiskFileSystemProvider extends NodeDiskFileSystemProvider {
|
||||
|
||||
constructor(
|
||||
logService: ILogService,
|
||||
private electronService: IElectronService,
|
||||
private readonly electronService: IElectronService,
|
||||
options?: IDiskFileSystemProviderOptions
|
||||
) {
|
||||
super(logService, options);
|
||||
|
||||
@@ -46,7 +46,10 @@ export class DiskFileSystemProvider extends Disposable implements
|
||||
|
||||
private readonly BUFFER_SIZE = this.options?.bufferSize || 64 * 1024;
|
||||
|
||||
constructor(private logService: ILogService, private options?: IDiskFileSystemProviderOptions) {
|
||||
constructor(
|
||||
private readonly logService: ILogService,
|
||||
private readonly options?: IDiskFileSystemProviderOptions
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -198,9 +201,9 @@ export class DiskFileSystemProvider extends Disposable implements
|
||||
}
|
||||
}
|
||||
|
||||
private mapHandleToPos: Map<number, number> = new Map();
|
||||
private readonly mapHandleToPos: Map<number, number> = new Map();
|
||||
|
||||
private writeHandles: Set<number> = new Set();
|
||||
private readonly writeHandles: Set<number> = new Set();
|
||||
private canFlush: boolean = true;
|
||||
|
||||
async open(resource: URI, opts: FileOpenOptions): Promise<number> {
|
||||
@@ -502,14 +505,14 @@ export class DiskFileSystemProvider extends Disposable implements
|
||||
|
||||
//#region File Watching
|
||||
|
||||
private _onDidWatchErrorOccur = this._register(new Emitter<string>());
|
||||
private readonly _onDidWatchErrorOccur = this._register(new Emitter<string>());
|
||||
readonly onDidErrorOccur = this._onDidWatchErrorOccur.event;
|
||||
|
||||
private _onDidChangeFile = this._register(new Emitter<readonly IFileChange[]>());
|
||||
private readonly _onDidChangeFile = this._register(new Emitter<readonly IFileChange[]>());
|
||||
readonly onDidChangeFile = this._onDidChangeFile.event;
|
||||
|
||||
private recursiveWatcher: WindowsWatcherService | UnixWatcherService | NsfwWatcherService | undefined;
|
||||
private recursiveFoldersToWatch: { path: string, excludes: string[] }[] = [];
|
||||
private readonly recursiveFoldersToWatch: { path: string, excludes: string[] }[] = [];
|
||||
private recursiveWatchRequestDelayer = this._register(new ThrottledDelayer<void>(0));
|
||||
|
||||
private recursiveWatcherLogLevelListener: IDisposable | undefined;
|
||||
|
||||
Reference in New Issue
Block a user