-
Notifications
You must be signed in to change notification settings - Fork 646
Use/document gocode "autobuild" to fix missing code completion. #110
Comments
@klauspost Could you give a pointer to a codebase I could try to repro the problem? |
If you rename the |
I just tried turning this on, and when I work in the I could add a note in the README, but given the slowdown not sure it makes sense to encourage folks to turn this on. Also, won't the user still see errors from compile-on-save if they haven't built the dependencies? I'm still a bit unclear on what the real-world setup looks like where this is a problem that just adding 'autobuild true' fixes in a meaningful way. |
It should only be a once-per-package. The standard
All the go tools just compiles what isn't installed on the fly, so ordinarily you don't notice it, compilation just takes a fraction of a second longer. But you can test it out. It works ok for me, except for the very annoying console window that pops up and grabs focus. That is why I left the final decision to you :) |
It also seems to behave "stupid" when you edit a test file in the same folder, but with a different package name than the package. This will make it "rebuild" on almost every keystroke. It seems like adding a FAQ entry is the safest way to go for now. Maybe this will be better after the potential rewrite gocode seems to need. |
The current vscode-go actually uses autobuild=true by default, and the setting is now configurable (#283). Can this issue be closed? |
Although I still question whether using the default of true is a good idea- perhaps some docs would be warranted. |
The autobuild=true option is considered experimental by the gocode author. Doesn't seem like there will be any improvement on that feature. The author desires to rebuild gocode for several reasons, and one of them is to read source files for completion reasons. Seems like they doesn't have the time to address this at the moment: nsf/gocode#307 |
It seems like gocode uses binaries of installed packages
go install <package>
, which makes code completion unable to locate the package if only the source of the package is installed.To remedy this gocode has the
autobuild=true
option, which will automatically build any "missing" packages.vscode-go should either mention this setting in the documentation, ie. execute
gocode set autobuild true
, or enable it automatically. The only downside from enabling it automatically is that a console window shows up briefly when a package is used the first time.The text was updated successfully, but these errors were encountered: