Skip to content

FileSystemProvider whose uris use the query element is not properly handled by conflict resolution feature #104698

@gjsjohnmurray

Description

@gjsjohnmurray

I am developing an extension that implements a FileSystemProvider for which the query element of the uri is significant.

When an edited document is saved and VS Code detects that the target file is newer, VS Code correctly offers this notification:

image

But when the 'Compare' option is taken, the uri sent to the FSP has lost its query string.

The fault is here:

private static resourceToTextFile(scheme: string, resource: URI): URI {
return resource.with({ scheme, query: JSON.stringify({ scheme: resource.scheme }) });
}
private static textFileToResource(resource: URI): URI {
return resource.with({ scheme: JSON.parse(resource.query)['scheme'], query: null });
}

resourceToTextFile sequesters the query element to stash the original scheme when setting a new scheme. Later textFileToResource reverses this process, but in doing so it has lost the query element of the original uri.

I will submit a PR.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugfile-ioFile I/OverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions