Skip to content

Commit 8505eb1

Browse files
authored
showOpenDialog with filter set doesn't show relevant dotfiles (microsoft#184592)
Fixes microsoft#182730
1 parent 50e4c03 commit 8505eb1

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,9 +994,22 @@ export class SimpleFileDialog implements ISimpleFileDialog {
994994
return sorted;
995995
}
996996

997+
private extname(file: URI): string {
998+
const ext = resources.extname(file);
999+
if (ext.length === 0) {
1000+
const basename = resources.basename(file);
1001+
if (basename.startsWith('.')) {
1002+
return basename;
1003+
}
1004+
} else {
1005+
return ext;
1006+
}
1007+
return '';
1008+
}
1009+
9971010
private filterFile(file: URI): boolean {
9981011
if (this.options.filters) {
999-
const ext = resources.extname(file);
1012+
const ext = this.extname(file);
10001013
for (let i = 0; i < this.options.filters.length; i++) {
10011014
for (let j = 0; j < this.options.filters[i].extensions.length; j++) {
10021015
const testExt = this.options.filters[i].extensions[j];

0 commit comments

Comments
 (0)