New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After upgrade GO to 1.7 version, the Code just won't show intellisense for a variable #441

Closed
alexandrudima opened this Issue Aug 18, 2016 · 42 comments

Comments

Projects
None yet
@alexandrudima
Member

alexandrudima commented Aug 18, 2016

Moved from Microsoft/vscode#10639


From @Dmdv

  • VSCode Version: Code 1.4.0 (6276dcb0ae497766056b4c09ea75be1d76a8b679, 2016-08-04T16:45:31.680Z)
  • OS Version: Windows_NT ia32 10.0.10586

Steps to Reproduce:

  1. choose GOLANG environment
  2. start coding, declare import, for example fmt
  3. after typing fmt. and pressing space there is no dropdown hint about available methods, just "Panic"
@sunnyawake5

This comment has been minimized.

Show comment
Hide comment
@sunnyawake5

sunnyawake5 Aug 18, 2016

same issue here. fmt. doesn't work, fmt.Println( works.

sunnyawake5 commented Aug 18, 2016

same issue here. fmt. doesn't work, fmt.Println( works.

@kkshetty

This comment has been minimized.

Show comment
Hide comment
@kkshetty

kkshetty Aug 18, 2016

Same here.

screen shot 2016-08-18 at 5 47 27 pm

Environment:-
Mac OS X 10.11.6
VS Code 1.4.0[ 6276dcb0ae497766056b4c09ea75be1d76a8b679, 2016-08-04T16:39:36.387Z ]
go version go1.7 darwin/amd64

kkshetty commented Aug 18, 2016

Same here.

screen shot 2016-08-18 at 5 47 27 pm

Environment:-
Mac OS X 10.11.6
VS Code 1.4.0[ 6276dcb0ae497766056b4c09ea75be1d76a8b679, 2016-08-04T16:39:36.387Z ]
go version go1.7 darwin/amd64

@lukehoban

This comment has been minimized.

Show comment
Hide comment
@lukehoban

lukehoban Aug 18, 2016

Collaborator

This looks like the same issue as #436 and #425. Running gocode close should fix this.

Collaborator

lukehoban commented Aug 18, 2016

This looks like the same issue as #436 and #425. Running gocode close should fix this.

@kkshetty

This comment has been minimized.

Show comment
Hide comment
@kkshetty

kkshetty Aug 18, 2016

gocode close and go get -u github.com/nsf/gocode fixed it for me.

Thanks @lukehoban

kkshetty commented Aug 18, 2016

gocode close and go get -u github.com/nsf/gocode fixed it for me.

Thanks @lukehoban

@asaf

This comment has been minimized.

Show comment
Hide comment
@asaf

asaf Aug 18, 2016

On MacOS, I had a gocode daemon running, I killed it / gocode close, re-opened studio and everything worked.

asaf commented Aug 18, 2016

On MacOS, I had a gocode daemon running, I killed it / gocode close, re-opened studio and everything worked.

@tracer0tong

This comment has been minimized.

Show comment
Hide comment
@tracer0tong

tracer0tong Aug 18, 2016

Recipe works that's nice, but is it possible to include this gocode restart and update as part of new vscode-go? Or may be in documentation? At least this should be part of Release notes.

tracer0tong commented Aug 18, 2016

Recipe works that's nice, but is it possible to include this gocode restart and update as part of new vscode-go? Or may be in documentation? At least this should be part of Release notes.

@Dmdv

This comment has been minimized.

Show comment
Hide comment
@Dmdv

Dmdv Aug 19, 2016

Recipe worked. Thank you

Dmdv commented Aug 19, 2016

Recipe worked. Thank you

@lukehoban

This comment has been minimized.

Show comment
Hide comment
@lukehoban

lukehoban Aug 21, 2016

Collaborator

@tracer0tong I've updated the README with a note. Unfortunately, I'm not sure it's safe/wise for the extension to restart the gocode daemon everything it launches, as that would have performance implications and potentially interact poorly with other tools that use gocode.

Collaborator

lukehoban commented Aug 21, 2016

@tracer0tong I've updated the README with a note. Unfortunately, I'm not sure it's safe/wise for the extension to restart the gocode daemon everything it launches, as that would have performance implications and potentially interact poorly with other tools that use gocode.

@hinst

This comment has been minimized.

Show comment
Hide comment
@hinst

hinst Aug 22, 2016

I get PANIC PANIC. I removed all tools, then installed all tools but it did not help

hinst commented Aug 22, 2016

I get PANIC PANIC. I removed all tools, then installed all tools but it did not help

@lukehoban

This comment has been minimized.

Show comment
Hide comment
@lukehoban

lukehoban Aug 22, 2016

Collaborator

@hinst did you run gocode close

Collaborator

lukehoban commented Aug 22, 2016

@hinst did you run gocode close

@utrescu

This comment has been minimized.

Show comment
Hide comment
@utrescu

utrescu Aug 27, 2016

Fedora: Only gocode close does not work.

I need to do gocode close and go get -u github.com/nsf/gocode to get it working again.

utrescu commented Aug 27, 2016

Fedora: Only gocode close does not work.

I need to do gocode close and go get -u github.com/nsf/gocode to get it working again.

@theGeekPirate

This comment has been minimized.

Show comment
Hide comment
@theGeekPirate

theGeekPirate Sep 6, 2016

gocode close and go get -u github.com/nsf/gocode wasn't enough on Arch Linux, I also had to terminate the process manually.

theGeekPirate commented Sep 6, 2016

gocode close and go get -u github.com/nsf/gocode wasn't enough on Arch Linux, I also had to terminate the process manually.

@hilljgo

This comment has been minimized.

Show comment
Hide comment
@hilljgo

hilljgo Sep 14, 2016

gocode will hog up my CPU every ten minutes or so, making my laptop sound like an airplane is about to take off. Having to run gocode close every ten minutes is quite annoying

hilljgo commented Sep 14, 2016

gocode will hog up my CPU every ten minutes or so, making my laptop sound like an airplane is about to take off. Having to run gocode close every ten minutes is quite annoying

@theGeekPirate

This comment has been minimized.

Show comment
Hide comment
@theGeekPirate

theGeekPirate Sep 14, 2016

@hilljgo Please search all previous issues to see if one is similar to your own problem (creating a new issue if not) instead of posting a completely irrelevant comment under this issue where it'll only get lost.

theGeekPirate commented Sep 14, 2016

@hilljgo Please search all previous issues to see if one is similar to your own problem (creating a new issue if not) instead of posting a completely irrelevant comment under this issue where it'll only get lost.

@WIZARD-CXY

This comment has been minimized.

Show comment
Hide comment
@WIZARD-CXY

WIZARD-CXY Sep 21, 2016

gocode close and go get -u github.com/nsf/gocode works

WIZARD-CXY commented Sep 21, 2016

gocode close and go get -u github.com/nsf/gocode works

@Krognol

This comment has been minimized.

Show comment
Hide comment
@Krognol

Krognol Sep 24, 2016

I've tried gocode close and go get -u github.com/nsf/gocode but neither have fixed this problem for me.

Running Windows 10 64 bit
Go version 1.7.1

Krognol commented Sep 24, 2016

I've tried gocode close and go get -u github.com/nsf/gocode but neither have fixed this problem for me.

Running Windows 10 64 bit
Go version 1.7.1

@qawarrior

This comment has been minimized.

Show comment
Hide comment
@qawarrior

qawarrior Sep 28, 2016

I was having this issue and I ran these commands
go get -u github.com/nsf/gocode
gocode close
gocode -debug -s
In that order and that fixed the issue

qawarrior commented Sep 28, 2016

I was having this issue and I ran these commands
go get -u github.com/nsf/gocode
gocode close
gocode -debug -s
In that order and that fixed the issue

@Kleissner

This comment has been minimized.

Show comment
Hide comment
@Kleissner

Kleissner Oct 1, 2016

Not working for me as well. I tried everything from above (including deleting all directories in my src folder and redownloading all the dependencies) but it's still not working. It's just showing "PANIC" instead of the hints.

Windows 10 64-bit, Go 1.7

Edit:
Got it working now, had to find the gocode.exe binary which is in "%GOPATH%\bin", found there the old file named "gocode.exe~" which I deleted and on the command line I typed the "gocode.exe close". Opened Visual Studio Code and it worked!

Kleissner commented Oct 1, 2016

Not working for me as well. I tried everything from above (including deleting all directories in my src folder and redownloading all the dependencies) but it's still not working. It's just showing "PANIC" instead of the hints.

Windows 10 64-bit, Go 1.7

Edit:
Got it working now, had to find the gocode.exe binary which is in "%GOPATH%\bin", found there the old file named "gocode.exe~" which I deleted and on the command line I typed the "gocode.exe close". Opened Visual Studio Code and it worked!

@IronPark

This comment has been minimized.

Show comment
Hide comment
@IronPark

IronPark Oct 31, 2016

if not work gocode close for you
try this solution
killall -9 gocode
go get -u github.com/nsf/gocode

IronPark commented Oct 31, 2016

if not work gocode close for you
try this solution
killall -9 gocode
go get -u github.com/nsf/gocode

@ramya-rao-a

This comment has been minimized.

Show comment
Hide comment
@ramya-rao-a

ramya-rao-a Oct 31, 2016

Member

Closing this issue, as we have a workaround

Member

ramya-rao-a commented Oct 31, 2016

Closing this issue, as we have a workaround

@sfrooster

This comment has been minimized.

Show comment
Hide comment
@sfrooster

sfrooster Nov 5, 2016

I'm having an issue very similar to this except code completion works, but after a time vscode becomes unusable because there are godef processes hogging the CPU. Killing them frees the cpu.

OSX Sierra, 1.7.1

sfrooster commented Nov 5, 2016

I'm having an issue very similar to this except code completion works, but after a time vscode becomes unusable because there are godef processes hogging the CPU. Killing them frees the cpu.

OSX Sierra, 1.7.1

@ramya-rao-a

This comment has been minimized.

Show comment
Hide comment
@ramya-rao-a
Member

ramya-rao-a commented Nov 6, 2016

@sfrooster See #541 and #503

@qawarrior

This comment has been minimized.

Show comment
Hide comment
@qawarrior

qawarrior Nov 6, 2016

This seams to happen after every GO update go through the steps to kill the
barcode process to fix it

On Sat, Nov 5, 2016, 5:26 PM Ramya Rao notifications@github.com wrote:

@sfrooster https://github.com/sfrooster See #541
#541 and #503
#503


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#441 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABw0KWvqCBttHKlitcwsVQADiZgS2ciYks5q7R6XgaJpZM4JnKKL
.

qawarrior commented Nov 6, 2016

This seams to happen after every GO update go through the steps to kill the
barcode process to fix it

On Sat, Nov 5, 2016, 5:26 PM Ramya Rao notifications@github.com wrote:

@sfrooster https://github.com/sfrooster See #541
#541 and #503
#503


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#441 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABw0KWvqCBttHKlitcwsVQADiZgS2ciYks5q7R6XgaJpZM4JnKKL
.

@dotnetjalps

This comment has been minimized.

Show comment
Hide comment
@dotnetjalps

dotnetjalps Jan 20, 2017

For me this is how it works.

Update the go version to Go 1.7.4 and then get latest version of all the tools.
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

and Then restart the machine. It will work.

dotnetjalps commented Jan 20, 2017

For me this is how it works.

Update the go version to Go 1.7.4 and then get latest version of all the tools.
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

and Then restart the machine. It will work.

@kaitroll

This comment has been minimized.

Show comment
Hide comment
@kaitroll

kaitroll commented Jan 25, 2017

thx

@gevgev

This comment has been minimized.

Show comment
Hide comment
@gevgev

gevgev Jan 28, 2017

Neither of the above solution has worked for me:

OS X El Capitan 10.11.6 (15G1217)
go version go1.7.5 darwin/amd64
Visual Studio Code Version 1.8.1 (1.8.1)

gevgev commented Jan 28, 2017

Neither of the above solution has worked for me:

OS X El Capitan 10.11.6 (15G1217)
go version go1.7.5 darwin/amd64
Visual Studio Code Version 1.8.1 (1.8.1)

@ramya-rao-a

This comment has been minimized.

Show comment
Hide comment
@ramya-rao-a

ramya-rao-a Jan 29, 2017

Member

@gevgev
Did you try killing the current running gocode daemon as per #441 (comment)
Once the gocode process is killed, run the command Go: Install Tools so that all dependent tools get updated

Are rest of the features of the Go extension working as expected?

Member

ramya-rao-a commented Jan 29, 2017

@gevgev
Did you try killing the current running gocode daemon as per #441 (comment)
Once the gocode process is killed, run the command Go: Install Tools so that all dependent tools get updated

Are rest of the features of the Go extension working as expected?

@gevgev

This comment has been minimized.

Show comment
Hide comment
@gevgev

gevgev Jan 29, 2017

@ramya-rao-a
Yes, I tried that several times, including with restarting my machine.
Also with re-installing all go tools manually

All other features, including all pop-ups, showing types of variable or even values of variables during debugging on mouse-hover work just fine.

The intelligence on typing (i.e. fmt.) is not working, all it shows is just PANIC.

One thing I suspect is that with the latest Go lang Mac OS installation PKG the GOROOT now is set to "/usr/local/go", it is now kind of standardized with after I believe 1.7 release.
Which is why now I need to use sudo like in below scrip to install go tools, which means that Visual Studio Code simply cannot install the tools without sudo anymore, and maybe that might be the root cause:

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

Output of go env:

$ go env
GOARCH="amd64"
GOBIN="/usr/local/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/<myusernamehere>/git/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/vy/415ykmkn34v8nwy49hwfgr7c0000gn/T/go-build647783471=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

gevgev commented Jan 29, 2017

@ramya-rao-a
Yes, I tried that several times, including with restarting my machine.
Also with re-installing all go tools manually

All other features, including all pop-ups, showing types of variable or even values of variables during debugging on mouse-hover work just fine.

The intelligence on typing (i.e. fmt.) is not working, all it shows is just PANIC.

One thing I suspect is that with the latest Go lang Mac OS installation PKG the GOROOT now is set to "/usr/local/go", it is now kind of standardized with after I believe 1.7 release.
Which is why now I need to use sudo like in below scrip to install go tools, which means that Visual Studio Code simply cannot install the tools without sudo anymore, and maybe that might be the root cause:

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

Output of go env:

$ go env
GOARCH="amd64"
GOBIN="/usr/local/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/<myusernamehere>/git/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/vy/415ykmkn34v8nwy49hwfgr7c0000gn/T/go-build647783471=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
@ramya-rao-a

This comment has been minimized.

Show comment
Hide comment
@ramya-rao-a

ramya-rao-a Jan 29, 2017

Member

@gevgev I currently use go1.7.3, and I don't see the need to use sudo. Will update to go1.7.5 and get back.

Can you try running gocode from the command line to see if you get expected output?
If not, then we should take this up with gocode's author

Member

ramya-rao-a commented Jan 29, 2017

@gevgev I currently use go1.7.3, and I don't see the need to use sudo. Will update to go1.7.5 and get back.

Can you try running gocode from the command line to see if you get expected output?
If not, then we should take this up with gocode's author

@gevgev

This comment has been minimized.

Show comment
Hide comment
@gevgev

gevgev Jan 29, 2017

Using gocode from command line:

Test file:

package main

import (
	"fmt"
)

func main() {
	fmt.
}

command line output (expecting suggestions at cursor pos 47):

$ gocode -in="test.go" autocomplete c1
Nothing to complete.
$ gocode -in="test.go" autocomplete c2
Nothing to complete.
$ gocode -in="test.go" autocomplete c10
Found 1 candidates:
  func make(type, len[, cap]) type
$ gocode -in="test.go" autocomplete c15
Found 1 candidates:
  PANIC PANIC PANIC
$ gocode -in="test.go" autocomplete c45
Found 1 candidates:
  PANIC PANIC PANIC
$ gocode -in="test.go" autocomplete c46
Found 1 candidates:
  PANIC PANIC PANIC
$ gocode -in="test.go" autocomplete c47
Found 1 candidates:
  PANIC PANIC PANIC
$ gocode -in="test.go" autocomplete c48
Found 1 candidates:
  PANIC PANIC PANIC
$ gocode -in="test.go" autocomplete c50
Found 1 candidates:
  PANIC PANIC PANIC

Per my understanding it should have suggested fmt.Print..Printf.. Println.. etc., but looks like the only suggestion gocode has is just 'make()' function, otherwise it is either 'Nothing to complete', or 'Panic'

Hope this helps.

gevgev commented Jan 29, 2017

Using gocode from command line:

Test file:

package main

import (
	"fmt"
)

func main() {
	fmt.
}

command line output (expecting suggestions at cursor pos 47):

$ gocode -in="test.go" autocomplete c1
Nothing to complete.
$ gocode -in="test.go" autocomplete c2
Nothing to complete.
$ gocode -in="test.go" autocomplete c10
Found 1 candidates:
  func make(type, len[, cap]) type
$ gocode -in="test.go" autocomplete c15
Found 1 candidates:
  PANIC PANIC PANIC
$ gocode -in="test.go" autocomplete c45
Found 1 candidates:
  PANIC PANIC PANIC
$ gocode -in="test.go" autocomplete c46
Found 1 candidates:
  PANIC PANIC PANIC
$ gocode -in="test.go" autocomplete c47
Found 1 candidates:
  PANIC PANIC PANIC
$ gocode -in="test.go" autocomplete c48
Found 1 candidates:
  PANIC PANIC PANIC
$ gocode -in="test.go" autocomplete c50
Found 1 candidates:
  PANIC PANIC PANIC

Per my understanding it should have suggested fmt.Print..Printf.. Println.. etc., but looks like the only suggestion gocode has is just 'make()' function, otherwise it is either 'Nothing to complete', or 'Panic'

Hope this helps.

@gevgev

This comment has been minimized.

Show comment
Hide comment
@gevgev

gevgev Jan 30, 2017

I have worked with nsf (author of gocode )on this issue, we got that resolved:
As it turns out I had a "leftover" stale instance (dated Sep 2016) sitting there!!:

$ which -a gocode
/Users/ggevorgyan/git/go/bin/gocode
/usr/local/go/bin/gocode

Removing the old instance and restarting gocode fixed it, everything works just fine now, including command line:

$ gocode -in="test.go" autocomplete c47
Found 25 candidates:
  func Errorf(format string, a ...interface{}) error
  func Fprint(w io.Writer, a ...interface{}) (n int, err error)
  func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)
  func Fprintln(w io.Writer, a ...interface{}) (n int, err error)
  func Fscan(r io.Reader, a ...interface{}) (n int, err error)
  func Fscanf(r io.Reader, format string, a ...interface{}) (n int, err error)
  func Fscanln(r io.Reader, a ...interface{}) (n int, err error)
  func Print(a ...interface{}) (n int, err error)
  func Printf(format string, a ...interface{}) (n int, err error)
  func Println(a ...interface{}) (n int, err error)
  func Scan(a ...interface{}) (n int, err error)
  func Scanf(format string, a ...interface{}) (n int, err error)
  func Scanln(a ...interface{}) (n int, err error)
  func Sprint(a ...interface{}) string
  func Sprintf(format string, a ...interface{}) string
  func Sprintln(a ...interface{}) string
  func Sscan(str string, a ...interface{}) (n int, err error)
  func Sscanf(str string, format string, a ...interface{}) (n int, err error)
  func Sscanln(str string, a ...interface{}) (n int, err error)
  type Formatter interface
  type GoStringer interface
  type ScanState interface
  type Scanner interface
  type State interface
  type Stringer interface

Thank you!!!

gevgev commented Jan 30, 2017

I have worked with nsf (author of gocode )on this issue, we got that resolved:
As it turns out I had a "leftover" stale instance (dated Sep 2016) sitting there!!:

$ which -a gocode
/Users/ggevorgyan/git/go/bin/gocode
/usr/local/go/bin/gocode

Removing the old instance and restarting gocode fixed it, everything works just fine now, including command line:

$ gocode -in="test.go" autocomplete c47
Found 25 candidates:
  func Errorf(format string, a ...interface{}) error
  func Fprint(w io.Writer, a ...interface{}) (n int, err error)
  func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)
  func Fprintln(w io.Writer, a ...interface{}) (n int, err error)
  func Fscan(r io.Reader, a ...interface{}) (n int, err error)
  func Fscanf(r io.Reader, format string, a ...interface{}) (n int, err error)
  func Fscanln(r io.Reader, a ...interface{}) (n int, err error)
  func Print(a ...interface{}) (n int, err error)
  func Printf(format string, a ...interface{}) (n int, err error)
  func Println(a ...interface{}) (n int, err error)
  func Scan(a ...interface{}) (n int, err error)
  func Scanf(format string, a ...interface{}) (n int, err error)
  func Scanln(a ...interface{}) (n int, err error)
  func Sprint(a ...interface{}) string
  func Sprintf(format string, a ...interface{}) string
  func Sprintln(a ...interface{}) string
  func Sscan(str string, a ...interface{}) (n int, err error)
  func Sscanf(str string, format string, a ...interface{}) (n int, err error)
  func Sscanln(str string, a ...interface{}) (n int, err error)
  type Formatter interface
  type GoStringer interface
  type ScanState interface
  type Scanner interface
  type State interface
  type Stringer interface

Thank you!!!

@ramya-rao-a

This comment has been minimized.

Show comment
Hide comment
@ramya-rao-a

ramya-rao-a Jan 30, 2017

Member

yay! glad you are unblocked @gevgev and thanks for sharing your solution.
Happy coding!

Member

ramya-rao-a commented Jan 30, 2017

yay! glad you are unblocked @gevgev and thanks for sharing your solution.
Happy coding!

@freedomsean

This comment has been minimized.

Show comment
Hide comment
@freedomsean

freedomsean Mar 3, 2017

I can not use the function of autocomplete in VSCode Insider 1.11.0. Did I miss something? I have used the above solution, but it still doesn't have any suggestion.

reinstall all reqired packages
gocode close

If I use Code 1.10.1, it will be work.

The following is my environment

VSCode Version: Code Insider 1.11.0
OS Version: Windows 7
Steps to Reproduce:

I use the same step to try it, but it still got error.

choose GOLANG environment
start coding, declare import, for example fmt
after typing fmt. and pressing space there is no dropdown hint about available methods or variables. There do not have any suggestion, even if "panic" .

freedomsean commented Mar 3, 2017

I can not use the function of autocomplete in VSCode Insider 1.11.0. Did I miss something? I have used the above solution, but it still doesn't have any suggestion.

reinstall all reqired packages
gocode close

If I use Code 1.10.1, it will be work.

The following is my environment

VSCode Version: Code Insider 1.11.0
OS Version: Windows 7
Steps to Reproduce:

I use the same step to try it, but it still got error.

choose GOLANG environment
start coding, declare import, for example fmt
after typing fmt. and pressing space there is no dropdown hint about available methods or variables. There do not have any suggestion, even if "panic" .

@ramya-rao-a

This comment has been minimized.

Show comment
Hide comment
@ramya-rao-a

ramya-rao-a Mar 3, 2017

Member

@freedomsean So on the same machine, autocomplete works fine in the stable build, but not insiders?

Member

ramya-rao-a commented Mar 3, 2017

@freedomsean So on the same machine, autocomplete works fine in the stable build, but not insiders?

@freedomsean

This comment has been minimized.

Show comment
Hide comment
@freedomsean

freedomsean Mar 3, 2017

@ramya-rao-a Yes, It works fine in the stable build, but not insiders. Do I need to submit this issue to VSCode project?

freedomsean commented Mar 3, 2017

@ramya-rao-a Yes, It works fine in the stable build, but not insiders. Do I need to submit this issue to VSCode project?

@ramya-rao-a

This comment has been minimized.

Show comment
Hide comment
@ramya-rao-a

ramya-rao-a Mar 3, 2017

Member

Update: I can repro this
We can track this in #836. Please upvote/add comments in that issue

Member

ramya-rao-a commented Mar 3, 2017

Update: I can repro this
We can track this in #836. Please upvote/add comments in that issue

@Russtopia

This comment has been minimized.

Show comment
Hide comment
@Russtopia

Russtopia Apr 27, 2017

Also check if you have copies of gocode.exe both in $GOROOT/bin (or %GOROOT%\bin on Windows) and $GOPATH/bin (%GOPATH%\bin) and be sure to remove all old versions before doing

go get -u github.com/nsf/gocode

Russtopia commented Apr 27, 2017

Also check if you have copies of gocode.exe both in $GOROOT/bin (or %GOROOT%\bin on Windows) and $GOPATH/bin (%GOPATH%\bin) and be sure to remove all old versions before doing

go get -u github.com/nsf/gocode

@Twitch-CultCoder

This comment has been minimized.

Show comment
Hide comment
@Twitch-CultCoder

Twitch-CultCoder May 26, 2017

Perfect. I had the exact same problem on windows 7 Ultimate. gocode close and go get -u github.com/nsf/gocode fixed it for me. Thanks guys. Saved me huge headaches.

Twitch-CultCoder commented May 26, 2017

Perfect. I had the exact same problem on windows 7 Ultimate. gocode close and go get -u github.com/nsf/gocode fixed it for me. Thanks guys. Saved me huge headaches.

@scippio

This comment has been minimized.

Show comment
Hide comment
@scippio

scippio Nov 27, 2017

gocode close && go get -u github.com/nsf/gocode fix in insider: Microsoft/vscode@89b158e

scippio commented Nov 27, 2017

gocode close && go get -u github.com/nsf/gocode fix in insider: Microsoft/vscode@89b158e

@dc0d

This comment has been minimized.

Show comment
Hide comment
@dc0d

dc0d Dec 30, 2017

Happened today, in a strange way.

How?

It did not work for a project (directory, opened with code -g -n dir). But worked for another project (Go 1.9.2, latest VSCode, Ubuntu 16.04).

I have:

  • Updated all packages needed for the extension,
  • Done gocode stop (and also killall gocode - both stopped the gocode),
  • Done gocode drop-cache (no effect),
  • And then ran gocode -debug -s.

My guess: This happens when number of candidates are more than one (in a sample case Number of candidates found: 3). There should be priority for searching for packages like:

  1. ./internal/...,
  2. ./pkg/...,
  3. ./,
  4. ../.,
  5. ../parents-and-their-children-up-to-$GOPATH/,
  6. Rest of $GOPATH (nearest neighbor? kidding!).

@ramya-rao-a Since this comes up from time to time, I guessed a comment would be more helpful than opening an issue, especially that I just have some guess and can not reproduce this, reliably. Thanks!

dc0d commented Dec 30, 2017

Happened today, in a strange way.

How?

It did not work for a project (directory, opened with code -g -n dir). But worked for another project (Go 1.9.2, latest VSCode, Ubuntu 16.04).

I have:

  • Updated all packages needed for the extension,
  • Done gocode stop (and also killall gocode - both stopped the gocode),
  • Done gocode drop-cache (no effect),
  • And then ran gocode -debug -s.

My guess: This happens when number of candidates are more than one (in a sample case Number of candidates found: 3). There should be priority for searching for packages like:

  1. ./internal/...,
  2. ./pkg/...,
  3. ./,
  4. ../.,
  5. ../parents-and-their-children-up-to-$GOPATH/,
  6. Rest of $GOPATH (nearest neighbor? kidding!).

@ramya-rao-a Since this comes up from time to time, I guessed a comment would be more helpful than opening an issue, especially that I just have some guess and can not reproduce this, reliably. Thanks!

@dc0d

This comment has been minimized.

Show comment
Hide comment
@dc0d

dc0d Dec 31, 2017

@ramya-rao-a I've managed to reproduce it reliably.

When adding this comment with unicodes:

// 𐏃𐏂𐏁𐏀𐎿𐎾𐎽𐎼𐎻𐎺𐎹𐎸𐎷𐎶𐎵𐎴𐎳𐎲𐎱𐎰𐎯𐎮𐎭𐎬𐎫𐎪𐎩𐎨𐎧𐎦𐎥𐎤𐎣𐎢𐎡𐎠 := 1

It stops working and when this comment gets removed, it starts working.

dc0d commented Dec 31, 2017

@ramya-rao-a I've managed to reproduce it reliably.

When adding this comment with unicodes:

// 𐏃𐏂𐏁𐏀𐎿𐎾𐎽𐎼𐎻𐎺𐎹𐎸𐎷𐎶𐎵𐎴𐎳𐎲𐎱𐎰𐎯𐎮𐎭𐎬𐎫𐎪𐎩𐎨𐎧𐎦𐎥𐎤𐎣𐎢𐎡𐎠 := 1

It stops working and when this comment gets removed, it starts working.

@ramya-rao-a

This comment has been minimized.

Show comment
Hide comment
@ramya-rao-a

ramya-rao-a Dec 31, 2017

Member

@dc0d I'd still prefer opening a new issue than a comment here. Rest of this issue either needed a restart of gocode or the issue with VS Code insiders. Both of which are unrelated to the detailed analysis you have done.

The multiple candidates is not an issue. It just means that there are multiple completion items.

I've logged #1431 to track the issue with unicode.

Member

ramya-rao-a commented Dec 31, 2017

@dc0d I'd still prefer opening a new issue than a comment here. Rest of this issue either needed a restart of gocode or the issue with VS Code insiders. Both of which are unrelated to the detailed analysis you have done.

The multiple candidates is not an issue. It just means that there are multiple completion items.

I've logged #1431 to track the issue with unicode.

@Microsoft Microsoft locked as resolved and limited conversation to collaborators Dec 31, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.