gitpod-io / openvscode-server

Run upstream VS Code on a remote machine with access through a modern web browser from any device, anywhere.
https://www.gitpod.io/
MIT License
4.99k stars 431 forks source link

Save Dialog - Open Local File Browser - Response returns relative path which cannot be found #506

Open jmiles17 opened 1 year ago

jmiles17 commented 1 year ago

I have an extension with a save feature (exporting data in csv, json, etc) that uses vscode.window.showSaveDialog

In a remote environment, when a user tries to save data and selects a local location through the file browser, then the response uri's path and fsPath that are returned are relative paths/filenames. The response's scheme is "vscode-local"

When a user selects a local location through the dropdown (by clicking through the directories), the response uri's path and fsPath that are returned are absolute paths such as "/mnt/c/Users/../output.json"

I am wondering how to resolve the "vscode-local" file scheme into the absolute directory path, so that I can access and save to this location.