Skip to content

Commit a50bf5d

Browse files
committed
files - some more readonly use
1 parent fe9557d commit a50bf5d

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

src/vs/platform/files/browser/indexedDBFileSystemProvider.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ export class IndexedDB {
6363

6464
}
6565

66-
67-
6866
class IndexedDBFileSystemProvider extends KeyValueFileSystemProvider {
6967

7068
constructor(scheme: string, private readonly database: IDBDatabase, private readonly store: string) {

src/vs/platform/files/common/fileService.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ export class FileService extends Disposable implements IFileService {
2626

2727
private readonly BUFFER_SIZE = 64 * 1024;
2828

29-
constructor(@ILogService private logService: ILogService) {
29+
constructor(@ILogService private readonly logService: ILogService) {
3030
super();
3131
}
3232

3333
//#region File System Provider
3434

35-
private _onDidChangeFileSystemProviderRegistrations = this._register(new Emitter<IFileSystemProviderRegistrationEvent>());
35+
private readonly _onDidChangeFileSystemProviderRegistrations = this._register(new Emitter<IFileSystemProviderRegistrationEvent>());
3636
readonly onDidChangeFileSystemProviderRegistrations = this._onDidChangeFileSystemProviderRegistrations.event;
3737

38-
private _onWillActivateFileSystemProvider = this._register(new Emitter<IFileSystemProviderActivationEvent>());
38+
private readonly _onWillActivateFileSystemProvider = this._register(new Emitter<IFileSystemProviderActivationEvent>());
3939
readonly onWillActivateFileSystemProvider = this._onWillActivateFileSystemProvider.event;
4040

41-
private _onDidChangeFileSystemProviderCapabilities = this._register(new Emitter<IFileSystemProviderCapabilitiesChangeEvent>());
41+
private readonly _onDidChangeFileSystemProviderCapabilities = this._register(new Emitter<IFileSystemProviderCapabilitiesChangeEvent>());
4242
readonly onDidChangeFileSystemProviderCapabilities = this._onDidChangeFileSystemProviderCapabilities.event;
4343

4444
private readonly provider = new Map<string, IFileSystemProvider>();
@@ -146,10 +146,10 @@ export class FileService extends Disposable implements IFileService {
146146

147147
//#endregion
148148

149-
private _onDidRunOperation = this._register(new Emitter<FileOperationEvent>());
149+
private readonly _onDidRunOperation = this._register(new Emitter<FileOperationEvent>());
150150
readonly onDidRunOperation = this._onDidRunOperation.event;
151151

152-
private _onError = this._register(new Emitter<Error>());
152+
private readonly _onError = this._register(new Emitter<Error>());
153153
readonly onError = this._onError.event;
154154

155155
//#region File Metadata Resolving
@@ -881,10 +881,10 @@ export class FileService extends Disposable implements IFileService {
881881

882882
//#region File Watching
883883

884-
private _onDidFilesChange = this._register(new Emitter<FileChangesEvent>());
884+
private readonly _onDidFilesChange = this._register(new Emitter<FileChangesEvent>());
885885
readonly onDidFilesChange = this._onDidFilesChange.event;
886886

887-
private activeWatchers = new Map<string, { disposable: IDisposable, count: number }>();
887+
private readonly activeWatchers = new Map<string, { disposable: IDisposable, count: number }>();
888888

889889
watch(resource: URI, options: IWatchOptions = { recursive: false, excludes: [] }): IDisposable {
890890
let watchDisposed = false;
@@ -950,7 +950,7 @@ export class FileService extends Disposable implements IFileService {
950950

951951
//#region Helpers
952952

953-
private writeQueues: Map<string, Queue<void>> = new Map();
953+
private readonly writeQueues: Map<string, Queue<void>> = new Map();
954954

955955
private ensureWriteQueue(provider: IFileSystemProvider, resource: URI): Queue<void> {
956956
const { extUri } = this.getExtUri(provider);

src/vs/platform/files/electron-browser/diskFileSystemProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class DiskFileSystemProvider extends NodeDiskFileSystemProvider {
1515

1616
constructor(
1717
logService: ILogService,
18-
private electronService: IElectronService,
18+
private readonly electronService: IElectronService,
1919
options?: IDiskFileSystemProviderOptions
2020
) {
2121
super(logService, options);

src/vs/platform/files/node/diskFileSystemProvider.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ export class DiskFileSystemProvider extends Disposable implements
4646

4747
private readonly BUFFER_SIZE = this.options?.bufferSize || 64 * 1024;
4848

49-
constructor(private logService: ILogService, private options?: IDiskFileSystemProviderOptions) {
49+
constructor(
50+
private readonly logService: ILogService,
51+
private readonly options?: IDiskFileSystemProviderOptions
52+
) {
5053
super();
5154
}
5255

@@ -198,9 +201,9 @@ export class DiskFileSystemProvider extends Disposable implements
198201
}
199202
}
200203

201-
private mapHandleToPos: Map<number, number> = new Map();
204+
private readonly mapHandleToPos: Map<number, number> = new Map();
202205

203-
private writeHandles: Set<number> = new Set();
206+
private readonly writeHandles: Set<number> = new Set();
204207
private canFlush: boolean = true;
205208

206209
async open(resource: URI, opts: FileOpenOptions): Promise<number> {
@@ -502,14 +505,14 @@ export class DiskFileSystemProvider extends Disposable implements
502505

503506
//#region File Watching
504507

505-
private _onDidWatchErrorOccur = this._register(new Emitter<string>());
508+
private readonly _onDidWatchErrorOccur = this._register(new Emitter<string>());
506509
readonly onDidErrorOccur = this._onDidWatchErrorOccur.event;
507510

508-
private _onDidChangeFile = this._register(new Emitter<readonly IFileChange[]>());
511+
private readonly _onDidChangeFile = this._register(new Emitter<readonly IFileChange[]>());
509512
readonly onDidChangeFile = this._onDidChangeFile.event;
510513

511514
private recursiveWatcher: WindowsWatcherService | UnixWatcherService | NsfwWatcherService | undefined;
512-
private recursiveFoldersToWatch: { path: string, excludes: string[] }[] = [];
515+
private readonly recursiveFoldersToWatch: { path: string, excludes: string[] }[] = [];
513516
private recursiveWatchRequestDelayer = this._register(new ThrottledDelayer<void>(0));
514517

515518
private recursiveWatcherLogLevelListener: IDisposable | undefined;

0 commit comments

Comments
 (0)