Closed equiman closed 2 years ago
Maybe this information can help to solve it: https://github.com/microsoft/vscode/issues/99691
Instead of file
need to use vscode-remote
follow by the current distro
and path/to/file
If the WSL environment can be detected somehow, then the path should change to:
\\ {WSLHostname}
\ {Distro}
\home\juanmartinez\DEIN\scrimba-react-vite\src\main.jsx
e.g.
\\wsl.localhost\Ubuntu\home\juanmartinez\DEIN\scrimba-react-vite\src\main.jsx
If that's not possible, manually setting a prop should be an acceptable workaround.
Yes, it can be config like the editor="vscode-insiders"
property.
Maybe something like wsl="Ubuntu"
The following both work and open in the correct workspace:
code --file-uri vscode-remote://wsl+Ubuntu/path/to/file
code --remote wsl+Ubuntu /path/to/file.js # guesses if it's a file or folder from extension
However click-to-component
needs to work with vscode:
URLs. Unfortunately AFAICT opening in the correct vscode-remote
window is not yet possible but it's coming soon.
It's true. I've tested the URI with vscode-remote
and doesn't launch the VSCode
vscode-remote://Ubuntu/DEIN/scrimba-react-vite/src/App.jsx:11:9
With vscode
ask on browser
but can't open the file on VSCode. I've tried with this combinations: vscode://file\wsl.localhost\Ubuntu\home\juanmartinez\DEIN\scrimba-react-vite\src\App.jsx:11:9 vscode://\wsl.localhost\Ubuntu\home\juanmartinez\DEIN\scrimba-react-vite\src\App.jsx:11:9 vscode://file/wsl.localhost\Ubuntu\home\juanmartinez\DEIN\scrimba-react-vite\src\App.jsx:11:9 vscode://wsl.localhost/Ubuntu/home/juanmartinez/DEIN/scrimba-react-vite/src/App.jsx:11:9
The following works for me, however it opens in a local vscode window instead of the correct vscode-remote workspace:
start vscode://file/$wsl/wsl.localhost/Ubuntu/path/to/file.jsx
I've copied the path from File Explorer
Add put on browser address bar like this:
vscode://file//wsl$/Ubuntu/home/juanmartinez/DEIN/scrimba-react-vite/src/App.jsx:11:9
But happen me the same to you, open it another 'local' instance, instead 'wsl-remote'
Seems to be that we are gonna need to wait until vscode-remote://
was supported on the browser 😥
According to this documentation: our-triaging-flow. Needs at least 20 community votes, and have 18.
So we need another 2 votes more to reach it.
I've voted for https://github.com/microsoft/vscode-remote-release/issues/4779!
In the meantime, I think we're forced to close this issue **until the browser supports a ${protocol}://...
that this library can window.open(url)
with :(
When that's ready, instead of editor
there'll be a prop like sourceToURL({ editor, source }): string
that you can use to craft a working URL.
Hi @ericclemmons, seems to be this issue finally can be solved.
vscode://vscode-remote/wsl+[host]/[path/to/file]:[line]:[col]
vscode://vscode-remote/ssh-remote+[host]/[path/to/file]:[line]:[col]
I've tested it from the browser:
vscode://vscode-remote/wsl+ubuntu/home/juanmartinez/Developer/DEIN/swpm/src/swpm.js:3
And it will open the project using WSL on
Paths are not working with WSL.
To Reproduce Steps to reproduce the behavior:
click-to-component
and add the configsExpected behavior Open in VSCode without error
Desktop: