visualfc / liteide

LiteIDE is a simple, open source, cross-platform Go IDE.
GNU Lesser General Public License v2.1
7.57k stars 971 forks source link

Autocompletion is not working #952

Closed abhishekbarua closed 5 years ago

abhishekbarua commented 6 years ago

Please answer these questions before submitting your issue. Thanks! Please download LiteIDE latest version and test before submitting your issue. Thanks!

What version of LiteIDE are you using (LiteIDE About - Version and Build Qt Version)?

X33.3

What version of Go are you using (go version)?

1.10.3

What operating system and processor architecture are you using(go env)?

GOARCH="amd64" GOBIN="" GOCACHE="/home/gmat/.cache/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/gmat/Workspace/go" GORACE="" GOROOT="/usr/lib/go" GOTMPDIR="" GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build812797537=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Simple hello world program. Presseing f inisde main() gives popup for fmt. Then I press . (dot) Then when I press P, no popup Then when I press r, no popup Then when I press i, no popup Then when I press n, no popup

What did you expect to see?

After "fmt." when I press P, it should open popup.

What did you see instead?

Nothing. Autocompletion does not work. I need to type by hand.

visualfc commented 6 years ago

please download x33.4 and test. change https://github.com/nsf/gocode to https://github.com/mdempsky/gocode

AnimusPEXUS commented 6 years ago

have same here with both x33.3 and x33.4. I've already installed mdempsky/gocode, but looks like liteide uses it's own gocode and avoiding using mdempsky/gocode

removed liteide's bin/gocode, so it's now using installed by mdempsky/gocode. still no autocompletion.

AnimusPEXUS commented 6 years ago

I've killed gocode and started it manually in debug mode.. looks like it bails out with parsing error in place where it should provide completion.

AnimusPEXUS commented 6 years ago

created issue https://github.com/mdempsky/gocode/issues/37 with -debug dump

AnimusPEXUS commented 6 years ago

sorry, I've had a different problem..

lrita commented 6 years ago

Hi @visualfc,

the autocompletion doesn't work with builtin type, such as error. This may be cause by gocode. x33.4 in macOS.

hzmsrv commented 6 years ago

it is work but showing very very very slow.

rsarov commented 6 years ago

x33.4 for windows all work fine, but x34 not

visualfc commented 6 years ago

please update to liteide x34.1

lrita commented 6 years ago

I am using x34.1 a few days, it works fine. But the autocompletion does not work today suddenly.

@visualfc

After reinstalling x34.1 and removing ~/.config/liteide/liteide.ini, it still does not work any more.

Do u know how to recovery it in macos?

DennisMao commented 6 years ago

the autocompletion is not work on the "testing" package. I have tried go install at the path $GOROOT/src/testing,it does not work @visualfc

Env: os : win10 64bit version: x34.1

lrita commented 6 years ago

@visualfc

There is a odd problem. When I launch LiteIDE.app/Contents/MacOS/gocode -s -sock unix -addr 127.0.0.1:37373 manually before that I launch LiteIDE, the Autocompletion works fine.

When I launch LiteIDE and LiteIDE launch LiteIDE.app/Contents/MacOS/gocode -s -sock unix -addr 127.0.0.1:37373 secondly, the Autocompletion does not work.

@DennisMao you can have a try.

DennisMao commented 6 years ago

@lrita Thanks ,

visualfc commented 5 years ago

please download x35.1 and check.

AnimusPEXUS commented 5 years ago

no autocompletion problems on My side.

ghost commented 5 years ago

For me (x35.1 & MacOS) autocompletion for imports only works for built-in packages like fmt, strings and so on. It doesn't find any packages in my GOPATH (e.g. github.com/gorilla/mux). When I manually import a package from my GOPATH it will recognise methods etc. though. Never had that behaviour on my Linux installation.

21:19:54 GolangPackage: Found go bin at /usr/local/go/bin/go 21:19:54 GolangPackage: GOROOT=/usr/local/go 21:19:54 GolangPackage: GOPATH=/Users/mpeters/go 21:19:54 GolangDoc: Found godoc at /usr/local/go/bin/godoc 21:19:54 GolangCode: go environment changed 21:19:54 GolangCode: Found gocode at /private/var/folders/bw/xt1kdstx79vgbl2r1ch_5xlw0000gn/T/AppTranslocation/1487EBD5-482C-4998-A968-2E7F554A0BF3/d/LiteIDE.app/Contents/MacOS/gocode 21:19:54 GolangCode: gocode set lib-path "/Users/mpeters/go"

visualfc commented 5 years ago

@mpetrs Are you mean automatic import prompt ? please check liteide options-GolangCode : PKG automatic import hints for all packages (GOPATH)

ghost commented 5 years ago

Yeah, that's what I mean. Automatic import for all packages is activated.