eclipsegoautocompleteeclipse-plugingoclipse

How to get autocomplete (GoCode) to work with all my imports?


After installing the GoCode autocompletion daemon in GoClipse, it works for the more general imports (fmt and such), but not for more specific ones.

I do believe my GoClipse is properly set up, since it works with some imports already. The specific import I am trying to make it work for is "github.com/hyperledger/fabric/core/chaincode/shim".

There must be something I have to do to make those imports work, but I haven't figured it out yet. I can always code without autocompletion, but eh.

Does anyone know how to make it work? Thanks a bunch.

Note: I'd post images to illustrate my problem, but well: "You need at least 10 reputation to post images".

Edit : It also doesn't autocomplete local variables. Is it related? Or is it working as intended?

Screenshots:

enter image description here

enter image description here

enter image description here


Solution

  • Alright, So I digged and found the solution to my problem. I basically needed to locally install the import on my machine.

    This is easily done with the go get command

    For example, for the specific problem I had, I wanted the import "github.com/hyperledger/fabric/core/chaincode/shim" to autocomplete. I ran the command

    go get "github.com/hyperledger/fabric/core/chaincode/shim"

    Restarted GoClipse and it works perfectly.

    Hope it helps someone else.