Golang in Vim - Tagbar plugin shows incorrect places

691 views Asked by At

I've installed vim-go with all needed binaries, added tagbar plugin from https://github.com/majutsushi/tagbar, gotags and ctags binaries exist in may $PATH.

The problem is that some functions/variables redirect me to the absolutely wrong line (same for multiple tagbar's functions), and some of them works properly. I can't open even main() function in a current project. And I don't see the differences in tagbar/code among these functions/objects.

This is also added to the .vimrc:

let g:tagbar_type_go = {  
    \ 'ctagstype' : 'go',
    \ 'kinds'     : [
        \ 'p:package',
        \ 'i:imports:1',
        \ 'c:constants',
        \ 'v:variables',
        \ 't:types',
        \ 'n:interfaces',
        \ 'w:fields',
        \ 'e:embedded',
        \ 'm:methods',
        \ 'r:constructor',
        \ 'f:functions'
    \ ],
    \ 'sro' : '.',
    \ 'kind2scope' : {
        \ 't' : 'ctype',
        \ 'n' : 'ntype'
    \ },
    \ 'scope2kind' : {
        \ 'ctype' : 't',
        \ 'ntype' : 'n'
    \ },
    \ 'ctagsbin'  : 'gotags',
    \ 'ctagsargs' : '-sort -silent'
\ }

Please help to make tagbar work properly, what am I missing?

0

There are 0 answers