gocode: The only autocompletion I get is PANIC
Hello,
Just installed gocode a few minutes earlier and all attempts to get it to work in vim failed. Ultimately, I started a server manually (gocode -s) and then using the gocode client in command line, I tried: “gocode autocomplete math.F” and that resulted in a:
Found 1 candidates:
PANIC PANIC PANIC
Verifying the server window that showed:
panic: runtime error: index out of range
1(runtime.panic): /usr/local/go/src/pkg/runtime/panic.c:248
2(runtime.panicstring): /usr/local/go/src/pkg/runtime/panic.c:478
3(runtime.panicindex): /usr/local/go/src/pkg/runtime/panic.c:433
4(main.(*tok_collection).find_decl_beg): /home/alex/.go/src/github.com/nsf/gocode/ripper.go:39
5(main.(*tok_collection).find_outermost_scope): /home/alex/.go/src/github.com/nsf/gocode/ripper.go:102
6(main.(*tok_collection).rip_off_decl): /home/alex/.go/src/github.com/nsf/gocode/ripper.go:116
7(main.rip_off_decl): /home/alex/.go/src/github.com/nsf/gocode/ripper.go:133
8(main.(*auto_complete_file).process_data): /home/alex/.go/src/github.com/nsf/gocode/autocompletefile.go:55
9(main.(*auto_complete_context).apropos): /home/alex/.go/src/github.com/nsf/gocode/autocompletecontext.go:241
10(main.server_auto_complete): /home/alex/.go/src/github.com/nsf/gocode/server.go:128
11(main.(*RPC).RPC_auto_complete): /home/alex/.go/src/github.com/nsf/gocode/rpc.go:26
12(runtime.call64): /usr/local/go/src/pkg/runtime/asm_amd64.s:340
13(reflect.Value.call): /usr/local/go/src/pkg/reflect/value.go:474
14(reflect.Value.Call): /usr/local/go/src/pkg/reflect/value.go:345
15(net/rpc.(*service).call): /usr/local/go/src/pkg/net/rpc/server.go:381
16(runtime.goexit): /usr/local/go/src/pkg/runtime/proc.c:1389
I am using Go version: go version devel +f4d1cb8d9a91 Thu Sep 19 22:34:33 2013 +1000 linux/amd64
Please let me know if there’s any other info I can provide.
Thank you, really looking forward to using this in Vim 😃
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Reactions: 9
- Comments: 31 (9 by maintainers)
Here’s the one liner to update gocode
gocode close && go get -u github.com/nsf/gocodeOh, I forgot to tell you to actually restart gocode. Because if you updated it, it won’t work as is, since there is an actual process running already. Do:
gocode close. It will kill the server and will start a new one automatically. Or just reboot if you wish.Turned out I was fighting in vain for very long … I had to delete the /tmp/gocode-daemon.samuel socket first, which was revealed when trying to start a new gocode server with gocode -s. So, just for reference:
(Then of course, adopt to whatever the name is in “unix socket [file name] already exists”)
atom got this problem ; gocode close && go get -u github.com/nsf/gocode ; reopen atom; works like a charm
Yeah, I kind of regret not embedding the version info into gocode binaries and checking those on each client/server communication. Could solve some of your user experience issues.
If the gocode version and go compiler version mismatch, it’s possible. You need to make them up to date. I don’t recommend installing gocode and go from distribution repositories, because it’s easy to do manually.
sudo apt-get remove gocode
@samuell , in vim-go , go1.7 , have the same problem
gocode closedidn’t work for me. Had to removegocodelisted atwhich -a gocodeand reinstall it viago get -u.