Skip to content

Commit a70c73c

Browse files
committed
Simple file dialog working for network share
Fixes microsoft#86420
1 parent 7155f24 commit a70c73c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { Schemas } from 'vs/base/common/network';
2222
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
2323
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
2424
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
25-
import { equalsIgnoreCase, format, startsWithIgnoreCase } from 'vs/base/common/strings';
25+
import { equalsIgnoreCase, format, startsWithIgnoreCase, startsWith } from 'vs/base/common/strings';
2626
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
2727
import { IRemoteAgentEnvironment } from 'vs/platform/remote/common/remoteAgentEnvironment';
2828
import { isValidBasename } from 'vs/base/common/extpath';
@@ -205,8 +205,11 @@ export class SimpleFileDialog {
205205
}
206206

207207
private remoteUriFrom(path: string): URI {
208-
path = path.replace(/\\/g, '/');
209-
return resources.toLocalResource(URI.from({ scheme: this.scheme, path }), this.scheme === Schemas.file ? undefined : this.remoteAuthority);
208+
if (!startsWith(path, '\\\\')) {
209+
path = path.replace(/\\/g, '/');
210+
}
211+
const uri: URI = this.scheme === Schemas.file ? URI.file(path) : URI.from({ scheme: this.scheme, path });
212+
return resources.toLocalResource(uri, uri.scheme === Schemas.file ? undefined : this.remoteAuthority);
210213
}
211214

212215
private getScheme(available: readonly string[] | undefined, defaultUri: URI | undefined): string {

0 commit comments

Comments
 (0)