-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Trying to Search using variable length look-behind suggests enabling search.usePCRE2, but no such setting #79109
Comments
(Experimental duplicate detection) |
/needsMoreInfo This flag was deprecated in 1.37 because these features should be enabled automatically https://code.visualstudio.com/updates/v1_37#_search-regex-features Do you see any errors in DevTools (Help > Toggle Developer Tools) when you performs search? |
Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue. Happy Coding! |
@IllusionMH No errors in the DevTools Console. I have also tried the same on the Insiders' build |
Realised that fixed-length look-behinds work, this only happens with variable-length ones. Update: OK, it turns out PCRE (and most other regex libraries except .Net's) doesn't support infinite-length look-behind expressions... |
Oh, looks like it is |
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines. Happy Coding! |
@peteVo do you see error message under the search field? Probably I erroneously marked this as duplicate, because while inability to use variable length lookbehind can't be fixed, it make sense to use this issue to remove irrelevant error message in notification. @roblourens what do you think? |
Yeah so when search returns a regex parse error, we suggest trying the PCRE2 setting because that supports some features that ripgrep by default doesn't. But, now that setting is deprecated because ripgrep is able to fall back on PCRE2 automatically. So this notification needs to be removed. We could parse a better error message out of ripgrep's output but it's a bit of a pain and wouldn't be localized. e.g. in this case it looks like
|
Trying it, it seems like JS doesn't support variable length lookaround either, it just doesn't show an error message. I don't think there are a lot of features that fall into this gap but I don't have a list. Regarding localization, I could map ripgrep errors to localized errors, but most regex parse errors will actually just come from JS because first we try to parse the regex in JS. I don't want to try to localize those. There are a lot and we will just make it harder to google. |
Strange. Just tried in VSCode DevTools, and it works just fine (in Chromium and same node version). Am I doing something wrong? As for localization - I saw cases where message returned almost as is from engine and understand why it makes a little sense to localize other.
Nice point! |
No, I am... I can't write regexes in the morning, you are correct. |
Steps to Reproduce:
(?<!a.*)b
Open Settings
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: