Skip to content

Commit 617f489

Browse files
author
Benjamin Pasero
committed
files - adopt extUri.getComparisonKey
1 parent 007d686 commit 617f489

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,10 @@ export class FileService extends Disposable implements IFileService {
907907
}
908908

909909
private toWatchKey(provider: IFileSystemProvider, resource: URI, options: IWatchOptions): string {
910+
const { extUri } = this.getExtUri(provider);
911+
910912
return [
911-
this.toMapKey(provider, resource), // lowercase path if the provider is case insensitive
913+
extUri.getComparisonKey(resource), // lowercase path if the provider is case insensitive
912914
String(options.recursive), // use recursive: true | false as part of the key
913915
options.excludes.join() // use excludes as part of the key
914916
].join();
@@ -928,10 +930,12 @@ export class FileService extends Disposable implements IFileService {
928930
private writeQueues: Map<string, Queue<void>> = new Map();
929931

930932
private ensureWriteQueue(provider: IFileSystemProvider, resource: URI): Queue<void> {
933+
const { extUri } = this.getExtUri(provider);
934+
const queueKey = extUri.getComparisonKey(resource);
935+
931936
// ensure to never write to the same resource without finishing
932937
// the one write. this ensures a write finishes consistently
933938
// (even with error) before another write is done.
934-
const queueKey = this.toMapKey(provider, resource);
935939
let writeQueue = this.writeQueues.get(queueKey);
936940
if (!writeQueue) {
937941
writeQueue = new Queue<void>();
@@ -947,12 +951,6 @@ export class FileService extends Disposable implements IFileService {
947951
return writeQueue;
948952
}
949953

950-
private toMapKey(provider: IFileSystemProvider, resource: URI): string {
951-
const isPathCaseSensitive = !!(provider.capabilities & FileSystemProviderCapabilities.PathCaseSensitive);
952-
953-
return isPathCaseSensitive ? resource.toString() : resource.toString().toLowerCase();
954-
}
955-
956954
private async doWriteBuffered(provider: IFileSystemProviderWithOpenReadWriteCloseCapability, resource: URI, readableOrStream: VSBufferReadable | VSBufferReadableStream, options?: IWriteFileOptions): Promise<void> {
957955
return this.ensureWriteQueue(provider, resource).queue(async () => {
958956

0 commit comments

Comments
 (0)