Showing posts with label visual studio code. Show all posts
Showing posts with label visual studio code. Show all posts

2016-11-17

Best Golang IDE: IntelliJ and VSCode

I've been using IntelliJ + go-lang-idea-plugin for years now (because it's currently the best one for almost everything: Ruby, PHP, Python, Javascript, SQL, you name it..), previously it's ok to use SublimeText + GoSublime, or LiteIDE, but today we got another completely working alternative that is also purely free (like IntelliJ Community): VisualStudioCode + lukehoban.Go. Here's how to install in ArchLinux:

yaourt --needed --noconfirm -S --force visual-studio-code 
go get -u -v github.com/nsf/gocode      
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/newhook/go-symbols
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v github.com/cweill/gotests/...
code

Then press Ctrl+Shift+P, type "Install Extension", type: "Go", done :3

Everything's works fine now:

In my opinion, IntelliJ still the best, but surely I'll be using VSCode when my IntellJ license ends.

2016-03-09

Lightweight Go IDE (with Debugging support)

Today I found that Visual Studio Code by Microsoft is quite charming, it based on Electron, library that being used to make Atom Editor (and Nuclide by Facebook). It loads fast, really fast. In ArchLinux or Manjaro, you can install it using this command:

yaourt -S visual-studio-code

After installing, type Ctrl+Shift+P, Install Extension, choose Go (Rich Go bla bla..). And yes, it requires internet connection.

Then install the tools required:

go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-find-references
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/newhook/go-symbols

For debugging, install delve (it requires Go 1.5 or newer).

The import bulb will show if a package not yet imported:

The autocomplete just works as expected:

Argument tooltip (parameter info) shown correctly:

Jump to definition works (Ctrl+Click):

I believe this is better alternative (for now) than Atom, Brackets, LightTable, and LimeText (incomplete SublimeText implementation).