-
Notifications
You must be signed in to change notification settings - Fork 645
Use WSL go environment for tools #926
Comments
Can you try pointing your PATH to |
Can you be more specific? Set PATH where, WSL or Windows? I have From cmd.exe when I run |
Taking a step back, you are on Windows and you have set the
Next, about your ask
Sorry, but I don't understand what exactly you are trying to do here. cc @tylerb for terminal related queries |
|
@ramya-rao-a I thought that by changing Perhaps this is a setting in electron/nodejs. I'll do some more digging. |
Oh sorry @tylerb, I meant to cc @Tyriar (our resident terminal and linux expert), did a premature auto-complete and your name got entered :) @srfrog ah! I think I am following what you are trying to do a little better. You are referring to the usage of go tools (like formatting using Currently, we use simple child_process in the Go extension to run the Go tools. How WSL plays into this, I don't know. @Tyriar thoughts? |
@ramya-rao-a vscode-go is using e.g., The actual command string might look like:
Unfortunately, NodeJS is hard-coded to use |
Regarding the go runtime path
In your case, looks like it says "\usr\local\go\bin\go.exe" which is weird to me because it is looking for an "exe" in a non Windows like path. I'd suggest to get a local environment of the Go extension set up and debug to see how exactly are you ending up with this scenario. Instructions: https://github.com/Microsoft/vscode-go/wiki/Building,-Debugging-and-Sideloading-the-extension-in-Visual-Studio-Code Regarding shell usage So are you saying that if we use |
This was brought up for the git support recently, not sure what the result of that conversation was yet.
Does adding
What's probably happening here is it's assuming
|
I've done just that in my (somewhat messy) fork and, bare a few remaining bugs, it works! But it's considerably slower than native tools. :( Any ideas for speeding it up? In case you're interested in trying it out, here's an example of what you need to add to the vscode settings.json:
|
Any updates on this? WSL integration would be really useful. |
I think an option to choose to either use the Windows environment or the WSL environment should be provided direcly by the editor, not by each plugin. Other language plugins for VScode for Windows have this issue too. I think the following issue in vscode itself relates to this one. I would prefer a global option in the editor itself. |
Integration with WSL is highly preferable for users like me, who just moved from Mac OS X to Windows X :). |
It would be great to have the same for Go. |
Hello all, There is no update as of yet. There is some talks to better support WSL in general in VS Code. When these talks solidify a bit, I'll see how we can bring over such support to the Go extension. |
I would really love for this to go forward too. The only way now to work with WSL is to run the editor locally in WSL and display it in Windows using X-Server. But this does not work with VSCode though and I fall back to Sublime. An option to use WSL entirely in the editor would be amazing. |
@lambrospetrou you could use VS Code on Windows and use Bash as the integrated terminal, executing the Not the best experience, but gets the job done. |
@radu-matei I know about that but the whole benefit of having a plugin for a language is to provide editor assistance (autocomplete, suggestions, auto formatting on save, highlighting errors, etc.). If I was just using it as a notepad and then run commands through terminal, I could just use the normal terminal, not VSCode's. |
Any news on this? |
It seems that VS Code has a debugging option "useWSL" which aims to acheive that. Cf https://blogs.msdn.microsoft.com/commandline/2017/10/27/running-node-js-on-wsl-from-visual-studio-code/ |
WSL could enable use of Sourcegraph's Language Server on Windows, potentially improving editor latency? |
Support for WSL is important to me, any complete solution is desirable. |
+1 |
1 similar comment
+1 |
Another please please please vote from me. I am writing go code on my Windows machine that runs a number Linux executable binaries, so the debugger needs to run in the context of the WSL for me to inspect the command and ProcessState values. |
+1 |
2 similar comments
+1 |
+1 |
+1 On a side note, this can get confusing on where everything lives since we have two operating systems. So I made a pic on how everything currently fits together. Hope this helps. |
Sorry to be another +1'er but this is a problem that plagues VSCode. Using Git, Node, Python and Golang requires me to have the them all installed twice, once in WSL and once in Windows. |
+1 |
+1 From someone who migrated from MacOS to Win10 specifically because WSL is now an option this setup is kind of a bummer. Is there a thread where we can speak to the more generalized option that was suggested above by @postgrep? That would be ideal. Any update would be appreciated, thanks! |
Another +1. Moving from MacOS to Win10 building Linux binaries and wish I could debug seamlessly in VSCode. |
This is also important for me, I cannot switch from MacOS to WIndows 10 without this feature. There a lot of time has passed and we still do not know when it will work. |
+1, I have the same, I am developing functions for serverless in golang on windows10 |
While having this issue resolved within VSCode would be nice, I've found that using VSCode installed under WSL, using X410 (Windows Store) as the X11 server, is incredibly seamless and solved my immediate needs. Installing VSCode in WSL Ubuntu is as easy as downloading the .deb package from the VSCode website. Running https://token2shell.com/howto/x410/creating-shortcut-for-wsl-gui-desktop/ From there you setup Ubuntu under WSL as you would a Linux dev environment. Fonts can be copied over from Windows to For better looking UI take a look at the X410 how-to below: And halfway down in this how-to they show how to install Adapta theme, which I thought looked good: |
@shayne I pursued this today looks ok but I'm curious how stable given guis aren't officially supported by WSL. What has your stability experience been like? |
Also (sorry for double post) delve for debugging doesn't seem to work this way. Any special config needed?
|
Have you solved this problem? I can't get any relevant news. |
What about returning EDIT: Maybe using first |
I've made a test to see if it was possible to run tests from WSL and everything worked fine. bash.exe -c 'cd PATH_TO_GO_MODULE && GOOS=linux GO111MODULE=on /usr/local/go/bin/go test -run ^TestWSL$' Running the |
Just chiming in here as I've gotten this working with my ocaml tools (VSCode running in windows, with plugins that make calls into Linux) You'll want to make some aliases to your linux bin's with the following tool: https://github.com/leongrdic/wsl-alias Here's the end result for me (https://twitter.com/jdan/status/1031290277242306566) |
After installing the wsl-alias I'm able to run linux Would be nice to have a |
Hello everyone, we finally have an update here! Checkout the below tweets from the official VS Code twitter handle: https://twitter.com/code/status/1124057230624665620 And the official blog post on Remote Development with VS Code Please try out the above extensions and log new issues if any of the features of the Go extension doesn't work as expected. Please note that you need to have the latest Insiders for the above to work |
@ramya-rao-a incredible! Can't wait to try it out. Thank everyone for me, will ya |
I am so happy to hear that VS Code officially supports the remote development mode, which includes ssh mode, docker mode and wsl mode. Although not perfect, the official saw our needs. |
I tried the links above but still cant add breakpoints for my go code |
Closing this issue as we now have Remote Development with VS Code If you see any problems working with the above, please log new issues |
I would like to have my environment set in WSL (bash.exe) and not in Windows, can vscode-go exec bash.exe before running the tools (golint, goreturns, etc) ?
I have the following settings but doesn't appear to work:
vscode alerts with:
The text was updated successfully, but these errors were encountered: