pechorin / any-jump.vim

Jump to any definition and references 👁 IDE madness without overhead 🚀
1.08k stars 40 forks source link

E474: Invalid argument #26

Open shapovalovts opened 4 years ago

shapovalovts commented 4 years ago

On vim 8.2 + Ubuntu18 I constantly get this (on ,):

Error detected while processing function <SNR>93_Jump[30]..search#SearchDefinitions[19]..<SNR>142_RunRgDefinitionSearch[5]..<SNR>142_ParseRgResults:
line 7: E474: Invalid argument

ag is installed.

Blake-LeBlanc commented 4 years ago

I'm running into the same issue.

Currently have Linux setup to run ag with

https://github.com/ggreer/the_silver_searcher

And integrated into vim's search with

https://github.com/mhinz/vim-grepper

maksimyugai commented 4 years ago

Have the same issue:

KDE Neon
Linux ext 4.15.0-88-generic #88-Ubuntu SMP

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 01 2020 17:17:52)
Included patches: 1-343

image

pechorin commented 4 years ago

@maksimyugai sorry, i have some questions:

do you have aliased rg? is rg installed? only ag installed?

Thanks :)

pechorin commented 4 years ago

I think i found the problem, will be fixed very very sone, please wait.

pechorin commented 4 years ago

Fixed in https://github.com/pechorin/any-jump.vim/commit/934e54b24b0af7897204dd370d0c0066f6ddd57e

Please report if it's okay now :)

pechorin commented 4 years ago

@shapovalovts is it okay now?

Blake-LeBlanc commented 4 years ago

Thanks for the quick follow-up @pechorin !

Unfortunately, it's still giving me the same errors, with ag installed.

pechorin commented 4 years ago

@Blake-LeBlanc ok, will try to find it

pechorin commented 4 years ago

Please report if issue is still occured.

Blake-LeBlanc commented 4 years ago

@pechorin Let me ask you this... How are you setting up vim's current search engine? Maybe I don't have it configured properly on my end?

Because as I noted above, I added ag into Linux with https://github.com/ggreer/the_silver_searcher

And then integrating it into vim with: https://github.com/mhinz/vim-grepper

Maybe if I follow what you've done to set up vim, I will get your plugin to work?

pechorin commented 4 years ago

vim-grepper isn't problem because i do direct system() calls without any proxied methods. Hmm. Do you PlugUpdate() for latest any-jump version?

Blake-LeBlanc commented 4 years ago

vim-grepper isn't problem because i do direct system() calls without any proxied methods. Hmm. Do you PlugUpdate() for latest any-jump version?

Yes, I'm on c665d7a. If you need me to send any further information, just let me know! Thank you @pechorin :)

pechorin commented 4 years ago

@Blake-LeBlanc c665d7a is outdated :) please update plugin to today master https://github.com/pechorin/any-jump.vim/commit/c65a2f38977c87c661543a54d5917c8876ca009b

blasco commented 4 years ago

Hi, I have the same issue. This is the error message:

Error detected while processing function <SNR>38_Jump[30]..search#SearchDefinitions[28]..<SN
R>189_RunRgDefinitionSearch[8]..<SNR>189_ParseRgResults:
line    7:
E474: Invalid argument

I have the latest version and still not working. I'm running on arch linux, I have rg installed and this is my vim version:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar  1 2020 17:21:03)
Included patches: 1-343
Compiled by Arch Linux
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tag_old_static
+arabic            +file_in_path      +mouse_urxvt       -tag_any_white
+autocmd           +find_in_path      +mouse_xterm       +tcl/dyn
+autochdir         +float             +multi_byte        +termguicolors
-autoservername    +folding           +multi_lang        +terminal
+balloon_eval      -footer            -mzscheme          +terminfo
+balloon_eval_term +fork()            +netbeans_intg     +termresponse
+browse            +gettext           +num64             +textobjects
++builtin_terms    -hangul_input      +packages          +textprop
+byte_offset       +iconv             +path_extra        +timers
+channel           +insert_expand     +perl/dyn          +title
+cindent           +job               +persistent_undo   +toolbar
+clientserver      +jumplist          +popupwin          +user_commands
+clipboard         +keymap            +postscript        +vartabs
+cmdline_compl     +lambda            +printer           +vertsplit
+cmdline_hist      +langmap           +profile           +virtualedit
+cmdline_info      +libcall           +python/dyn        +visual
+comments          +linebreak         +python3/dyn       +visualextra
+conceal           +lispindent        +quickfix          +viminfo
+cryptv            +listcmds          +reltime           +vreplace
+cscope            +localmap          +rightleft         +wildignore
+cursorbind        +lua/dyn           +ruby/dyn          +wildmenu
+cursorshape       +menu              +scrollbind        +windows
+dialog_con_gui    +mksession         +signs             +writebackup
+diff              +modify_fname      +smartindent       +X11
+digraphs          +mouse             +sound             -xfontset
+dnd               +mouseshape        +spell             +xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        +mouse_gpm         +statusline        +xsmp_interact
+eval              -mouse_jsbterm     -sun_workshop      +xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary        
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi-3.2.1/include -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -pthread    -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -D_REENTRANT  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.30/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lelf -lnsl    -lcanberra  -lacl -lattr -lgpm -ldl   -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.30/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/perl5/5.30/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc   -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm
pechorin commented 4 years ago

Maybe this error was occured by required pcre2 support. Now this is dropped in - https://github.com/pechorin/any-jump.vim/commit/be4b64a6d4bbd82f8c5b076bf28666f150eea13a

@blasco can you update to latest version on try? Also can you tell what language do use search and what keyword. I can't reproduce this on my system, so i need some help to investigate problem.

blasco commented 4 years ago

Last version is working fine, not sure what was causing the issue :)

Blake-LeBlanc commented 4 years ago

I'm still having the issue on my end with ag, on

615a7139fbb953c312f0d464e2f23fef5c3abb84

Screenshot of error: https://imgur.com/ekwPVgz

@shapovalovts Is it working for you yet with ag?

pechorin commented 4 years ago

Okay, can you for now do :let g:any_jump_search_prefered_engine = 'ag'

Error message trace indicates what code run through rg-methods, this is strange.

Is same error/backtrace occurred after global variable change?

Blake-LeBlanc commented 4 years ago

Okay, can you for now do :let g:any_jump_search_prefered_engine = 'ag'

Error message trace indicates what code run through rg-methods, this is strange.

Is same error/backtrace occurred after global variable change?

Thank you for your quick reply @pechorin !

With that setting enabled, the error message now reads

https://imgur.com/a/pweriGI

EDIT: And that's when calling the plugin in either a .rb or .js file

pechorin commented 4 years ago

@Blake-LeBlanc and last question - what's your working file filetype? (name/extension).

P.S. - okay, i see, it's about rb and js files.

pechorin commented 4 years ago

@Blake-LeBlanc also can you provide output of commands here:

:echo executable('rg')
:echo executable('ag')

I need to be sure what where are no aliases here

Blake-LeBlanc commented 4 years ago

@Blake-LeBlanc also can you provide output of commands here:

:echo executable('rg')
:echo executable('ag')

I need to be sure what where are no aliases here

Both of these return 1

pechorin commented 4 years ago

@Blake-LeBlanc can you provide:

echo search#GetCurrentSearchEngine()
Blake-LeBlanc commented 4 years ago

@Blake-LeBlanc can you provide:

echo search#GetCurrentSearchEngine()

That returns rg

So I updated the global variable setting to be

:let g:any_jump_search_prefered_engine = 'rg'

and the error now reads

https://imgur.com/a/Uj3jO46

I was surprised it said rg though. I had tried installing ripgrep in the past a long time ago but ran into issues (maybe that has something to do with the problems?) Is there any way I could set the CurrentSearchEngine() to ag instead?

pechorin commented 4 years ago

You should update setting to

:let g:any_jump_search_prefered_engine = 'ag'

Also please try to upgrade ripgrep and ag (this matters).

The problem what error message is hidden. I think i should fix it for now.

pechorin commented 4 years ago

Where are also some crazy way to remotly debug :) Can you open and change source of any-jump plugin right on your pc? You need to open autoload/search.vim on line 410 and basically add line:

echo string(a:raw_results)

i think where are some problems with raw results parsing maybe.

Blake-LeBlanc commented 4 years ago

Where are also some crazy way to remotly debug :) Can you open and change source of any-jump plugin right on your pc? You need to open autoload/search.vim on line 410 and basically add line:

echo string(a:raw_results)

i think where are some problems with raw results parsing maybe.

Added!

Also, I went ahead and removed ripgrep altogether so I only have ag installed, and your plugin now WORKS!!! Yay! :)

Thank you so much for your help @pechorin !

pechorin commented 4 years ago

I still think what ripgrep was installed without some required feature support. I think i should add rg features check. Thanks for reporting. Close the report.

If you make screenshot of echo string(a:raw_results) please share, i need to see full error message :]

Blake-LeBlanc commented 4 years ago

I still think what ripgrep was installed without some required feature support. I think i should add rg features check. Thanks for reporting. Close the report.

If you make screenshot of echo string(a:raw_results) please share, i need to see full error message :]

The error message output is

https://imgur.com/xDD0hQL

And just to clarify, here is the code I added per your request

https://imgur.com/uOLJsDA

What else can I do?

pechorin commented 4 years ago

Hmm, thanks. I will be in thinking about this. Also glad what ag setup works for you.

Blake-LeBlanc commented 4 years ago

Hello Andrey @pechorin !

I recently setup a new distro and ran into this issue again trying to get it to work with ag, but I think I figured out what was causing it.

In my .vimrc I was using the following configuration:

let g:any_jump_search_preferred_engine = 'ag'

Note the two R's in "preferred".

When I referenced this issue to use your suggestions, I noticed that the config option spells "prefered" with only one R. Using this in the above option fixed the issue.

This may cause some confusion with native English speakers as "preferred" is spelled here with two R's.

Just thought I'd make you and others aware of this in case it's giving anyone else an issue.

Hope you're doing well Andrey! Thanks again for your useful plugin!

All the best, Blake

pechorin commented 3 years ago

WOW, thanks! :) I should fix spelling

at8i commented 3 years ago

Hello , I am having the same problem with .cpp project that I am working on : Screenshot-20201209084152-942x122 I installed ripgrep and any-jump and configured it to use rg with : let g:any_jump_search_prefered_engine= 'rg' I got the error shown in the picture. 2- I installed ag and used any-jump with ag but I did not get definitions and any cross-file or cross-folder references. I always use ctags with my c++ projects with easytags and it works fine but your plugin seems clean and I wanted to give it a try. Just last question and I know this is not the place: Is there anyway to configure ag to look for definitions across files and folders. Just an update : I thought maybe creating RIPGREP_CONFIG_PATH might help the issue so that rg would only run with option -P or --pcre2. It turns out that ripgrep need to be compiled with pcre2 option. I purged ripgrep and compiled from source but now I can only run rg from the folder I compiled it in. I think all of this might come to pcre2 option. I will update my comment as I go along this line of thought. Update-2 : I was not able to find a way to build rg with pcre2 option and to make recognized globally by the system. There might be a way around it but I don't know. Another option would be for any_jump to let the users specify path to rg so maybe we can run rg with pcre2 and see if that fixes the problem. Last Update: I tested with a couple of command lines with rg. The problem is not pcre2 or rg. The problem is something else. I tested rg with a specific pattern on my project's src directory and it all worked just fine. Meanwhile, I am going to go back to my ctags and cry in the corner.

Thanks, Best Regards Amir Toosi