-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
panic with regex-fancy feature on one line JS files #3156
Comments
This fork doesn't panic on non compiling regexes. Fix #967 The reason the fork is needed is that syntect panics when a regex from a syntax can't compile, which happens with sublime syntaxes when the engine isn't onig but fancy-regex. The default regex engine of syntect is onig, but this unmaintained engine isn't pure-rust and isn't compatible with gcc 15, which limits compatibility for broot. So, right now, this fork is useful to prevent crashes. The ideal solution would be either to have syntect completely handle regex compiling errors without panic (which looks easily doable but requires some work and may not appear as the best behavior for some other crates using syntect) and|or to have fancy-regex support all the regex features that are required by sublime syntaxes. See also: * fancy-regex/fancy-regex#74 * sharkdp/bat#3156 * #956 * trishume/syntect#508
The solution I used in broot was to use a forked version of syntect to prevent panics (and not applying not computable rules). A more general solution might be to do a PR for syntect, adding a no-panic mode. I don't know if that would be of interest for bat. |
I believe it would be useful for |
So I'll try to propose a clean PR to syntect. |
@keith-hall Can you please have a look at trishume/syntect#564 and give me your opinion ? This is the exact code of the fork used in broot current's main, avoiding runtime panics. |
Seems reasonable to me :) btw I tracked the incompatible regex pattern down to https://github.com/babel/babel-sublime/blob/f4579f9107996c16208466248a85dc2296083a5f/JavaScript%20(Babel).YAML-tmLanguage#L357 |
@keith-hall Any idea to unblock this PR ? |
I guess it makes sense to get CI passing as much as possible - the |
With current main (commit 3e07483):
results in
It may be due to https://github.com/sublimehq/Packages/blob/master/JavaScript/Indentation%20Rules.tmPreferences#L73
The reason I want to use regex-fancy is that the onig crate fails to build with gcc 15.
Background: I'm the author of another program using syntect, I have the same problem and just verified it was also happening in bat. A solution should apply to both bat and broot.
The text was updated successfully, but these errors were encountered: