Upgraded to latest vim-go and wanted to experiment with the new gopls completion
I expected gopls to be used for both the built-in omnifunc binding (. real-time completion from deoplete/deoplete-go
I found that gopls was working via omnifunc but deoplete-go was still using gocode
vim-go version: origin/master@cf0b9c9
vimrc you used to reproduce (use a minimal vimrc with other plugins disabled; do not link to a 2,000 line vimrc):
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries', 'for': 'go' }
Plug 'shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'zchee/deoplete-go', { 'do': 'make' }
let g:go_def_mode = "gopls"
:version): NVIM v0.3.4go version): go version go1.12 darwin/amd64p.s. thank you _so_ much for the hard work of implementing gopls support. It is sooo good
So I _thought_ I had fixed this by adding these config options:
let g:deoplete#sources#go = ['vim-go']
let g:deoplete#sources#go#gocode_binary = '/dev/null'
But after experimenting with adding go_debug for 'lsp' I still don't believe deoplete is using gopls via vim-go
Could we add a small note in the :help vim-go-plugins section to mention a recommended configuration for using this via deoplete?
This isn't an issue for vim-go. An issue on deoplete asking them how to configure deoplete for Go would be appropriate. vim-go sets up an omnifunc that uses gopls.
I've opened an issue on Deoplete for this.
As per the issue on deoplete, you need to set an Omni pattern, which tells deoplete when to call the omnifunc:
call deoplete#custom#option('omni_patterns', {
\ 'go': '[^. *\t]\.\w*',
\})
@bhcleek Is this something worth adding to the vim-go documentation? I know that deoplete isn't a necessary part of the vim-go experience but the docs do have a section on real-time completion that mentions deoplete and deoplete-go:
* Real-time completion (Neovim and Vim 8):
https://github.com/Shougo/deoplete.nvim and
https://github.com/zchee/deoplete-go
Perhaps we could add a blurb there? I'd be happy to submit a pull request.
@velovix a PR would be welcome. Thank you!
Most helpful comment
As per the issue on deoplete, you need to set an Omni pattern, which tells deoplete when to call the omnifunc:
@bhcleek Is this something worth adding to the vim-go documentation? I know that deoplete isn't a necessary part of the vim-go experience but the docs do have a section on real-time completion that mentions deoplete and deoplete-go:
Perhaps we could add a blurb there? I'd be happy to submit a pull request.