-
Notifications
You must be signed in to change notification settings - Fork 39k
FileSystemProvider whose uris use the query element is not properly handled by conflict resolution feature #104698
Copy link
Copy link
Closed
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugfile-ioFile I/OFile I/OverifiedVerification succeededVerification succeeded
Milestone
Description
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:
But when the 'Compare' option is taken, the uri sent to the FSP has lost its query string.
The fault is here:
vscode/src/vs/workbench/contrib/files/common/files.ts
Lines 166 to 172 in cc29a81
| 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugfile-ioFile I/OFile I/OverifiedVerification succeededVerification succeeded
