How to enable autocomplete in GoClipse?

蓝咒 提交于 2019-12-03 21:25:54

问题


The instructions how to install GoClipse have been followed.

I'm not getting any autocomplete stuff happening at all, either for local packages that I write, for built in stuff, or for GAE stuff (I have downloaded Go src to the SDK folder as the wiki states).

Are there any settings that I can check to ensure it is set up correctly? Is autocomplete supposed to work in the current version?


回答1:


As the GoClipse with AppEngine article you linked to says:

We assume the reader has a working copy of GoClipse running in their Eclipse environment.

so that’s not the article you want to refer to. Instead, check for GoClipse.

The auto completion is named content assist in eclipse. The GoClipse features state:

Now delivered with content assist via Gocode for Windows, OS X 64bit, and Linux 64bit.

Gocode is an auto-completion daemon. So you will also have to install and run that one besides your eclipse + GoClipse.




回答2:


There is a bug in the current version of Goclipse for the Linux platform. It currently delivers a prebuilt version of gocode for Windows, 64 bit OS X, and 64 bit Linux. I have only been able to test it locally with limited resources, so I really depend on users to report the problems they find at:

http://code.google.com/p/goclipse/issues/list

If you are having problems, I urge you to download and install gocode into your $GOROOT/bin directory and see if that helps. Otherwise, the fix will come in the next release in a few days.

Also, sorry for causing you any trouble and thank you for trying Goclipse.




回答3:


If you are not using a gocode upstream (but the one shipped with Eclipse) on Linux you are also no be able to build your application with CRTL+F11, although just clicking in Run->Run is going to work.

So, I strongly recommend to update your gocode on Linux, as simple as:

   $ sudo GOPATH=/opt/go/ go  get -u github.com/nsf/gocode 


来源:https://stackoverflow.com/questions/7450989/how-to-enable-autocomplete-in-goclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!