vscode-textmate
vscode-textmate copied to clipboard
Wrong backreference escaping
When using backreferences across begin-end/while rules
a bunch of regex characters get escaped in the process
The escape characters differ between VSCode TextMate and the official TextMate 2.0
TextMate 2.0 escapes: https://github.com/textmate/textmate/blob/master/Frameworks/parse/src/parse.cc#L120
\|([{}]).?*+^$
VSCode TextMate escapes: https://github.com/microsoft/vscode-textmate/blob/main/src/utils.ts#L160
\|([{}]).?*+^$-,# \t\n
"begin": "^(.+)$",
"end": "[\\1]+",
"name": "string"
That grammar will match differently between VSCode and TextMate2.0 on the file:
a-z
bcd
a-z
hij
VSCode:
TextMate2.0: