如何在GoClipse中启用自动完成功能?

如何在GoClipse中启用自动完成功能?

问题描述:

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?

遵循了说明如何安装GoClipse。 p>

我根本没有发生任何自动完成的事情,无论是出于 我编写的,用于内置程序或用于GAE程序的本地程序包(我已按照Wiki的说明将Go src下载到SDK文件夹中。) p>

我可以检查任何设置吗? 确保正确设置? 自动完成功能是否应该在当前版本中可用? p> div>

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.

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.

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