Vim-go: Jump-def stopped working after upgrading OS to High Sierra

Created on 20 Nov 2017  路  6Comments  路  Source: fatih/vim-go

What did you do?

Upgraded mac OS to High Sierra

What happened?

Jump def stopped working. I cannot see any logs as well. The output is:
vim-go: present working directory
I don't see any blogs

Configuration (MUST fill this out):

set nocompatible              " be iMproved, required
filetype off                  " required

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

Plugin 'Valloric/YouCompleteMe'
let g:ycm_autoclose_preview_window_after_insertion = 1
Plugin 'tpope/vim-fugitive'

Plugin 'scrooloose/syntastic'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

Plugin 'scrooloose/nerdtree'
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
map <C-n> :NERDTreeToggle<CR>
map <F2> :NERDTreeToggle<CR>
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
  exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
  exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction
call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515')
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515')
call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#151515')
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515')
call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#151515')

Plugin 'vim-airline/vim-airline'
Plugin 'pangloss/vim-javascript'

Plugin 'flazz/vim-colorschemes'
syntax enable
if has('gui_running')
  set background=light
else
  set background=dark
endif
let g:solarized_termcolors= 256
let g:solarized_termtrans = 1
let g:solarized_degrade = 1
let g:solarized_bold = 1
let g:solarized_underline = 1
let g:solarized_italic = 1
let g:solarized_contrast = "normal"
let g:solarized_visibility= "normal"
colorscheme solarized


Plugin 'kien/ctrlp.vim'
let g:ctrlp_show_hidden = 1

Plugin 'scrooloose/nerdcommenter'
Plugin 'plasticboy/vim-markdown'
Plugin 'airblade/vim-gitgutter'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'itchyny/lightline.vim'
Plugin 'easymotion/vim-easymotion'

Plugin 'fatih/vim-go'
let g:go_fmt_command = "gofmt"
let g:go_fmt_command = "goimports"
let g:go_def_mode = 'guru'

set backspace=2
set number
set expandtab
autocmd Filetype yml setlocal tabstop=2
set tabstop=2
set shiftwidth=2
set softtabstop=2
set smarttab
set clipboard=unnamed
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
map <F7> mzgg=G`z

fun! <SID>StripTrailingWhitespaces()
  let l = line(".")
  let c = col(".")
  %s/\s\+$//e
  call cursor(l, c)
endfun
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()


call vundle#end()           
filetype plugin indent on

Please help. Jump def is like oxygen.

waiting-for-info

Most helpful comment

@Odinman can you try running :GoUpdateBinaries; those errors looks suspiciously like some problems that happened when Sierra originally came out, too. RE: https://github.com/golang/go/search?o=desc&q=mspanlist_insert&s=created&type=Issues&utf8=%E2%9C%93

All 6 comments

Do you see any errors with :messages?

Also, please fill out the issue template. It's there for a reason :-)

my errors with :messages

vim-go: failed MSpanList_Insert 0x707000 0x239ff12877f45 0x0 0x0
vim-go: fatal error: MSpanList_Insert
vim-go: 
vim-go: runtime stack:
vim-go: runtime.throw(0x4bebc0, 0x10)
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:530 +0x90 fp=0x7ffeefbff100 sp=0x7ffeefbff0e8
vim-go: runtime.(*mSpanList).insert(0x67ff68, 0x707000)
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:933 +0x293 fp=0x7ffeefbff130 sp=0x7ffeefbff100
vim-go: runtime.(*mheap).freeSpanLocked(0x67f760, 0x707000, 0x100, 0x0)
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:809 +0x4be fp=0x7ffeefbff198 sp=0x7ffeefbff130
vim-go: runtime.(*mheap).grow(0x67f760, 0x8, 0x0)
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:675 +0x2a0 fp=0x7ffeefbff1f0 sp=0x7ffeefbff198
vim-go: runtime.(*mheap).allocSpanLocked(0x67f760, 0x1, 0x0)
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:553 +0x4e3 fp=0x7ffeefbff248 sp=0x7ffeefbff1f0
vim-go: runtime.(*mheap).alloc_m(0x67f760, 0x1, 0x15, 0x0)
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:437 +0x119 fp=0x7ffeefbff278 sp=0x7ffeefbff248
vim-go: runtime.(*mheap).alloc.func1()
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:502 +0x41 fp=0x7ffeefbff2a8 sp=0x7ffeefbff278
vim-go: runtime.systemstack(0x7ffeefbff2c8)
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:307 +0xab fp=0x7ffeefbff2b0 sp=0x7ffeefbff2a8
vim-go: runtime.(*mheap).alloc(0x67f760, 0x1, 0x10000000015, 0x4967f)
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/mheap.go:503 +0x63 fp=0x7ffeefbff2f8 sp=0x7ffeefbff2b0
vim-go: runtime.(*mcentral).grow(0x681360, 0x0)
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/mcentral.go:209 +0x93 fp=0x7ffeefbff360 sp=0x7ffeefbff2f8
vim-go: runtime.(*mcentral).cacheSpan(0x681360, 0x67b7b8)
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/mcentral.go:89 +0x47d fp=0x7ffeefbff3a0 sp=0x7ffeefbff360
vim-go: runtime.(*mcache).refill(0x703000, 0x15, 0x7ffeefbff408)
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/mcache.go:119 +0xcc fp=0x7ffeefbff3d8 sp=0x7ffeefbff3a0
vim-go: runtime.mallocgc.func2()
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/malloc.go:642 +0x2b fp=0x7ffeefbff3f8 sp=0x7ffeefbff3d8
vim-go: runtime.systemstack(0x7ffeefbff498)
vim-go:         /usr/local/Cellar/go/1.6/libexec/src/runtime/asm_amd64.s:307 +0xab fp=0x7ffeefbff400 sp=0x7ffeefbff3f8

@Odinman can you try running :GoUpdateBinaries; those errors looks suspiciously like some problems that happened when Sierra originally came out, too. RE: https://github.com/golang/go/search?o=desc&q=mspanlist_insert&s=created&type=Issues&utf8=%E2%9C%93

@bhcleek锛宮y problem has been solved after running : GoUpdateBinaries, thank you!
The reason is the version of guru is too old

@olttwa I just upgraded to High Sierra and jumping to a definition still works. We definitely need more info to make this actionable.

@Carpetsmoker @bhcleek On getting :messages, I first got an error:

Messages maintainer: Bram Moolenaar <[email protected]>

The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). YCM core library too old; PLEASE RECOMPILE by running the install.py script. See the documentation for more details.

After fixing above error, I opened my golang project, and got this error on getting :messages

Messages maintainer: Bram Moolenaar <[email protected]>
"config/config.go" 15L, 215C
RuntimeError: Gocode panicked trying to find completions, you likely have a syntax error.
RuntimeError: Gocode panicked trying to find completions, you likely have a syntax error.
RuntimeError: Gocode panicked trying to find completions, you likely have a syntax error.
vim-go: searching declaration ...
vim-go: FAILED```

and this one too:

"server/api.go" 24L, 396C
"server/router.go" 22L, 330C
vim-go: searching declaration ...
vim-go: FAILED
```
After that, I ran :GoUpdateBinaries. Post that jump-def is working fine.

Thanks a lot. I didn't know about :messages command in vim.
Closing this issue.

Sorry for the late response.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

svanharmelen picture svanharmelen  路  3Comments

andrejvanderzee picture andrejvanderzee  路  3Comments

danielmanesku picture danielmanesku  路  4Comments

jongillham picture jongillham  路  3Comments

preslavmihaylov picture preslavmihaylov  路  3Comments