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

E474: Failed to parse file #71

Open
pseregiet opened this issue Aug 24, 2020 · 4 comments
Open

E474: Failed to parse file #71

pseregiet opened this issue Aug 24, 2020 · 4 comments

Comments

@pseregiet
Copy link

I'm working with u-boot, it's a bootloader for linux (and other) and it happens to have some non-ascii stuff in one of the headers (a font definition). AnyJumps fails to search for anything in this codebase because of this

Error detected while processing function 15_Jump[30]..search#SearchDefinitions[33]..46_RunRgDefinitionSearch[8]..46_Parse
RgResults:
line 7:
E474: Unidentified byte: include/video_font_data.h: PCRE2: error matching: UTF-8 error: isolated byte with 0x80 bit set
E474: Failed to parse include/video_font_data.h: PCRE2: error matching: UTF-8 error: isolated byte with 0x80 bit set
Press ENTER or type command to continue

Would it be possible to just ignore such errors and not include that file in the result ?

@pseregiet
Copy link
Author

Bumping this issue because it happens in more repositories and it's really annoying. This plugin really rules and I don't want to change to another :( Please help.

Error detected while processing function 15_Jump[30]..search#SearchDefinitions[33]..46_RunRgDefinitionSearch[8]..46_ParseRgResult
s:
line 7:
E474: Unidentified byte: lib/fonts/font_8x8.c: PCRE2: error matching: UTF-8 error: isolated byte with 0x80 bit set
E474: Failed to parse lib/fonts/font_8x8.c: PCRE2: error matching: UTF-8 error: isolated byte with 0x80 bit set

@pechorin
Copy link
Owner

pechorin commented Dec 8, 2020

Снимок экрана 2020-12-08 в 03 01 40

i cannot reproduce anything with https://gitlab.archlinux.org/dvzrv/linux-rt/-/blob/fe82702ad8dd2918a86949902fc2d1c0bc375274/lib/fonts/font_8x8.c#L474

can you provide example and search keyword?

@pseregiet
Copy link
Author

pseregiet commented Feb 16, 2021

Снимок экрана 2020-12-08 в 03 01 40

i cannot reproduce anything with https://gitlab.archlinux.org/dvzrv/linux-rt/-/blob/fe82702ad8dd2918a86949902fc2d1c0bc375274/lib/fonts/font_8x8.c#L474

can you provide example and search keyword?
--

Sorry for the very late reply... I have fixed this problem myself by adding --no-pcre2-unicode argument to rg in the autoload/search.vim file.


diff --git a/autoload/search.vim b/autoload/search.vim
index bd95509..fad4a85 100644
--- a/autoload/search.vim
+++ b/autoload/search.vim
@@ -3,7 +3,7 @@
 let s:regexp_keyword_word = 'KEYWORD'
 let s:engines             = ['rg', 'ag']

-let s:rg_base_cmd = "rg -n --auto-hybrid-regex --json"
+let s:rg_base_cmd = "rg -n --auto-hybrid-regex --json --no-pcre2-unicode"
 let s:ag_base_cmd = "ag --nogroup --noheading"

 let s:rg_filetype_convertion_map = {
@@ -39,6 +39,7 @@ let s:non_standard_ft_extensions_map = {
       \}

 let s:filetypes_comments_map = {
+      \"c":             ["//"],
       \"cpp":           ["//"],
       \"elisp":         [";"],
       \"commonlisp":    [";"],

I've pulled the origin/master and this error is still present. This is the offending file: https://elixir.bootlin.com/u-boot/latest/source/include/video_font_data.h
This error shows up when searching (coma J) for any word, as it (I assume) calls rg for the whole repo and rg fails without that argument on that font file. Perhaps you have PCRE2 disabled in config of rg itself ?

@dkalowsk
Copy link

dkalowsk commented Jul 8, 2021

@pseregiet thanks for the initial leg work here. I was seeing a similar issue for C files that I was using as well, although the error message wasn't providing a file or line... just error. From what I could see, it looked like the C regexs for any-jump were all PCRE2 only.

I ended up changing the line to support rg v12 and 13 and got it working locally with:

let s:rg_base_cmd = "rg -n --pcre2 --engine auto --json --unicode"

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