Ensure that when there is a Windows drive letter as the whole path the simple file picker keeps the slash

Part of https://github.com/microsoft/vscode-remote-release/issues/1596
This commit is contained in:
Alex Ross 2020-01-24 11:17:54 +01:00
parent 5d0bd4987c
commit 4ba2070818

View file

@ -290,7 +290,12 @@ export class SimpleFileDialog {
function doResolve(dialog: SimpleFileDialog, uri: URI | undefined) {
if (uri) {
uri = resources.removeTrailingPathSeparator(uri);
// If the uri is only the drive letter, make sure it has the trailing path separator
if (/^[a-zA-Z]:(\/$|\\$|$)/.test(uri.fsPath)) {
uri = resources.addTrailingPathSeparator(uri);
} else {
uri = resources.removeTrailingPathSeparator(uri);
}
}
resolve(uri);
dialog.contextKey.set(false);