Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Getting weird "PANIC" in my go-langserver #317

Closed
esn89 opened this issue Sep 10, 2018 · 10 comments
Closed

Getting weird "PANIC" in my go-langserver #317

esn89 opened this issue Sep 10, 2018 · 10 comments

Comments

@esn89
Copy link

esn89 commented Sep 10, 2018

I am using neovim with LanguageClient-neovim with the gocodecompletion enabled:

let g:LanguageClient_serverCommands = {
    \'go' : ['/Users/esn89/.go/bin/go-langserver', '-gocodecompletion']
    \}

However, when it tries to show me suggestions I get things like:
https://i.imgur.com/D9MNz6y.png

Funnily enough, it used to work a couple of weeks ago. Any ideas?

For reference, the go-langserver I am using is v2-dev.

@chemzqm
Copy link

chemzqm commented Sep 10, 2018

Same issue on mac.

@seagle0128
Copy link

seagle0128 commented Sep 10, 2018

Same issue here, with Go 1.11 on mac.

panic: unknown export format version -1 ("i\x00\xe9\x03\xc6\x06\x18$GOROOT/src/fmt/print.go\x00\x05Write\x01b\x01n\x03err\x05Width\x03wid\x02ok\tPrecision\x04prec\x04Flag\x01c\x06Format\x01f\x05State\x06String\bGoString\x01w\x06Writer\x02io\x06format\x01a\aesc:0x1\aesc:0x9\x17$GOROOT/src/fmt/scan.go\bReadRune\x01r\x04size")
1(runtime.call32): /usr/local/Cellar/go/1.11/libexec/src/runtime/asm_amd64.s:522
2(runtime.gopanic): /usr/local/Cellar/go/1.11/libexec/src/runtime/panic.go:513
3(github.com/sourcegraph/go-langserver/langserver/internal/gocode.(*gc_bin_parser).parse_export): /Users/vincent/go/src/github.com/sourcegraph/go-langserver/langserver/internal/gocode/package_bin.go:126
4(github.com/sourcegraph/go-langserver/langserver/internal/gocode.(*package_file_cache).process_package_data): /Users/vincent/go/src/github.com/sourcegraph/go-langserver/langserver/internal/gocode/package.go:132
5(github.com/sourcegraph/go-langserver/langserver/internal/gocode.(*package_file_cache).update_cache): /Users/vincent/go/src/github.com/sourcegraph/go-langserver/langserver/internal/gocode/package.go:92
6(github.com/sourcegraph/go-langserver/langserver/internal/gocode.update_packages.func1): /Users/vincent/go/src/github.com/sourcegraph/go-langserver/langserver/internal/gocode/autocompletecontext.go:439
7(runtime.goexit): /usr/local/Cellar/go/1.11/libexec/src/runtime/asm_amd64.s:1333

@diegs
Copy link

diegs commented Sep 11, 2018

FWIW I did a rm -rf on the cache in $GOPATH/pkg and that seemed to fix it...

@slimsag
Copy link
Member

slimsag commented Sep 11, 2018

I think this will be fixed once #305 is merged

@anjmao
Copy link
Contributor

anjmao commented Sep 11, 2018

@esn89 If you can checkout #305 locally and check if it works for you that would be great, I tested this PR with vscode only.

git clone git@github.com:anjmao/go-langserver.git
cd go-langserver
git checkout gocode
go install ./...

@bittopaz
Copy link

@anjmao I have just tried your branch locally. And I'm using Emacs with LSP enabled.

The panic error is gone. But I get the errors as below when auto-complete:

Error from the Language Server: no declaration found for s.L (Unknown error) [2 times]
(No changes need to be saved)
SPC m e e is undefined
Error from the Language Server: no declaration found for s.L (Unknown error)
Error from the Language Server: no declaration found for s.La (Unknown error)
Error from the Language Server: no declaration found for s.Las (Unknown error)
Error from the Language Server: no declaration found for s.Last (Unknown error)
Error from the Language Server: no declaration found for s.LastP (Unknown error)
Error from the Language Server: no declaration found for s.LastPi (Unknown error)
Error from the Language Server: no declaration found for s.LastPie (Unknown error)
Error from the Language Server: no declaration found for s.LastPiep (Unknown error) [2 times]
Error from the Language Server: no declaration found for s.LastPie (Unknown error)
Error from the Language Server: no declaration found for s.LastPi (Unknown error)
Error from the Language Server: no declaration found for s.LastPip (Unknown error)
Error from the Language Server: no declaration found for s.LastPipe (Unknown error)
Error from the Language Server: no declaration found for s.LastPipel (Unknown error)
Error from the Language Server: no declaration found for s.LastPipeli (Unknown error)
Error from the Language Server: no declaration found for s.LastPipelin (Unknown error) [4 times]

Not sure if this is related...

@anjmao
Copy link
Contributor

anjmao commented Sep 12, 2018

@bittopaz As I see you are getting it from

return nil, fmt.Errorf("no declaration found for %v", pretty{fset, e})
which is actually another tool.

@bittopaz
Copy link

@anjmao Ah I see, thanks.

@esn89
Copy link
Author

esn89 commented Sep 15, 2018

it works for me. will it be merged in the next release? :D

@keegancsmith
Copy link
Member

I've tagged a new release. Thanks for the report.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants