Visual Studio - Now with Go support

Go support for Visual Studio now tagged as completed:
visual-studio-uservoice

The project page:
https://marketplace.visualstudio.com/items/lukehoban.Go

5 Likes

I have tried it for today. It works well - very well, actually. It might replace Sublime Text/IntelliJ for me.

It is way better at handling Go than SublimeText with GoSublime, and it is much more responsive than IntelliJ IDEA, which has good Go support, but can feel sluggish.

EDIT: Oh yeah, since OP didn’t mention it: It also supports OS X and Linux.

1 Like

I’ve been looking for a replacement for Sublime and Atom. Sometimes I jump into vim, but the muscle memory isn’t quite there yet. Have you tried out the delve debugging feature yet? This looks really impressive though. I’ll give it a shot later tonight.

yep, VS Code seems to become a very good solution for golang and not only… :no_mouth:

I would love to, but unfortunately delve doesn’t support Windows ATM. It almost seems worth it to install a Linux boot just for that! :smile:

Huh. That’s my weapon of choice, and I hadn’t tried this combo yet, although I’ve looked at VS Code previously. Could you give an example or two of things that work better in VA Code?

  • Autocompletion. It seems almost useless in ST - it may be my setup both at home and at work that is broken, but it is basically useless. With IntellJ and VS code it works with type-specific completion. VS Code can be a bit overeager to autocomplete though.

  • Go to definition. Works about half the time with S.T, doesn’t understand non-basic constructs AFAITC.

  • Intelligent renaming. IJ has a very nice built-in feature and VS Code uses gorename.

  • Function information. VS Code/IJ has nice features to show function documentation. With ST I have to jump to the function.

  • Debugging. I haven’t tried it, but both VS Code and IJ has delve support, which looks awesome

  • On-the-fly compilation. Both VS and IJ can to some degree show code errors, though both have to be tinkered with to get actual compilation, with “click-the-error to go to the line in the file”.

GoSublime unfortunately seems abandoned, but it has served me well, while the IJ has just gotten better and better. VS code is slightly ahead for me, since it is easy to switch “project” (just open a folder), and it generally feels more responsive.

2 Likes

I’ve tried it out now and I agree with you - it’s a superior experience. Surprising is the day when a Visual Studio product on Mac is the better code editor… :astonished: (These smileys are … special.)

Now I just need to hack the font support somehow to give me Input Mono Thin as the default font. Sublime Text allows selecting a weight in addition to a family and a size, but Code currently doesn’t.


There’s some wonkiness with the goimports integration for me as well. It screws up the formatting of the import statement for some reason, which goimports doesn’t do when run from the command line…

1 Like

After playing with it for an evening, my main gripe is that I can’t seem to get gofmt-on-save to happen. I looked at the Go extension to it but it wasn’t obvious to me how to implement it either. Maybe it’ll come in the future. The goimports thing I mentioned above is buggy, but I’m sure that’s going to get fixed.

1 Like

It seems like it is being worked on, with an open PR. I am also looking forward to that.

1 Like

After a short play with it i saw the following:

Bad things:

  • need a Terminal window inside
  • the output window is non-interactive (i can’t insert something if i use scan functions)
  • the build/run task system is too complicated and inefficient
  • files explorer is very limited and also open folder (it’s hard to see from current project something in other project for example)
  • windows splitting are bizarre
  • the configuration files are also complicated and many modifications need restart
  • annoying warning messages to install some unwanted tools

Good things:

  • autocomplete work well with gocode at function prototype level
  • some useful snippets are available
  • editor is quite good, some useful search functions are available
  • it’s multiplatform and this is good

Per total it’s somewhat half of the LiteIDE experience. But i guess they will improve it :wink:

2 Likes

I’ve tried Delve debugger , but unfortunately it didn’t worked quite well.

After using it for a while, the things that I haven’t been able to find or get used to are …

  • Auto completion of functions/methods doesn’t insert parenthesis and parameter place holders.
  • No keyboard shortcut for duplicating a line or selected block (Shift-Cmd-D in Sublime). Shift-Alt-Up/Down
  • No keyboard shortcut to select the current line (Cmd-L in Sublime; think “Cmd-L-L-L Backspace” for vi 3dd like editing).
  • No way to paragraph wrap a text block such as a long comment (Alt-Cmd-Q in Sublime).
  • (Lack of autoformat-on-save.)
2 Likes

Just as an unnecessary reminder: Keyboard bindings can be changed :wink: Ain’t helping with missing functionality, though…

Now hoping the official sublime text build developed for ST gets ported to VSCode.

That’s cool, but let’s say you use a Mac, and you want to install the Go toolchain in a Vagrant virtual machine (for example because you use different versions of Go depending on the project you work on): in such a case, is VSCode able to use the Go toolchain installed in the virtual machine? Or to make it work, do you have to install the Go toolchain directly in Mac OS X?

Running the compiler on another host and OS seems overkill just to get a separate version, when downloading the tar.gz and setting two environment variables will do. :​) But I don’t know, perhaps it’s possible to teach the editor about such a setup.

I am not sure if VS Code can be pointed to another version via the workspace’s settings as the extension only has a GOPATH setting but it should pick up the environment variables when started from the CLI.

If anybody wants to try it out quickly, I made a docker container using the Go plugin for VSCode (with the debugger). https://github.com/jcscottiii/gdec

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.