-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better guide WSL users opening UNC \\wsl$\
paths
#656
Comments
The Go parser actually behaves correctly, as documented here: // Per https://tools.ietf.org/html/rfc3986#page-21
// in the host component %-encoding can only be used
// for non-ASCII bytes. https://tools.ietf.org/html/rfc3986#page-21 In other words It is likely just the |
So, I didn't 'get' this until today when I looked at this from the perspective of running The correct way is to open the shell of the WSL distro you're using then run
Another article describing how to open WSL projects: https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-vscode#open-a-wsl-project-in-visual-studio-code Overview of Remote Development: https://code.visualstudio.com/docs/remote/remote-overview In summary, the action item here is to add links to the above to our readme explaining how to open a folder in WSL. There is no code work here to perform. |
@jpogran I don't disagree about how WSL is supposed to be used or that we should document it but I worry that "docs" may be not be good enough - people do make mistakes and many just do not read docs. Currently the error they get in such a scenario does not make it clear what kind of mistake they made and how to "fix it". I'm not saying we necessarily need to support |
Yeah - I think gopls further masks the problem by adding the third I don't know Windows well enough to confirm but I believe that |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Current Version
Use-cases
Currently the language server doesn't support UNC paths as per #74
However even when it does, users will continue to be unable to use WSL paths.
Generally speaking WSL users can (and should) use the Linux path (such as
/mnt/c/...
) directly, and most do.However, the following attempt
(assuming the Linux instance for WSL is still running somewhere on the background)
leads to an error message such as
Proposal
The hostname in a WSL URI uses the dollar sign (
$
), which is passed escaped as%24
by the language client. This trips up the Go URL parser, which is otherwise capable of unescaping the path, but clearly not the hostname.See https://play.golang.org/p/ROjLYnDbDjR
We can attempt to unescape the whole URL somehow and just make WSL UNC paths work and/or return a more helpful error message to nudge users to use the native Linux path. Additionally on VS Code we could recommend installation of the WSL extension https://code.visualstudio.com/docs/remote/wsl
The text was updated successfully, but these errors were encountered: