Open dpelle opened 7 years ago
I have the same issue with:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jul 11 2017 12:56:49)
Included patches: 1-705
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors
-browse -footer +multi_byte +terminfo
++builtin_terms +fork() +multi_lang +termresponse
+byte_offset +gettext -mzscheme +textobjects
+channel -hangul_input +netbeans_intg +timers
+cindent +iconv +num64 +title
-clientserver +insert_expand +packages -toolbar
-clipboard +job +path_extra +user_commands
+cmdline_compl +jumplist +perl/dyn +vertsplit
+cmdline_hist +keymap +persistent_undo +virtualedit
+cmdline_info +lambda +postscript +visual
+comments +langmap +printer +visualextra
+conceal +libcall +profile +viminfo
+cryptv +linebreak +python/dyn +vreplace
+cscope +lispindent +python3/dyn +wildignore
+cursorbind +listcmds +quickfix +wildmenu
+cursorshape +localmap +reltime +windows
+dialog_con +lua/dyn +rightleft +writebackup
+diff +menu +ruby/dyn -X11
+digraphs +mksession +scrollbind -xfontset
-dnd +modify_fname +signs -xim
-ebcdic +mouse +smartindent -xpm
+emacs_tags -mouseshape +startuptime -xsmp
+eval +mouse_dec +statusline -xterm_clipboard
+ex_extra +mouse_gpm -sun_workshop -xterm_save
+extra_search -mouse_jsbterm +syntax
+farsi +mouse_netterm +tag_binary
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/etc"
f-b for $VIMRUNTIME: "/usr/share/vim/vim80"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -g -pipe -Wall -Werror=format-security -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/python3.6m -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -Wl,--as-needed -o vim -lm -lnsl -lselinux -lncurses -lacl -lattr -lgpm -ldl -Wl,--enable-new-dtags -Wl,-z,relro -Wl,-z,relro -fstack-protector-strong -L/usr/local/lib -L/usr/lib64/perl5/CORE -lperl -lpthread -lresolv -lnsl -ldl -lm -lcrypt -lutil -lc
The "E688: More targets than List items" error comes from here in ~/.vim/bundle/vim-rtags/plugin/rtags.vim:386:
375 function! rtags#JumpToHandler(results, args)
376 let results = a:results
377 let open_opt = a:args['open_opt']
378 if len(results) >= 0 && open_opt != g:SAME_WINDOW
379 call rtags#cloneCurrentBuffer(open_opt)
380 endif
381
382 if len(results) > 1
383 call rtags#DisplayResults(results)
384 elseif len(results) == 1
385 let [location; symbol_detail] = split(results[0], '\s\+')
!386 let [jump_file, lnum, col; rest] = split(location, ':')
Debugging, I see that results[0] is "Not indexed" so line 386 gives an error.
When I find time, I will try older versions of rtags, vim-rtags, or vim or in case an incompatible change was recently introduced.
I investigated further and the bug is a recent regression in vim-rtag plugin.
Snippet of git log:
commit ba58fc0aa46411a1e0b1a4442b9d31924d3892fb
Author: taku25 <taku36@gmail.com>
Date: Fri Jun 23 16:50:49 2017 +0900
imp: async. ExecuteThen Function
commit 344ffe479f7100fee4e4ac3fb6dae267224651c2
Author: taku25 <taku36@gmail.com>
Date: Fri Jun 23 14:59:42 2017 +0900
delete debug message
commit ba174ea825665cdd2d05434cf527d135657a380d
Author: taku25 <taku36@gmail.com>
Date: Fri Jun 23 14:48:24 2017 +0900
refactoring
Error detected while processing /home/dope/.vim/bundle/vim-rtags/plugin/rtags.vim:
line 850:
E193: :endfunction not inside a function
I have the same issue, and make a workaround after some debugging work. The reason is quite simple.
The 'rc' command doesn't accept input location without path information. For example, you have a source file: '~/work/hello.c', and you can use 'rc' command to inspect if the --follow-location is working or not. Using the 'rc --follow-location hello.c:10:1' will print 'Error, can't resolve argument'. The 'rc' command expects it's input argument has the path information, no matter it is relative or absolute. Using 'rc --follow-location ~/work/hello.c' will generate the correct information.
To do so, we need to change one place of rtags##getCurrentLocation function in 'vim-rtags/plugin/rtags.vim'. Change line(334):
return printf("%s:%s:%s", expand("%"), lnum, col)
to
return printf("%s:%s:%s", expand("%:p"), lnum, col)
to make the current file name to be expand to full path when calling 'rc' command
I press \rj to jump to the definition of a c++ symbol and I get:
It also does not jump to the definition, presumably as a result of the error. It happens all the time. I used to be able to run vim-rtag without problems but I've re-created my setup with the latest version of the tools and now it no longer works.
I'm using the latest vim-rtag plugin version from git (via Vundle):
I'm also using using the latest version of rtags from git:
And the latest version of Vim from git on Linux x86_64 (xubuntu-16.04):
Any idea what causes the error?