Skip to content

Commit

Permalink
write the file before using gocode in module mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bhcleek committed Oct 19, 2018
1 parent 33af63d commit 962cb4b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions autoload/go/complete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ function! s:gocodeCommand(cmd, args) abort
let l:gocode_bin = "gocode"
let l:gomod = go#util#gomod()
if filereadable(l:gomod)
" TODO(bc): save the file when in module mode so that go list can read the
" imports. If the user doesn't have autowrite or autorwriteall enabled,
" they'll need to write the file manually to get reliable results.
" See https://github.com/fatih/vim-go/pull/1988#issuecomment-428576989.
call go#cmd#autowrite()
let l:gocode_bin = "gocode-gomod"
endif

Expand Down

0 comments on commit 962cb4b

Please sign in to comment.