PanAeon / vscode-tmgrammar-test

Test helpers for VSCode textmate grammars

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarify implications of `-s` removal in 0.1.1

radeksimko opened this issue · comments

It seems to me that the following note in the recent changelog is not true:

remove '--scope' option from vscode-tmgrammar-test. Unit tests got scope information from their header so it wasn't doing anything

At least all of our snap tests, which were passing before are now failing, e.g.

ERROR can't run testcase: tests/snapshot/hcl/basic.hcl
No scope is associated with the file.

https://github.com/hashicorp/syntax/runs/6269178793?check_suite_focus=true#step:5:16

hashicorp/syntax#33

Was that intended? If so - what was the motivation behind making these scopes explicit within the files?

Hi,
the -s option has been removed from the vscode-tmgrammar-test specifically. You can still use it for the vscode-tmgrammar-snap.
The unit tests has been designed to have a top grammar scope in their header. This whole options was an overlook on my part, as the --scope option was originally meant to be for the grammar, so unit tests could link against it. But for the snap tests you can continue to use it to indicate the scope of the testcases.
Also now both programs can read necessary metadata from the package json. This way no additional configuration via command line options is necessary.

You can still use it for the vscode-tmgrammar-snap.

Indeed - I don't know how could I miss that 😅 Thanks!

Also now both programs can read necessary metadata from the package json. This way no additional configuration via command line options is necessary.

Understood, but we maintain our grammars in a separate repository, away from the extensions themselves, so this doesn't apply to us, but it does sound like a useful default for the majority of users!