-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
MarGo installation fails for snap packaged go 1.10 #853
Comments
Did you verify that it's the The code that adds If it's the |
I've confirmed that it's the However, on the development branch I'm now seeing another error message instead:
|
I deleted the binaries and now there are no errors in the console but I'm not sure it finished the installation completely. It ended after:
I don't seem to have any autocompletion for anything other than stdlib packages. |
You'll need to press ctrl+.,ctrl+x to configure margo — which it appears you've already done. You can also confirm it's working by making a syntax error which should automatically get highlighted unless you removed the &golang.SyntaxCheck{} reducer. The &DayTimeStatus{} reducer will also place the time in the status bar. The gocode implementation still relies on binary packages so if you haven't installed them, you won't get any autocompletion. The workflow for this is typically to just use a go install linter that runs on-save but they call You can just copy one into your
|
Ah, I wasn't aware that you had to install to get the completions to work. Is that mentioned in the docs? Otherwise perhaps it would be a good idea to add a comment about it under Installation in README or under Code Completion in USAGE. Also, just out of curiosity, would it be impossible to do code completion simply from source or why does gocode require binaries? Thanks for the quick response, really great feedback! |
I think I found the answer to my own question: nsf/gocode#233 (comment) Thanks again! |
It's possible to use source, but it's currently very slow so I didn't enable it. |
Oh, mind sharing how? Also, feel free to re-open this if you are planning on fixing the issue with snap and the |
I think you just need to use the In the newImporter() function https://github.com/DisposaBoy/GoSublime/blob/development/src/margo.sh/golang/gocode_suggest.go#L45 just add If you have the console open, you will probably start seeing messages like |
It Just Works™! I noticed that there was some work in progress to cache imports in gocode. That would probably speed things up dramatically. Fingers crossed. :) |
Actually, from what I can tell so far, it's only slow the first time suggestions are requested for a package that hasn't been imported yet. After that completions seem smooth. Are you doing something clever in GoSublime or could it be some internal caching going on in go? |
I do some caching in margo:
|
I'm curious then why there is only a delay the first time margo imports (source) and not every time it creates suggestions. I've also noticed that when I add new code to a file that has been imported previously I need to restart margo for it to fetch the new symbols. The only thing I've patched is this:
Are you sure there is no internal cache in go (or something similar) causing this behavior even though you create a new importer instance each time? |
It's probably just a case of failing to cache only GOROOT packages here https://github.com/DisposaBoy/GoSublime/blob/development/src/margo.sh/golang/gocode_suggest.go#L139 it should be |
* vendor github.com/coreos/bbolt * add (untested) boltdb kv store * gocoode_suggest: fix caching of packages in GOPATH * add new `Source` option to use source code for gocode completions *this will most likely be very slow* &golang.Gocode{ Source: true } &golang.GocodeCalltips{ Source: true } * add the -i flag to GoInstall and GoInstallDiscardBinaries examples * don't use -i when installing the agent this fixes DisposaBoy/GoSublime#853
dev branch now excludes latest changes also includes a fix for the gocode caching and a new Source option |
Installation works great now, thanks! Source does unfortunately not seem to work anymore. Removing the |
This is most likely the slowness. Do you see lines like |
Yes, every time I request suggestions and that makes suggestions never pop up.
|
Would it be possible to use the cache for non-GOROOT packages as well and dirty the cache on save? Because now you really feel how slow it is every time you type which isn't really usable. |
I plan to look at better caching soon, but I might have to fork or re-implement the srcimporter. |
Great to hear, thanks! Looking forward to see it in the changelog. :) |
Experimental caching is implemented on the gsu-pkg-cache branch. The main issue I see is that memory use is too high (for my liking), but I don't (yet) see anything that's broken. |
The reason seems to be that the
-i
flag is included in thego install
command which causes a reinstallation ofcgo
because it's seen as stale. See this comment for more info: golang/go#24674 (comment)Is there any particular reason that you explicitly add the
-i
flag for go 1.10 here? This suggests the opposite:The text was updated successfully, but these errors were encountered: