Vim-go: doc: vim-go + deoplete + deplete-go + gopls

Created on 21 Mar 2019  路  6Comments  路  Source: fatih/vim-go

What did you do? (required. The issue will be closed when not provided.)

Upgraded to latest vim-go and wanted to experiment with the new gopls completion

What did you expect to happen?

I expected gopls to be used for both the built-in omnifunc binding () and the . real-time completion from deoplete/deoplete-go

What happened instead?

I found that gopls was working via omnifunc but deoplete-go was still using gocode

Configuration (MUST fill this out):

  • 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"
  • Vim version (first three lines from :version): NVIM v0.3.4
  • Go version (go version): go version go1.12 darwin/amd64

Most helpful comment

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.

All 6 comments

p.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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joeblubaugh picture joeblubaugh  路  3Comments

surest picture surest  路  3Comments

andrejvanderzee picture andrejvanderzee  路  3Comments

cassiobotaro picture cassiobotaro  路  3Comments

groob picture groob  路  3Comments