spacemace lsp-go不生效,请教是怎么回事

我加载了golayer,但是补全总是用的默认的gocode来触发补全行为,

     lsp
     (go :variables go-backend 'lsp)

这是我的配置,为什么会不用lsp来补全呢,我也有M-x lsp-mode RET,但是还是不行.go-language server也在PATH里面,运行也不报错,就是不生效

I havent used/tested spacemacs go layer but generally you start lsp-mode via lsp not via lsp-mode.

我也试了下,用lsp启动后显示连接上了,server是bingo,但是补全很慢,得3s左右才能弹出来,不确定是不是lsp的补全

Assuming that you are using the latest version of lsp-mode you may do (setq lsp-print-performance t) . After that you may inspect *lsp-log* and find out how much time it was spent on the server/deserialization and for client side handling.

我的已经可以了,莫名奇妙就行了。只是速度很慢

可能是刚开始没有安装 go-langserver 或环境变量的问题导致找不到 go-langserver。

lsp 内置了两款 golang server,当你的 go 版本为 1.11+ 时,优先选择 bingo。