Skip to content

Commit fb335eb

Browse files
Prevent duplicate text in workspace folder picker when path has no parent (fix microsoft#183418) (microsoft#183427)
* Prevent duplicate text in workspace folder picker when path has no parent (fix microsoft#183418) * Instead, blank description when it matched label * Set `description` undefined when same as `label`
1 parent 2dfb838 commit fb335eb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/vs/workbench/browser/actions/workspaceCommands.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,12 @@ CommandsRegistry.registerCommand(PICK_WORKSPACE_FOLDER_COMMAND_ID, async functio
117117
}
118118

119119
const folderPicks: IQuickPickItem[] = folders.map(folder => {
120+
const label = folder.name;
121+
const description = labelService.getUriLabel(dirname(folder.uri), { relative: true });
122+
120123
return {
121-
label: folder.name,
122-
description: labelService.getUriLabel(dirname(folder.uri), { relative: true }),
124+
label,
125+
description: description !== label ? description : undefined, // https://github.com/microsoft/vscode/issues/183418
123126
folder,
124127
iconClasses: getIconClasses(modelService, languageService, folder.uri, FileKind.ROOT_FOLDER)
125128
};

0 commit comments

Comments
 (0)