From 1b1a4cc2415264665778cc72534d17db05299697 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Thu, 25 Apr 2019 11:55:51 +0200 Subject: [PATCH] Fix file dialog case for waving without extension Fixes #72850 --- .../services/dialogs/browser/remoteFileDialog.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts b/src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts index 479a177d6c7..a75a351c09c 100644 --- a/src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts +++ b/src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts @@ -501,18 +501,16 @@ export class RemoteFileDialog { // Make sure that the suffix is added. If the user deleted it, we automatically add it here let hasExt: boolean = false; const currentExt = resources.extname(uri).substr(1); - if (currentExt !== '') { - for (let i = 0; i < this.options.filters.length; i++) { - for (let j = 0; j < this.options.filters[i].extensions.length; j++) { - if ((this.options.filters[i].extensions[j] === '*') || (this.options.filters[i].extensions[j] === currentExt)) { - hasExt = true; - break; - } - } - if (hasExt) { + for (let i = 0; i < this.options.filters.length; i++) { + for (let j = 0; j < this.options.filters[i].extensions.length; j++) { + if ((this.options.filters[i].extensions[j] === '*') || (this.options.filters[i].extensions[j] === currentExt)) { + hasExt = true; break; } } + if (hasExt) { + break; + } } if (!hasExt) { result = resources.joinPath(resources.dirname(uri), resources.basename(uri) + '.' + this.options.filters[0].extensions[0]);