Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error detected while processing function <SNR>47_auto_same_ids[3]..go#guru#SameIds[24] #1477

Closed
cavapoo2 opened this issue Sep 25, 2017 · 5 comments

Comments

@cavapoo2
Copy link

cavapoo2 commented Sep 25, 2017

Behavior

Steps to reproduce:

step inside (CTRL-]) a function like fmt.Println; you will arrive at the fmt source file. Note this happens on all source files

" ~/.vimrc
"

" no vi compat
set nocompatible
set guifont=Inconsolata\ 12
set autowrite
colorscheme torte


" filetype func off
filetype off

" initialize vundle
set rtp+=~/.vim/bundle/Vundle.vim

call vundle#begin()
" start- all plugins below

"Plugin 'VundleVim/Vundle.vim'
"Plugin 'derekwyatt/vim-scala'
"Plugin 'scrooloose/nerdtree'
"Plugin 'majutsushi/tagbar'
"Plugin 'godlygeek/tabular'
"Plugin 'chrisbra/csv.vim'
"put the cursor on line then do gS or gJ to put code on multiple lines or
"single line
"Plugin 'AndrewRadev/splitjoin.vim'
"Plugin 'nsf/gocode', {'rtp': 'vim/'}
Plugin 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
"Plugin 'vim-airline/vim-airline'
"Plugin 'jeetsukumaran/vim-buffergator'
"Plugin 'ensime/ensime-vim'
"Plugin 'vim-syntastic/syntastic'
"errp<TAB> after err code, also fn<TAB> start typing variable in string 
"also json<TAB> in struct
"fn -> fmt.Println()
"ff -> fmt.Printf()
"ln -> log.Println()
"lf -> log.Printf()
"Plugin 'SirVer/ultisnips'
" stop - all plugins above
"Plugin 'ctrlpvim/ctrlp.vim'

call vundle#end()

" filetype func on
filetype plugin indent on
"goland defaults
let g:go_fmt_command = "goimports"
let g:go_fmt_fail_silently = 1
let g:go_snippet_case_type = "camelcase"
let g:go_highlight_fields = 1
let g:go_highlight_types = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
"let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck']
"let g:go_metalinter_deadline = "5s"
let g:go_def_mode = 'godef'
"shows :GoInfo whereever the cursor moves to
let g:go_auto_type_info = 1
let g:go_auto_sameids = 1
" Enable the list of buffers
let g:airline#extensions#tabline#enabled = 1
" Show just the filename
let g:airline#extensions#tabline#fnamemod = ':t'
let g:ctrlp_custom_ignore = {
  \ 'dir':  '\v[\/](\.(git|hg|svn)|\_site)$',
  \ 'file': '\v\.(exe|so|dll|class|png|jpg|jpeg)$',
\}

" Use the right side of the screen
let g:buffergator_viewport_split_policy = 'R'

" I want my own keymappings...
let g:buffergator_suppress_keymaps = 1

" Looper buffers
"let g:buffergator_mru_cycle_loop = 1

" Go to the previous buffer open
nmap <leader>jj :BuffergatorMruCyclePrev<cr>

" Go to the next buffer open
nmap <leader>kk :BuffergatorMruCycleNext<cr>

" View the entire list of buffers open
nmap <leader>bl :BuffergatorOpen<cr>

" Shared bindings from Solution #1 from earlier
nmap <leader>T :enew<cr>
nmap <leader>bq :bp <BAR> bd #<cr>

"shortcuts for golang
map <C-n> :cnext<CR>
map <C-m> :cprevious<CR>

let g:ctrlp_working_path_mode = 'r'

" Use a leader instead of the actual named binding
nmap <leader>p :CtrlP<cr>

" Easy bindings for its various modes
nmap <leader>bb :CtrlPBuffer<cr>
nmap <leader>bm :CtrlPMixed<cr>
nmap <leader>bs :CtrlPMRU<cr>

"quickfix close \a
nnoremap <leader>a :cclose<CR> 
"autocmd FileType go nmap <leader>b  <Plug>(go-build)
autocmd FileType go nmap <leader>r  <Plug>(go-run)
"autocmd FileType go nmap <leader>t  <Plug>(go-test)

" run :GoBuild or :GoTestCompile based on the go file
function! s:build_go_files()
  let l:file = expand('%')
  if l:file =~# '^\f\+_test\.go$'
    call go#test#Test(0, 1)
  elseif l:file =~# '^\f\+\.go$'
    call go#cmd#Build(0)
  endif
endfunction
autocmd FileType go nmap <leader>b :<C-u>call <SID>build_go_files()<CR>

autocmd FileType go nmap <Leader>c <Plug>(go-coverage-toggle)


"tabbing
autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4 
"opens alternate file
autocmd Filetype go command! -bang A call go#alternate#Switch(<bang>0, 'edit')
"same and splits vertical
autocmd Filetype go command! -bang AV call go#alternate#Switch(<bang>0, 'vsplit')
autocmd Filetype go command! -bang AS call go#alternate#Switch(<bang>0, 'split')
autocmd Filetype go command! -bang AT call go#alternate#Switch(<bang>0, 'tabe')
":GoInfo show function information
autocmd FileType go nmap <Leader>i <Plug>(go-info)
"notes for Golang 
"CTRL-] go to defintion, CTRL-t jump back
":GoDefStack - shows history of jumps
"jump between functions ]] and [[
":GoDecls - shows declarations in other window
":GoDeclsDir - shows declarations in the directory
":GoDoc - put this on function and it shows some documentation
":GoSameIds - put cursor on function. it highlights all other place of it
":GoReferrers returns references to selected identifier	
":GoDescribe similar to above but more detail
  • vim version:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
Included patches: 1-1689
Extra patches: 8.0.0056
  • vim-go version:
    must be the development version from
Plugin 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
  • go version:
    1.9

screenshot from 2017-09-25 21-37-08

@arp242
Copy link
Contributor

arp242 commented Sep 25, 2017

The v:t_* variables were introduced in July 2016; Vim 7.4.2071.

Guess we should use the old method of type(var) == type([])?

I wish distros would not ship with Vim versions that are over a year and a half old :-/

@cavapoo2
Copy link
Author

if i manually do :GoInstallBinaries after opening vim then problem goes away

@bhcleek
Copy link
Collaborator

bhcleek commented Sep 26, 2017

@Carpetsmoker since there's an acceptable work around, I think we should just close this issue.

It may be time to put a check in vim-go that checks that the version is at least the minimum supported and if it isn't, then display a warning and stop loading vim-go.

@arp242
Copy link
Contributor

arp242 commented Sep 26, 2017

It may be time to put a check in vim-go that checks that the version is at least the minimum supported and if it isn't, then display a warning and stop loading vim-go.

Bit off-topic here, but probably 7.4.1689 is the minimum supported version, reasoning being that's what the most recent Ubuntu LTS ships with (which quite a few people seem to use). Also see #1450. In April with Ubuntu 18.04 next year we can bump it to 8.0.something.

Just need to get better automated tests for this sort of stuff; I actually tested that PR with 7.4 but guess I forgot to re-test it with 7.4 after adding the ability to use a list, or maybe I useda different 7.4 version.
Did some work on that in #1476 and I have some more work in another WIP branch. Turns out that testing this is actually a lot easier than I thought it would be.

arp242 added a commit that referenced this issue Sep 26, 2017
It's "only" a year old (7.4.2071), and older Vim 7.4 versions don't have
it.

Fixes #1477
@arp242
Copy link
Contributor

arp242 commented Sep 26, 2017

Thanks for reporting @cavapoo2 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants