rakyll / govalidate

Validates your Go installation and dependencies.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VSCode Go extension with WSL environment.

TheMushrr00m opened this issue · comments

I have VSCode Go extension installed inside WSL but the tool is not detecting it.
Go version: 1.13.5
VSCode version: 1.4.1.1
VSCode Go Extension version: 0.12.0

We should do a better job recognizing VSCode if command line utilities are not installed.

The golang program only checks the path in the installation directory of windows(i.e. "Program files") or "Environment path variables" not the the directories structured in any Linux subsystem installed...

Yes. Currently, we look for the availability of code in user's PATH instead of looking for the default installation directory:

/Applications/Visual\ Studio\ Code.app // for mac
C:\users\{username}\AppData\Local\Programs\Microsoft VS Code // windows
// not sure about other systems

Then, code --list-extensions is invoked to see if the Go extension is installed.

We may always look for the directories but I'm not sure if there is an easy way to look for the extension via directories. Maybe @ramya-rao-a can help.

Maybe looking inside the default extensions installation folder could work (if the user doesn't change this path)
Windows %USERPROFILE%\.vscode\extensions
macOS ~/.vscode/extensions
Linux ~/.vscode/extensions

And looking for every directory if the name includes "ms-vscode.go"

@TheMushrr00m, thanks! This looks pretty straightforward. I will send a fix.

You're welcome @rakyll. I would send it myself but i'm at my job and here i haven't a device with WSL to test it.
Maybe at night if you don't do it before.

On WSL the extension will be installed at ~/.vscode-server/extensions/golang.go-X.X.X..