Error with autocomplete in Eclipse
Asked Answered
P

1

10

I am running Eclipse 4.6.3 with GoClipse and NodeClipse installed. I have configured Go in Preferences -> Go.

I want autocomplete to work for Go. However, it is giving me the error: writing to process input broken pipe

See screenshots below for error and configuration.

Error

Go

enter image description here

How do I fix this problem?

Precedent answered 13/7, 2017 at 18:40 Comment(8)
I would seriously reconsider using Eclipse. Instead look at gogland if you want a complete IDE.Arrester
@AdamDymitruk agreed but for unmentioned reasons here I have to use Eclipse unfortunatelyPrecedent
some stacks you should check as this error doesn't seem language specific. This is more of a general issue with eclipse. #12872447 #10706930 eclipse.org/forums/index.php/t/367694 That all being said and shown, you will likely have better turn around asking in an eclipse only community.Trilley
I guess the executables for gocode, guru and godef that you specify in the preferences were incorrect. The executables should be $GOPATH/bin/gocode, $GOPATH/bin/guru and $GOPATH/bin/godef (replace $GOPATH with real path). Don't forget to install those tools.Betancourt
@Betancourt is correct. This is at least part of your problem. The .go files are most definitely not executable.Cecilycecity
@Betancourt your comment actually solved the problem for me. I already installed those but just didn't point to the right places. If you post an answer I will accept itPrecedent
The answer is provided by @mhutter. Please accept it.Betancourt
@Betancourt done thanks guysPrecedent
Y
7

At least on the second page, all of the paths seem wrong. You supplied the path to the source code where the dialog asks for the path to the executable.

To make sure you have all the tools installed run the following commands in the terminal:

go get -u github.com/nsf/gocode
go get -u golang.org/x/tools/cmd/guru
go get -u github.com/rogpeppe/godef

Now, for each of the tools run

which <tool>
# example:
which guru
# => /Users/user/gocode/bin/gocode

Copy the output into the Executable: field in the config screen.

For gofmt you should be able to simply tick "Use default location"

Yapok answered 18/7, 2017 at 14:17 Comment(1)
I just noticed the same was discussed in the comments (which I blatantly ignored). If @Betancourt wants to add this as an answer I'll delete mine.Yapok

© 2022 - 2024 — McMap. All rights reserved.