From fba040af3249180da3ff861ebc5222ad4ee6169d Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 2 Apr 2024 11:12:58 +0200 Subject: [PATCH] Fix opening folders in file picker (#209330) 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);