Vim-go: Autocomplete stopped working

Created on 16 Dec 2015  路  7Comments  路  Source: fatih/vim-go

Hi fatih, a few days ago autocomplete was working fine, today it stopped working. Here is the error message I get:
-- Omni completion (^O^N^P) Pattern not found.
After trying to autocomplete in fmt. or any other installed packages.
I have set the gopath and all the other features are working. I have no idea why this is happening, I tried removing all the last configs I added to my .nvimrc but it's still not working. I'm using Neovim.
Here is my .nvimrc:

" Enable pipe shape cursor when in insert mode
  let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1

"Pathogen plugin handles $RUNTIMEPATH
  execute pathogen#infect()

"Map leader key to -
  let mapleader = "-"

"Open your .nvimrc with this key map
  nnoremap <leader>en :vsplit $MYVIMRC<return>

"Allows to navigate between modified buffers
  set hidden

"Relative number is way better for motions triggering, set number to show the
"'real' number of current line.
  set number
  set relativenumber
  " Workaround for the clumsy redraw with relativenumber
  set lazyredraw

"Reduce timeout after <ESC> is pressed
  set ttimeout
  set ttimeoutlen=20
  set notimeout

" allow backspacing over everything in insert mode
  set backspace=indent,eol,start

"Preview => more info of completion,menuone=>when one or more results
  set completeopt=preview,menuone

"Set tab indent, 2 spaces
  set tabstop=2
  set softtabstop=0
  set expandtab
  set shiftwidth=2
  set smarttab

" do not keep a backup file, it's all in github anyway
  set nobackup
  set noswapfile

" Autocmd sections for specific filetypes and buffer events -------- {{{
" Only do this part when compiled with support for autocommands.
  if has("autocmd")
    " Enable file type detection.
    syntax enable
    filetype on
    " Also load indent files, to automatically do language-dependent indenting.
    filetype indent on
    filetype plugin on
    filetype plugin indent on
    augroup filetypes
      autocmd!
      autocmd FileType go set shiftwidth=4|set tabstop=4
    augroup END
    augroup markdownb
      autocmd!
      "for changing headings when editing markdown files
      autocmd FileType markdown onoremap <buffer> ih :<c-u>execute "normal! ?^==\\+$\r:nohlsearch\rkvg_"<cr>
      autocmd FileType markdown onoremap <buffer> ah :<c-u>execute "normal! ?^==\\+$\r:nohlsearch\rg_vk0"<cr>
    augroup END
    augroup sourcing_and_buffers
      autocmd!
      "Source .nvimrc after writing it, reloads nvim
      autocmd bufwritepost .nvimrc nested source $MYVIMRC
      " When editing a file, always jump to the last known cursor position.
      " don't do it when the mark is in the first line, that is the default
      " position when opening a file.
      autocmd BufReadPost *
      \ if line("'\"") > 1 && line("'\"") <= line("$") |
      \   exe "normal! g`\"" |
      \ endif
    augroup END
  endif " has("autocmd")

Most helpful comment

The only thing that fixed this for me is

:GoUpdateBinaries

All 7 comments

Hi @kriox26 . Please go install the packages you want to be autocompleted and be sure gocode is installed. There is no regression right now as we didn't change anything on completion. Thanks

Thanks for the quick response, I've installed the packages and here is the output of gocode status

Server's GOMAXPROCS == 4

Package cache contains 1 entries

Listing these entries:
    name: unsafe (default alias: unsafe)
    imports 9 declarations and 0 packages
    this package stays in cache forever (built-in package)

Last edited file: /Users/Matias/Code/lang-analyser/lang.go (package: main)

Other files from the current package:
    /Users/Matias/Code/lang-analyser/lang_test.go

Listing declarations from files:

/Users/Matias/Code/lang-analyser/lang.go:
       func RunAnalyzer
       func Interested
       func main

/Users/Matias/Code/lang-analyser/lang_test.go:
       func TestInterested

Okey, then it must be some local config I have that it's causing this to break. Thanks!

Okey, now that I've read a bit of gocode doc I can see where the problem is. With a simple update to the gocode tool the problem was solved. My mistake thinking it had something to do with the plugin.
Thanks fatih! Closing this up now :+1:

Can you share the update you made? I'm running into the same issue.

I ran into this issue after upgrading my version of Go. Recompiling gocode solved the issue:

go install github.com/nsf/gocode

reinstall gocode fixed this issue for me, please refer to: https://github.com/joefitzgerald/go-plus/issues/433#issuecomment-223325100.

$ gocode close
$ go get -u github.com/nsf/gocode

The only thing that fixed this for me is

:GoUpdateBinaries
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Michael-F-Ellis picture Michael-F-Ellis  路  3Comments

groob picture groob  路  3Comments

smontazeran picture smontazeran  路  4Comments

cassiobotaro picture cassiobotaro  路  3Comments

danielmanesku picture danielmanesku  路  4Comments