I am trying to enable autocompletion for standard libraries of Go, in the Atom editor. I installed gocode, but got this notification:
When searching for "autocomplete-go" in the "Install Packages" pane, the search results dont include a "autocomplete-go". I looked into the Github repo for it (https://github.com/joefitzgerald/autocomplete-go). Of the "required" packages, "autocomplete" package is deprecated, and "go-config" also doesnt match a result in "Install Packages" search. I have updated the packages for Go, but that didn't help:
I am unable to see autocompletes for any standard libraries, like fmt.
My environment setup for Go in Atom is:
$ go version
go version go1.10.2 windows/amd64
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\emuanir\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\emuanir\go
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\emuanir\AppData\Local\Temp\go-build841907702=/tmp/go-build -gno-record-gcc-switches
The plugin which you have installed "https://github.com/joefitzgerald/autocomplete-go" uses "gocode" in the background to perform the auto completes. So you should have a "gocode" process running on your machine. Can you check it?
You can run ps -aef | grep [g]ocode
from you command line. If there's no such process, you can start it by running gocode
from your command line.
If you don't have the "gocode" installed or you cannot find the gocode
command. Run go get -u github.com/nsf/gocode
to install it. This will create the "gocode" binary in your $GOPATH/bin
. So make sure $GOPATH/bin
in added to your $PATH
.