@@ -22,7 +22,7 @@ import { Schemas } from 'vs/base/common/network';
2222import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService' ;
2323import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
2424import { 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' ;
2626import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
2727import { IRemoteAgentEnvironment } from 'vs/platform/remote/common/remoteAgentEnvironment' ;
2828import { 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