Skip to content
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

vscode-go fails to load workspace folders within WSL drives #1485

Closed
jakevoytko opened this issue May 7, 2021 · 3 comments
Closed

vscode-go fails to load workspace folders within WSL drives #1485

jakevoytko opened this issue May 7, 2021 · 3 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@jakevoytko
Copy link

Prerequisites

Run a WSL2 distribution on Windows. I used Ubuntu for this, but I believe it would affect anything using WSL drives.

Steps to repro

First, clone this project into a WSL folder (to use as the golang test project)

cd ~/c/src/github.com
mkdir -p golang && cd golang
git clone https://github.com/golang/vscode-go.git

Second, open the folder under //wsl$ in Visual Studio code

File > Open Folder
Path: \\wsl$\Ubuntu\home\jake\c\src\github.com\golang\vscode-go

Expected result

The extension loads as one would expect.

Actual result

An error,

Error loading workspace folders (expected 1, got 0) failed to load view for file:///wsl$/Ubuntu/home/jake/c/src/github.com/golang/vscode-go: invalid workspace configuration: The system cannot find the path specified.
Source: Go (Extension)

The editor itself loads correctly, and I can edit the project normally, but none of the golang functionality (format on save, etc) seems to work.

Opening a file gives me a related error:

Error loading workspace folders (expected 1, got 0) failed to load view for file:///wsl$/Ubuntu/home/jake/c/src/github.com/golang/vscode-go/test/testdata/fillStruct: failed to get workspace configuration from client (file:///wsl$/Ubuntu/home/jake/c/src/github.com/golang/vscode-go/test/testdata/fillStruct): Request workspace/configuration failed with message: [UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")

Notes

A workaround is to not use WSL drives at all, check out your code onto your favorite drive, and go to /mnt/c/path/to/folder. However, disk I/O within the WSL drives is much faster within WSL because it doesn't need to go through an extra translation layer to map from the Windows filesystem format to the Linux filesystem format. Small projects compile for me within 100ms on WSL drives and 15 seconds under /mnt/c/. The large project I'm working on with cgo bindings would likely never finish compiling. So as far as development time, I'm much better served running all the golang magic myself within the network drive than doing the workaround.

@gopherbot gopherbot added this to the Untriaged milestone May 7, 2021
@hyangah
Copy link
Contributor

hyangah commented May 7, 2021

@jakejarvis Are you using the remote extension pack? I don't think this extension works with //wsl$path directly.

@hyangah
Copy link
Contributor

hyangah commented May 7, 2021

With the following issues, I don't know how far we can go with \wsl$
golang/go#37461
microsoft/WSL#5762

@findleyr findleyr added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label May 9, 2021
@findleyr findleyr modified the milestones: Untriaged, Backlog May 9, 2021
@gopherbot
Copy link
Collaborator

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants