From 1dc1e68109b45fbf10482caaa44726a5f1f6ffed Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 2 Apr 2024 10:56:29 +0200 Subject: [PATCH] Fix opening folders in file picker Part of #208937 --- .../workbench/services/dialogs/browser/simpleFileDialog.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts b/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts index f8380ed0204e4..5f3b9cbda7de3 100644 --- a/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts +++ b/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts @@ -584,9 +584,9 @@ export class SimpleFileDialog implements ISimpleFileDialog { } else { const newFolderIsOldFolder = resources.extUriIgnorePathCase.isEqual(this.currentFolder, valueUri); const newFolderIsSubFolder = resources.extUriIgnorePathCase.isEqual(this.currentFolder, resources.dirname(valueUri)); - const newFolderIsParent = !newFolderIsOldFolder && resources.extUriIgnorePathCase.isEqualOrParent(this.currentFolder, resources.dirname(valueUri)); - const newFolderIsUnrelated = !newFolderIsOldFolder && !newFolderIsParent && !newFolderIsSubFolder; - if (this.endsWithSlash(value) || newFolderIsParent || newFolderIsUnrelated) { + const newFolderIsParent = resources.extUriIgnorePathCase.isEqualOrParent(this.currentFolder, resources.dirname(valueUri)); + const newFolderIsUnrelated = !newFolderIsParent && !newFolderIsSubFolder; + if (!newFolderIsOldFolder && (this.endsWithSlash(value) || newFolderIsParent || newFolderIsUnrelated)) { let stat: IFileStatWithPartialMetadata | undefined; try { stat = await this.fileService.stat(valueUri);