Skip to content

Commit

Permalink
Show hidden files by default
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
code-asher committed May 20, 2019
1 parent 4a29cd1 commit a2ad3d4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/vscode/src/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ export type DialogOptions = OpenDialogOptions | SaveDialogOptions;

export const showOpenDialog = (options: OpenDialogOptions): Promise<string> => {
return new Promise<string>((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);
Expand Down

0 comments on commit a2ad3d4

Please sign in to comment.