vscode-tmgrammar-test icon indicating copy to clipboard operation
vscode-tmgrammar-test copied to clipboard

`vscode-tmgrammar-test` doesn't handle non-word scopenames

Open RedCMD opened this issue 11 months ago • 0 comments

If the grammar includes scopenames that use characters other than [\w.-] vscode-tmgrammar-test will then error on them

ERROR can't parse testcase: ./syntaxes/json.tmLanguage.json.snap
Error: Invalid assertion at line 6020:
#             ^ source.json.textmate string $0 punctuation.definition.string.begin.json.tm

see how the following scopenames include the literal character $

Image

caused by this regex being too strict https://github.com/PanAeon/vscode-tmgrammar-test/blob/b294109f8c5340ba9f72250017affbb44448ec4b/src/unit/parsing.ts#L5

RedCMD avatar Mar 30 '25 00:03 RedCMD