go-langserver
go-langserver copied to clipboard
completion doesn't work with go master
https://github.com/nsf/gocode/issues/510
Maybe switch to https://github.com/mdempsky/gocode? the speed difference is minimal but it won't break every other Go release.
Thanks for the link. I see the gocode README now suggests the switch, so this makes sense to me.
Currently mdempsky/gocode comes with two modes:
- Parsing source file without cache
- Parsing binary (.a files) with cache
I tried integrating it in go-langserver and quickly tested each mode. There is no perceivable difference on speed for the binary mode, but the source mode is unbearably slow (takes few seconds on my MacBook Air).
Since the Go team is working towards deprecating the $GOPATH/pkg cache (see https://github.com/golang/go/issues/4719#issuecomment-341861487), we should definitely switch to an implementation that parses source code. Currently, I suggest that we switch to mdempsky/gocode and expose the source/binary mode option to users. Finally we might deprecate the binary mode when the source mode has a cached solution.
mdempsky/gocode refactors the original gocode, making the core functions modular and easy to follow, so it is easy to switch to it. Really appreciate Dempsky's work!
Yeah that makes sense to me. A PR for what you have done sounds GTM. It may make sense to use a fork of mdempsky/gocode
which we pull in via dep
. That way it will be easy to track upstream, vs what the copy + modified versions in this repo.
I don't have time to work on the PR until next Tue. So for anyone interested please help implementing that.
After a while I found out that I was not using cache at all when testing, but the performance for parsing binary file without cache seems adequate. mdempsky/gocode
has its cache coupling with its main package, and the author suggested me to utilize the unified cache in go-langserver. That's a fair advice, but if I mistake not, our loader cache is slow. How should I deal with the completion cache?
@Contextualist Hi, I could help you to work on integrating mdempsky/gocode. My plans was to copy only needed mdempsky/gocode into go-langserver and use global go-langserver cache for better performance. I made PR https://github.com/sourcegraph/go-langserver/pull/305 which adds new gocode. It is working locally, but I need to test it more (performance, caching, unit tests). I'm also planning to implement unimported packages autocomplete inside gocode.
My plans was to copy only needed mdempsky/gocode into go-langserver
I think we should switch to using a fork (or trying to get it being a library upstream), so that we can more easily integrate updates to upstream gocode in the future.
I hate to be that guy, but bump. anyone?
Go 1.11 is officially out.
@OneOfOne Hi, I'm working on https://github.com/sourcegraph/go-langserver/pull/305. I was on vocation for few weeks, but now I'm continue on this.
Is this still an issue?