Hi, I'm still working on the lsp-parser for luasnip and noticed that global is a bit broken right now (empty matches are not accepted at all).
I've modeled my solution to this after quickjs (see here, where, if I'm understanding everything correctly, the character after the empty match is skipped, to prevent matching it again.)
This works, a downside is that matches sometimes have an empty match appended (eg. s/(.*)/g on a -> {[1,2], [2,2]}), but this seems to be consistent with some quick testing I did via https://rcode5.github.io/jsregex/ and vscode itself
Hi, I'm still working on the lsp-parser for luasnip and noticed that
global
is a bit broken right now (empty matches are not accepted at all). I've modeled my solution to this after quickjs (see here, where, if I'm understanding everything correctly, the character after the empty match is skipped, to prevent matching it again.) This works, a downside is that matches sometimes have an empty match appended (eg.s/(.*)/g
ona
->{[1,2], [2,2]}
), but this seems to be consistent with some quick testing I did via https://rcode5.github.io/jsregex/ and vscode itselfhttps://user-images.githubusercontent.com/41961280/178162489-fa0b9a31-77d0-4e8c-9a33-2848c9d30a6a.mp4
(you can see the
a
from the second match at the end)What do you think? It's certainly not pretty, and will have to be adapted a bit for unicode, but it works.