-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Switch to regex-cursor #9422
Switch to regex-cursor #9422
Conversation
656fca0
to
b0863ab
Compare
b0863ab
to
53fd0db
Compare
Crashed with (not sure what I did)
|
Thats a stranfe one that shouldn't happen but it's very hard to track down without reproduction case (the backtrack is too stripped because it's a release build) |
Ah, it's Edit: I can reproduce with this branch alone |
oh yeah I can reproduce that is very odd. Is suspect it has do do with the special case of an empty file |
I don't think it's a special case with an empty file. If you delete the entire buffer and then do |
53fd0db
to
734275f
Compare
It was an edgecase when you search for stuff at a one-past-the-end position which is what I suspected. Adapting the ropey cursor semantics to the one regex-cusor uses isn't trivial. I published a new version where that is fixed |
734275f
to
a2e7168
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been using this for a while in my driver branch and I haven't noticed any more bugs. It's also really nice to build on top of - for example matching nodes given by tree-sitter with text.regex_input_at_bytes(node.start_byte()..node.end_byte())
I also haven't hit any bugs with this anymore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work as always! Let's get this to soak in master for a bit
Closes #185
Replaces our use of regex with regex-cursor, so we don't have to convert ropes to string. That implementation passes the regex testsuite so it should be stable but definitely needs testing.
See discussion at rust-lang/regex#425.
I used the chance to replace split_at_newline with something that uses ropey so that unicode feature flags are correctly respected (should also be slightly faster).