Vim-go: Method auto-completion PANICs on Golang v1.7

Created on 19 Aug 2016  路  5Comments  路  Source: fatih/vim-go

Actual behavior

Updated Golang from v1.6 to v1.7
Tried to auto-complete a structure by pressing Ctrl+X-O and it inserts the word PANIC.

Attaching screenshot:

screen shot 2016-08-18 at 5 51 33 pm

Expected behavior

A dropdown with the list of req's fields/methods.

Steps to reproduce:

Just a default installation of vim-go will do.

Configuration

" My entire vim.rc
set number
set mouse=a
"set list
set nocompatible

" GVIM
if has('gui_running')
    set guifont=Monaco:h11
    set guioptions-=T  "remove toolbar
    colorscheme desert
    autocmd CompleteDone * pclose
" Regular terminal-based vi
else
    " Non-GUI (terminal) colors
    colorscheme desert
endif

set nowrap
set expandtab
set tabstop=4
set shiftwidth=4
set showmatch
set ignorecase
" This prevents comments to be shifted to the beginning of a line:
" set nosmartindent
set hidden
set foldmethod=marker
set swb=usetab

set novisualbell " don't beep
set noerrorbells 

set nobackup    " disable backup file & swap
set noswapfile

set title       " change terminal title
set pastetoggle=<F2>

"set smarttab
set autoindent
set copyindent  " copy prev. indentation 
set incsearch   " search as you type
"set sts=4
"set sw=4
set wildignore+=*.pyc,*.tmp,data/templates/**,*.png,*.jpg,*.gif,data/**

syntax on

au BufRead,BufNewFile *.jj set syntax=htmljinja
au BufRead,BufNewFile *.mako set filetype=mako
au BufRead,BufNewFile *.less set filetype=css
filetype plugin indent on

" Ruby/Rails support
function s:EnableRuby()
    set omnifunc=rubycomplete#Complete
    let g:rubycomplete_rails = 1
    let g:rubycomplete_classes_in_global = 1
    let g:rubycomplete_buffer_loading = 1
    set nosmartindent
endfunction

" Python support
function s:EnablePython()
    set omnifunc=pythoncomplete#Complete
    set smarttab
    set autoindent
    set nosmartindent
    highlight Pmenu guibg=brown gui=bold
endfunction
autocmd FileType python,py call s:EnablePython()
autocmd FileType ruby,eruby call s:EnableRuby()

" Go support
function s:EnableGolang()
    if has('gui_running')
       set background=dark
       colorscheme solarized
    else
       colorscheme desert
    endif
    " Ctrl+] should use godef:
    map <C-]> :GoDef<ENTER>
    map <C-\> :GoInfo<ENTER>
    " update path
    set path+=$HOME/go/src,/usr/local/Cellar/go/1.4.2/libexec/src
endfunction
autocmd FileType go call s:EnableGolang()

" For clipboad convenience (Ctrl+C, Ctrl+Ins do regular clipboard copy).
" Shift+Insert do keyboard paste
map <C-c> "+y
map <C-C> "+y
map <C-Insert> "+y
map <S-Insert> "+p
imap <S-Insert> <C-R>+

" Go Ctrl+Shift+B
map <C-S-b> :wall<ENTER>:make<ENTER>
map <C-S-n> :wall<ENTER>:GoBuild<ENTER>
map <C-S-t> :wall<ENTER>:!go test ./...<ENTER>
map <F2> :w<ENTER>

" Shift+< or Shift+> switch buffers
nmap < :bp
nmap > :bn

imap <F1> <Esc>

" Put swap files in temp:
set dir=/tmp
set tags=tags,./tags,tmp/tags,~/ruby-tags

" Change the color of Omni-completion popup (I hate pink)
highlight Pmenu guibg=brown gui=bold
highlight PmenuSel ctermfg=1 ctermbg=4 guibg=#000000 guifg=#ffffff

" Initialize pathogen (https://github.com/tpope/vim-pathogen)
execute pathogen#infect()
let g:go_bin_path = expand("~/go/bin")
set vb

let g:CommandTMaxDepth = 6
let g:CommandTFileScanner = "find"
let g:CommandTWildIgnore=&wildignore . ",**/Godeps/*"

Versions

  • vim version: 7.4.1689 (Linux) and 7.4 (MacVim)
  • vim-go version: 1.8
  • go version: 1.7

Most helpful comment

Are you sure that's not just the new Request.PANIC method added in go1.7? :wink:

I've also fixed this with :GoUpdateBinaries while playing with the go1.7 beta, in case it crops up again.

All 5 comments

How about restarting your gocode process?

Bam! Worked.

@suzuken @kontsevoy
Sorry, am a golang/vim-go/gocode newbie. How do you restart gocode?
I installed go1.7, vim-go and YouCompleteMe.

Are you sure that's not just the new Request.PANIC method added in go1.7? :wink:

I've also fixed this with :GoUpdateBinaries while playing with the go1.7 beta, in case it crops up again.

For anyone facing this issue in the feature, please run gocode close, reinstall gocode from scratch and then try autocompletion (you do need to start gocode yourself, it is automatically started).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smontazeran picture smontazeran  路  4Comments

groob picture groob  路  3Comments

svanharmelen picture svanharmelen  路  3Comments

cassiobotaro picture cassiobotaro  路  3Comments

joeblubaugh picture joeblubaugh  路  3Comments