Skip to content

Commit 18aa991

Browse files
committed
test: Update grammar testing package to textmate-grammar-test
1 parent a02b7de commit 18aa991

21 files changed

Lines changed: 2662 additions & 2877 deletions

package-lock.json

Lines changed: 213 additions & 482 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
"package": "vsce package",
3232
"publish": "vsce publish",
3333
"test": "npm run test:JSON && npm run test:JSONC",
34-
"test:grammars": "vscode-tmgrammar-snap --grammar ./syntaxes/tests/grammars/markdown.tmLanguage.json --grammar ./syntaxes/tests/grammars/shell-unix-bash.tmLanguage.json --grammar ./syntaxes/tests/grammars/snippets.tmLanguage.json",
35-
"test:JSON": "npm run test:grammars -- ./syntaxes/tests/JSON/*.* --scope source.json.embedded",
36-
"test:JSONC": "npm run test:grammars -- ./syntaxes/tests/JSONC/*.* --scope source.json.comments.embedded",
34+
"test:JSON": "textmate-grammar-snap ./syntaxes/tests/JSON/*.* --scope source.json.embedded --grammar ./syntaxes/tests/grammars/*.tmLanguage.json",
35+
"test:JSONC": "textmate-grammar-snap ./syntaxes/tests/JSONC/*.* --scope source.json.comments.embedded --grammar ./syntaxes/tests/grammars/*.tmLanguage.json",
3736
"test:update": "npm run test:JSON -- --updateSnapshot && npm run test:JSONC -- --updateSnapshot"
3837
},
3938
"contributes": {
@@ -138,6 +137,6 @@
138137
},
139138
"devDependencies": {
140139
"@vscode/vsce": "^3.7.1",
141-
"vscode-tmgrammar-test": "^0.1.3"
140+
"textmate-grammar-test": "^0.4.2"
142141
}
143142
}

syntaxes/JSON.tmLanguage.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
"$schema": "https://raw.githubusercontent.com/RedCMD/TmLanguage-Syntax-Highlighter/main/vscode.tmLanguage.schema.json",
33
"name": "JSON",
44
"scopeName": "source.json.embedded",
5+
"fileTypes": [
6+
"package.json",
7+
"schema.json",
8+
"colorize-results.json",
9+
".json"
10+
],
511
"patterns": [
612
{ "include": "#value" }
713
],

syntaxes/JSONC.tmLanguage.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
"$schema": "https://raw.githubusercontent.com/RedCMD/TmLanguage-Syntax-Highlighter/main/vscode.tmLanguage.schema.json",
33
"name": "JSON with Comments",
44
"scopeName": "source.json.comments.embedded",
5+
"fileTypes": [
6+
"color-theme.json",
7+
"keybindings.json",
8+
"launch.json",
9+
"settings.json",
10+
"tasks.json",
11+
"tsconfig.json",
12+
"language-configuration.json",
13+
".code-workspace",
14+
".jsonc"
15+
],
516
"patterns": [
617
{ "include": "#value" }
718
],

syntaxes/tests/JSON/color-theme.json.snap

Lines changed: 0 additions & 2380 deletions
This file was deleted.

syntaxes/tests/JSON/colorize-results.json.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SYNTAX TEST "source.json.embedded" "autogenerated snapshot test"
12
>[
23
#^ source.json.embedded meta.structure.array.json punctuation.definition.array.begin.json
34
> {

syntaxes/tests/JSON/negatives.json.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SYNTAX TEST "source.json.embedded" "autogenerated snapshot test"
12
>{
23
#^ source.json.embedded meta.structure.dictionary.json punctuation.definition.dictionary.begin.json
34
> "embeddedLanguages": {
@@ -732,4 +733,5 @@
732733
# ^ source.json.embedded meta.structure.dictionary.json .meta.viewsContainers. meta.structure.dictionary.value.json meta.structure.dictionary.json punctuation.definition.dictionary.end.json
733734
>}
734735
#^ source.json.embedded meta.structure.dictionary.json punctuation.definition.dictionary.end.json
735-
>
736+
>
737+
#^ source.json.embedded

syntaxes/tests/JSON/package.json.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SYNTAX TEST "source.json.embedded" "autogenerated snapshot test"
12
>{
23
#^ source.json.embedded meta.structure.dictionary.json punctuation.definition.dictionary.begin.json
34
> "//$schema": "https://www.schemastore.org/package",
@@ -6139,4 +6140,5 @@
61396140
# ^ source.json.embedded meta.structure.dictionary.json .meta.contributes. meta.structure.dictionary.value.json meta.structure.dictionary.json punctuation.definition.dictionary.end.json
61406141
>}
61416142
#^ source.json.embedded meta.structure.dictionary.json punctuation.definition.dictionary.end.json
6142-
>
6143+
>
6144+
#^ source.json.embedded

syntaxes/tests/JSON/schema.json.snap

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SYNTAX TEST "source.json.embedded" "autogenerated snapshot test"
12
>{
23
#^ source.json.embedded meta.structure.dictionary.json punctuation.definition.dictionary.begin.json
34
> "$schema": "https://json-schema.org/draft-04/schema#",
@@ -2744,4 +2745,5 @@
27442745
# ^ source.json.embedded meta.structure.dictionary.json .meta.defaultSnippets. meta.structure.dictionary.value.json meta.structure.array.json punctuation.definition.array.end.json
27452746
>}
27462747
#^ source.json.embedded meta.structure.dictionary.json punctuation.definition.dictionary.end.json
2747-
>
2748+
>
2749+
#^ source.json.embedded

0 commit comments

Comments
 (0)