JoeKazama · 2022-04-30 10:49
Hey so I am trying to setup my Emacs for Golang and everything works fine except for the fact that the auto-complete that company provides is way worse than what I get using VS Code. Is there something potentially wrong with my setup or is this just how company mode is?
For comparison:
https://i.imgur.com/eE54LAK.png
Specifically I wanted response. to show the Body function but it wasn't showing up and that got me confused.
Edit: Had to reinstall all LSP packages and now it shows better completions. It seems I have to do this every time I restart emacs which is strange. But at least it's moving in the right direction. Thank you all for the replies.
Edit 2: I have emerged from the rabbit hole! [This Github issue](https://github.com/emacs-lsp/lsp-mode/issues/1764) solution solved everything, deleting all *.elc files in the lsp-mode directory under .emacs.d
etuu · 2022-04-30 11:05
I'm thinking that this may be of interest: https://github.com/company-mode/company-quickhelp
Here's my setup of company mode in my config: https://github.com/etu/nixconfig/blob/main/modules/emacs-config.el#L285-L292 further down I have bits for quickhelp as well.
I also use eglot to get lsp support: https://github.com/etu/nixconfig/blob/main/modules/emacs-config.el#L337-L344
big_lentil · 2022-04-30 12:48
I have no experience with go or gopls but I tend to get "dumb" company suggestions when something has gone wrong with the language server.
JoeKazama · 2022-04-30 16:15
Took some time but it turns out i had to re-install all my LSP packages, [works good now =\)](https://i.imgur.com/1mCWu3x.png). Only issue is I have to do this every time I restart emacs which is strange...
JoeKazama · 2022-04-30 16:27
Nice, thanks for the reply. Turns out restarting emacs breaks LSP and I need to reinstall it every time to get it to work so that's strange. But it's better than nothing. Also thanks for the quickhelp package. Looks really good!
wargxs · 2022-04-30 17:36
Very strange. Have you tried eglot? Just to check if it is behaves the same way.
https://github.com/joaotavora/eglot
big_lentil · 2022-04-30 18:31
Sounds like something in your init is causing it. Maybe you could track it down by commenting out LSP related sections piece by piece and testing things. You may also be getting an error buffer like \*gopls-error\*
emoarmy · 2022-04-30 19:28
It sounds like lsp/go-lsp isn't loading in their init file. I'm wondering if they have a require in their init for lsp, or if they have an error during lsp initialization in, like, their use-package init.
hangingpawns · 2022-05-01 05:02
something is def wrong with your init. can you look at the messages buffer?
hangingpawns · 2022-05-01 05:03
You're overly confident in your assertion that "restarting emacs breaks LSP" and that you "need to restart it everytime."
​
Nobody else has this problem in the whole world, but you.
trollhard9000 · 2022-05-01 08:24
Sometimes emacs gives me bad completions, mostly when creating a new file or leaving emacs open over the weekend or merging code from master, and I have to restart the LSP server. (Spc c l w r, in Doom emacs)