Fix-80080 Show more detailed error message for "Regex parse error" in search#80495
Fix-80080 Show more detailed error message for "Regex parse error" in search#80495roblourens merged 6 commits intomicrosoft:masterfrom
Conversation
roblourens
left a comment
There was a problem hiding this comment.
Thanks for the PR, this is a good start. What I would like to see:
- Only show the PCRE2 error message, without any "PCRE2" label
- No newlines
- Test cases
|
@roblourens , All changes done according to the review :) |
roblourens
left a comment
There was a problem hiding this comment.
Thanks, but I don't want to see the error message from the non-PCRE2 engine at all. These are just confusing implementation details that the user doesn't care about. It shouldn't show anything about "engines" or "compiling" or anything else besides the error that the PCRE2 engine gave. To me, this is the "real" error message.
|
@roblourens , The changes are done . |
src/vs/workbench/services/search/node/ripgrepTextSearchEngine.ts
Outdated
Show resolved
Hide resolved
|
@roblourens , Sorry for these little misses. |
| } | ||
| }); | ||
| return errorMessage.join(' : '); | ||
| let pcre2ErrorLine = lines.filter(l => (startsWith(l, 'PCRE2:')))[0]; |
There was a problem hiding this comment.
This is better but pcre2ErrorLine will be undefined if there is no matching line. It shouldn't fail if the string is in an unexpected format.
src/vs/workbench/services/search/node/ripgrepTextSearchEngine.ts
Outdated
Show resolved
Hide resolved
|
@roblourens , I wanted to do that check but was not sure as I assumed the error will be in that format always but It is fixed now. |

@roblourens , Here is the PR to close #80080.
I thought the below format would be good.
"Regex Parse Error"
"regex could not be compiled with either the default regex engine or with PCRE2."
"error: " related to default regex
"PCRE2: " related to PCRE2 .
I need help on one more thing which I am not able to figure out.
By adding "\n" , the contents are not coming up in new line !