vscode-sqltools
vscode-sqltools copied to clipboard
"Select file" for socket file path looks locally even in a remote workspace
Describe the bug "Select file" for the socket file path shows a local file chooser, even when I'm in a remote workspace and thus would expect to look for a file on the remote system.
To Reproduce Try selecting a socket file path when you are using a remote vscode workspace
Expected behavior File picker that shows remote files
Desktop (please complete the following information):
- SQLTools Version: 0.22.6
- VSCode Version: 1.46.0-insiders
- Driver Used/Version: Postgres
- OS: Windows desktop, Linux remote via SSH
is it working if you type the path manually? It's a bit hard for me to test remote fs right now, maybe next week. but it should be working with a manual input
If someone want to try it, here is where we handle the paths: https://github.com/mtxr/vscode-sqltools/blob/master/packages/driver.sqlite/src/extension.ts#L45
Same thing occurs when configuring a connection for the SQLite driver on a remote environment such as a GitHub Codespace.
It happens because the button wraps an <input type="file" /> element on the form that displays in the WebviewPanel:
https://github.com/mtxr/vscode-sqltools/blob/37c6ad09c037d06bcc81441b127275901c3dacd2/packages/plugins/connection-manager/webview/ui/components/FileInput/index.tsx#L26-L36
The webview probably needs to post a message to the extension to call window.showOpenDialog. When this returns a uri the extension would post to the webview a message conveying the fsPath of the uri.