From a2ad3d4ff4ae6019627028d6a65ef5f228d5b6f7 Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 20 May 2019 16:08:16 -0500 Subject: [PATCH] Show hidden files by default Since there is no other way to enable hidden files, it seems better to enable it by default otherwise there are some folders/files you simply can never open from the dialog. --- packages/vscode/src/dialog.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/vscode/src/dialog.ts b/packages/vscode/src/dialog.ts index ff99bc70..e3dc3e58 100644 --- a/packages/vscode/src/dialog.ts +++ b/packages/vscode/src/dialog.ts @@ -52,7 +52,15 @@ export type DialogOptions = OpenDialogOptions | SaveDialogOptions; export const showOpenDialog = (options: OpenDialogOptions): Promise => { return new Promise((resolve, reject): void => { - const dialog = new Dialog(DialogType.Open, options); + // Make the default to show hidden files and directories since there is no + // other way to make them visible in the dialogs currently. + const dialog = new Dialog(DialogType.Open, typeof options.properties.showHiddenFiles === "undefined" ? { + ...options, + properties: { + ...options.properties, + showHiddenFiles: true, + }, + } : options); dialog.onSelect((e) => { dialog.dispose(); resolve(e);