bbatsov/prelude

Overhaul prelude-go

hut8 opened this issue · 2 comments

hut8 commented

Go has changed quite a bit since Prelude's last change in prelude-go.

The biggest change that precipitates the other changes was the abandonment of gocode. That's the completion backend that prelude-go ends up requiring. A few years ago, there was the addition of modules to Go, and they were not added to gocode, so the autocompletion stopped working. Later, there was a fork of the original gocode that was maintained for a bit, then another fork after that which added module support. Unfortunately, even the second fork is now unmaintained. But of course there is an alternative!

gopls is the new completion backend. It is LSP compatible so it shouldn't be hard to get working because prelude already uses LSP for other languages including rust.

go-eldoc appears to only want gocode, not gopls. I am doing research now to pick some packages that will work well for gopls.

hut8 commented

I'm using this as a guide: https://geeksocket.in/posts/emacs-lsp-go/

Looks like company-go should probably not be used; the backend is 100% gocode and is therefore broken. I replaced mine with lsp-mode and it works great. PR will follow.

hut8 commented

Thanks for reviewing and merging.