Comments (13)
The cache will fallback to -source
if it can't find anything. You can generate those cache files by running go install -i <package>
. You can also try out gopls for faster autocompletion (more info).
from gocode.
@jdevelop: how large is your project?
from gocode.
@stamblerre https://github.com/jdevelop/musicshare
from gocode.
Is there any possibility that your editor is setting the -source
flag? I tried to reproduce this, and the slowest time I got was 24ms for the same completion. I know that Vim has a gocode_propose_source
setting--is it possible you are setting that?
from gocode.
Interesting! I updated to master
and then ran GoUpdateBinaries
- and everything works fast now on Arch Linux now.
pgrep -af gocode
9286 /home/user/go/bin/gocode -s -sock unix -addr 127.0.0.1:37373 -cache
However given the MacPro'15 with exactly the same setup and the gocode
server running with exactly the same arguments on the same project - the completion is very slow still.
Is there any difference between OSX / Linux versions?
from gocode.
Hm, I have heard about Macs being slower than Linux, specifically in the case of the go command (golang/go#28739). I'll try to reproduce this on my Mac later today.
from gocode.
I tried with the fresh environment and master branches of vim-go
and gocode
, so far I feel that there is some small delay on MacOS, but I can't really point it out.
I guess that we can close this one for the moment.
Thanks for the help!
from gocode.
For some reason it stopped working after the most recent updates. The command line for the completion in vim
:
/home/user/go/bin/gocode -sock unix -f vim -builtin -fallback-to-source -cache autocomplete /home/user/go/src/github.com/meetmaps/app/cli/main.go
I wonder where the cache is located? Any chance that it rolls back to source
?
from gocode.
vim-go: 66d06f380ef3cbced060b4d514413762a4438fb4
gocode: 7fb65232883f19a8305706b4b4ff32916ffbcaf5
from gocode.
Looks like it can't read things from cache:
2019/03/09 20:40:23 cache: importing: time, srcdir: /home/user/go/src/github.com/meetmaps/workers
2019/03/09 20:40:23 cache: importing: github.com/meetmaps, srcdir: /home/user/go/src/github.com/meetmaps/workers
2019/03/09 20:40:23 cache: no gcexportdata file for github.com/meetmaps
2019/03/09 20:40:23 cache: cache: falling back to the source importer for github.com/meetmaps
2019/03/09 20:40:23 cache: importing: github.com/meetmaps/queue, srcdir: /home/user/go/src/github.com/meetmaps/workers
2019/03/09 20:40:23 cache: no gcexportdata file for github.com/meetmaps/queue
2019/03/09 20:40:23 cache: cache: falling back to the source importer for github.com/meetmaps/queue
2019/03/09 20:40:24 cache: importing: github.com/meetmaps/storage, srcdir: /home/user/go/src/github.com/meetmaps/workers
2019/03/09 20:40:24 cache: no gcexportdata file for github.com/meetmaps/storage
....
2019/03/09 20:40:29 Elapsed duration: 5.523123152s
How can I generate those cache files?
from gocode.
Looks like this could be related to the different caching in go1.12 - the pkg
folder doesn't have the updates from the codebase. I tried @stamblerre version from github.com/stamblerre/gocode
and it works considerably better, but still yielding
2019/03/09 21:38:48 Elapsed duration: 1.209366734s
which is quite too long
from gocode.
@stamblerre How can we use this gopls feature?
from gocode.
@FuzzOli87: gopls is a replacement for gocode that is currently in alpha. Installation is explained on this Wiki page: https://github.com/golang/go/wiki/gopls.
from gocode.
Related Issues (20)
- Intellisense not working for imported packages when using dep HOT 3
- can't find package in gopath HOT 12
- Panic when autocompleting files under GOPATH HOT 2
- company-go: unwanted completion menu pops up right after left curly brace HOT 3
- No auto-complete with type-assertions HOT 4
- gocode: autocomplete broken in VS Code HOT 3
- Gabage completions after `..` or `...` HOT 2
- missing dependency HOT 1
- Use claat offline
- I can't install
- gocode: not restarting HOT 2
- Contributing
- panic: runtime error: slice bounds out of range [:-1] HOT 2
- Unable to recompile gocode after upgrading golang HOT 1
- Code completion always shows "PANIC" HOT 1
- add build on save to emacs plugin HOT 2
- Antivirus software terminates and detects go-code as infected with Win32/Xpaj.gen virus HOT 1
- Autocomplete and dep's [ignored] tag HOT 2
- Automatic prompting function for package paths HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gocode.