Skip to content

When a local workspace root uses a FileSystemProvider where authority element of uri is significant, the SimpleFileDialog presented by File\Open File cannot navigate into subfolders #129296

@gjsjohnmurray

Description

@gjsjohnmurray

Issue Type: Bug

The problem seems to lie in this code:

private remoteUriFrom(path: string): URI {
if (!path.startsWith('\\\\')) {
path = path.replace(/\\/g, '/');
}
const uri: URI = this.scheme === Schemas.file ? URI.file(path) : URI.from({ scheme: this.scheme, path });
// If the default scheme is file, then we don't care about the remote authority
const authority = uri.scheme === Schemas.file ? undefined : this.remoteAuthority;
return resources.toLocalResource(uri, authority,
// If there is a remote authority, then we should use the system's default URI as the local scheme.
// If there is *no* remote authority, then we should use the default scheme for this dialog as that is already local.
authority ? this.pathService.defaultUriScheme : uri.scheme);
}

When the workspace is a local one, this.remoteAuthority is undefined, so the returned uri has authority: ''

I intend to prepare a variant of the MemFS sample to demonstrate the problem.

VS Code version: Code - Insiders 1.59.0-insider (0448522, 2021-07-23T19:21:12.120Z)
OS version: Windows_NT x64 10.0.19043
Restricted Mode: No

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code Insiderssimple-file-dialogIssues with simple file dialogverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions