vscode-tmgrammar-test
vscode-tmgrammar-test copied to clipboard
Undesired scope is not detected
Pattern:
{
"name": "keyword",
"match": "fun"
}
Test:
funvar := true
// ^^^ - keyword
However the test passes.
@serkonda7, could you generate a snapshot file with a vscode-tmgrammar-snap
(just use it instead of vscode-tmgrammar-test
) and post it here?
@PanAeon Let me ask serkonda7 question differently. Let's say we have this successful test:
funvar := true
// ^^^^^^ - keyword
how should I test that keyword
is not matching a space after 'funvar'? If I add a negative match after each check, that will make tests hard to write. I think there should be a test mode to match exactly. Or a special syntax:
// ^^^^^^ - !keyword
match keyword here and nowhere else. Thanks for the plugin, very useful.
@senyai Well, I guess you are right. My idea was to actually add negative check afterwards. You can try snapshot tests if you need strict tests right now. I believe they are matching exactly