neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.43k stars 954 forks source link

Reader is undefined with gopls as a language server #1390

Closed villevaltonen closed 4 years ago

villevaltonen commented 4 years ago

Result from CocInfo

versions

vim version: VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41) node version: v10.16.3 coc.nvim version: 0.0.74-d83536aa4e term: dumb platform: linux

Describe the bug

When using "gopls" as a command for in LSP configs for Golang in Vim8, it fails to start the language server due error described in the screenshot below. I'm using the default plugin manager of Vim.

Go-version: go1.13.5 linux/amd64 gopls-version: @latest (9th Dec 2019)

Reproduce the bug

  1. Install Go: https://golang.org/doc/install#install
  2. Install gopls: https://github.com/golang/tools/blob/master/gopls/doc/user.md
  3. Get some Go-project: https://github.com/go-training/helloworld
  4. Open Vim and set CocConfigs to (change "command" accordingly, usually binary found from /home/go/bin/gopls): { "languageserver": { "golang": { "command": "/home/go/bin/gopls", "rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"], "filetypes": ["go"] } } }

There is also a guide for installing vim-go and coc.nvim, but I used the default vimrc-settings for coc.nvim from your docs. My full Vim-setup is available from my repository called dotfiles (branch coc-bug). There are complete .vimrc and bin/vim-setup.sh for installing plugins for default plugin manager).

Screenshots

image

fannheyward commented 4 years ago

Does your /home/go/bin/gopls works? Try /home/go/bin/gopls --help to make sure gopls can really work.

chemzqm commented 4 years ago