-
Notifications
You must be signed in to change notification settings - Fork 656
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
Code completition not properly working for subpackages #233
Comments
main.go isn't importing package object. It's only importing package business. |
The autobuild functionality is still a work in progress, I would not rely on it too much at this point. I'll look into the issue soon anyway. |
The truth is that in Go a package contains all the info it needs to do all the type analysis, even the info from imported packages. So it may happen that gocode reads info about the 'object' package from 'business' package. If you invoke it from a package which imports 'business' only. Therefore rebuilding 'object' won't affect the 'business' package in any way and what it knows about 'object'. That leads to an impression that gocode doesn't see changes in 'object', but in fact it doesn't look into 'object' at all as you've seen with -debug output. So, what happens with |
For now I've added a note to the readme that "autobuild" feature is experimental. |
I've have a similar issues with |
The only solution to that problem is to make both gotype and gocode work with package source files instead of actual compiled packages. I will not implement that feature in gocode in near future, because I don't use go right now at all and I'm in maintainance only mode for all of my go projects. Gocode was written that way historically, because it was written when there was no such thing as GOPATH. Packages were built with makefiles and the only thing we knew is that they are supposed to be installed into GOROOT (no |
That sounds like a lot of work. :-) Thanks for your reply. |
Leaving this issue open for informative purposes. |
I have a problem where gocode isn't autobuilding my package when i've used "set autobuild true" and got output "autobuild true"
i have packages business and subpackage object and inside object I have user.go
directory structure
business/user_manager.go (business package)
business/object
business/object/user.go (object package)
site/main.go (main package)
Code completition stops working for user.go after a while. I think it's after .a file is build from business package. Seems that gocode doesn't notice changes in subpackage
I also used gocode -debug and found out that autocompletion is only searching business.a not object.a .
If I do "go install" for object package gocode still can't find changes to user.go.
But if I do "go install" for business package gocode finds changes I have done to user.go in object package.
My OS is windows 7 64bit.
The text was updated successfully, but these errors were encountered: