Skip to content

Commit 4ba2070

Browse files
committed
Ensure that when there is a Windows drive letter as the whole path the simple file picker keeps the slash
Part of microsoft/vscode-remote-release#1596
1 parent 5d0bd49 commit 4ba2070

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,12 @@ export class SimpleFileDialog {
290290

291291
function doResolve(dialog: SimpleFileDialog, uri: URI | undefined) {
292292
if (uri) {
293-
uri = resources.removeTrailingPathSeparator(uri);
293+
// If the uri is only the drive letter, make sure it has the trailing path separator
294+
if (/^[a-zA-Z]:(\/$|\\$|$)/.test(uri.fsPath)) {
295+
uri = resources.addTrailingPathSeparator(uri);
296+
} else {
297+
uri = resources.removeTrailingPathSeparator(uri);
298+
}
294299
}
295300
resolve(uri);
296301
dialog.contextKey.set(false);

0 commit comments

Comments
 (0)