dumb-jump icon indicating copy to clipboard operation
dumb-jump copied to clipboard

Suggestion: Warn when ripgrep is missing PCRE

Open dsedivec opened this issue 4 years ago • 1 comments

Steps to reproduce:

  1. Foolishly build ripgrep without libpcre.
  2. Try to dumb-jump-go in a C file (like Emacs's src/keyboard.c).

Expected results: Preferably go to the definition of whatever is under point, or at least tell me to change dumb-jump-rg-search-args or get a better ripgrep build.

Observed results: E.g. ’kset_echo_prompt’ c++ declaration not found. No hint that it's failing because I don't have PCRE enabled. This caused me to think dumb-jump was broken, until...

If I turn dumb-jump-debug, I can see:

-----
DUMB JUMP DEBUG ‘dumb-jump-run-command‘ START
----- 

cmd: 
	rg --color never --no-heading --line-number -U --pcre2 --type c --type cpp [...]

raw results: 

	PCRE2 is not available in this build of ripgrep
 
-----
DUMB JUMP DEBUG ‘dumb-jump-run-command‘ END
-----

I suggest it might be better if dumb-jump could detect this and do something like remove --pcre2 from dumb-jump-rg-search-args (which then probably needs a warning about multi-line signatures being broken?), or at least just say "get a ripgrep with libpcre, you dork".

Thank you for this excellent package! I'm rebuilding ripgrep while I'm writing this issue...

dsedivec avatar Oct 10 '19 18:10 dsedivec

Thanks for opening this! I appreciate the suggestion and all the background work you did here. I'll try to take a closer look and implement something like what you're describing sometime soon.

jacktasia avatar Oct 10 '19 18:10 jacktasia