From 7a590b380f74b6292bd4e187d40f861ab1f6d4e5 Mon Sep 17 00:00:00 2001 From: isao-takejib Date: Sat, 10 Jul 2021 09:32:48 +0000 Subject: [PATCH 1/7] Add npm scripts for cassius. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8eebb84..13abce6 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,10 @@ "url": "https://github.com/e-bigmoon/vscode-language-yesod/issues" }, "scripts": { - "test": "npm run test-hamlet && npm run test-lucius && npm run test-yesodroutes", + "test": "npm run test-hamlet && npm run test-lucius && npm run test-cassius && npm run test-yesodroutes", "test-hamlet": "npx vscode-tmgrammar-test -s source.yesod.hamlet -g test/resources/haskell.tmLanguage.json -g syntaxes/hamlet.tmLanguage.json -t 'test/tests/hamlet/*.hamlet'", "test-lucius": "npx vscode-tmgrammar-test -s source.yesod.lucius -g test/resources/haskell.tmLanguage.json -g syntaxes/lucius.tmLanguage.json -t 'test/tests/lucius/*.lucius'", + "test-cassius": "npx vscode-tmgrammar-test -s source.yesod.cassius -g test/resources/css.tmLanguage.json -g test/resources/haskell.tmLanguage.json -g syntaxes/cassius.tmLanguage.json -t 'test/tests/cassius/*.cassius'", "test-yesodroutes": "npx vscode-tmgrammar-test -s source.yesod.routes -g test/resources/haskell.tmLanguage.json -g syntaxes/routes.tmLanguage.json -t 'test/tests/routes/*.yesodroutes'" }, "engines": { From 99688798677bc6e722c0164995945492749e619b Mon Sep 17 00:00:00 2001 From: isao-takejib Date: Sat, 10 Jul 2021 09:35:12 +0000 Subject: [PATCH 2/7] Add test case for selector group. --- test/tests/cassius/selector-groups.cassius | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/tests/cassius/selector-groups.cassius diff --git a/test/tests/cassius/selector-groups.cassius b/test/tests/cassius/selector-groups.cassius new file mode 100644 index 0000000..752187e --- /dev/null +++ b/test/tests/cassius/selector-groups.cassius @@ -0,0 +1,12 @@ +// SYNTAX TEST "source.yesod.cassius" "groups of selectors" + +h1, h2, h3 +// <-- meta.selector.css entity.name.tag.css +// <~~- meta.selector.css punctuation.separator.list.comma.css +// <~~~~-- meta.selector.css entity.name.tag.css +// <~~~~~~- meta.selector.css punctuation.separator.list.comma.css +// <~~~~~~~~-- meta.selector.css entity.name.tag.css + font-family: sans-serif +// ^^^^^^^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^^^^^^^ meta.property-list.css meta.property-value.css support.constant.font-name.css From 26c1f4cd56d1e701a07f91b8fde3d49dfa622269 Mon Sep 17 00:00:00 2001 From: isao-takejib Date: Sat, 10 Jul 2021 09:53:40 +0000 Subject: [PATCH 3/7] Add test case for class selector. --- test/tests/cassius/class-selector.cassius | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/tests/cassius/class-selector.cassius diff --git a/test/tests/cassius/class-selector.cassius b/test/tests/cassius/class-selector.cassius new file mode 100644 index 0000000..201d2ab --- /dev/null +++ b/test/tests/cassius/class-selector.cassius @@ -0,0 +1,39 @@ +// SYNTAX TEST "source.yesod.cassius" "class selector" + +*.pastoral +// <- meta.selector.css entity.name.tag.wildcard.css +// <~- meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css +// <~~~------- meta.selector.css entity.other.attribute-name.class.css + color: green +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +.pastoral +// <- meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css +// <~-------- meta.selector.css entity.other.attribute-name.class.css + color: green +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css +} + +H1.pastoral +// <-- meta.selector.css entity.name.tag.css +// <~~- meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css +// <~~~-------- meta.selector.css entity.other.attribute-name.class.css + color: green +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +p.pastoral.marine +// <- meta.selector.css entity.name.tag.css +// <~- meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css +// <~~-------- meta.selector.css entity.other.attribute-name.class.css +// <~~~~~~~~~~- meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css +// <~~~~~~~~~~~------ meta.selector.css entity.other.attribute-name.class.css + color: green +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css From f0129d244e795f4da64a886b59756b873ebd2100 Mon Sep 17 00:00:00 2001 From: isao-takejib Date: Sat, 10 Jul 2021 09:57:49 +0000 Subject: [PATCH 4/7] Add test case for id selector. --- test/tests/cassius/id-selector.cassius | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/tests/cassius/id-selector.cassius diff --git a/test/tests/cassius/id-selector.cassius b/test/tests/cassius/id-selector.cassius new file mode 100644 index 0000000..1e1e20a --- /dev/null +++ b/test/tests/cassius/id-selector.cassius @@ -0,0 +1,27 @@ +// SYNTAX TEST "source.yesod.cassius" "id selector" + +h1#chapter1 +// <-- meta.selector.css entity.name.tag.css +// <~~- meta.selector.css entity.other.attribute-name.id.css punctuation.definition.entity.css +// <~~~-------- meta.selector.css entity.other.attribute-name.id.css + color: blue +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +#chapter1 +// <- meta.selector.css entity.other.attribute-name.id.css punctuation.definition.entity.css +// <~-------- meta.selector.css entity.other.attribute-name.id.css + color: blue +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +*#z98y +// <- meta.selector.css entity.name.tag.wildcard.css +// <~- meta.selector.css entity.other.attribute-name.id.css punctuation.definition.entity.css +// <~~---- meta.selector.css entity.other.attribute-name.id.css + color: blue +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css From 2ca5c1edc972e1e4d6549548c72ed6d91aa9eb0b Mon Sep 17 00:00:00 2001 From: isao-takejib Date: Sat, 10 Jul 2021 10:23:22 +0000 Subject: [PATCH 5/7] Add test case for combinators --- test/tests/cassius/combinator.cassius | 80 +++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 test/tests/cassius/combinator.cassius diff --git a/test/tests/cassius/combinator.cassius b/test/tests/cassius/combinator.cassius new file mode 100644 index 0000000..1c5510d --- /dev/null +++ b/test/tests/cassius/combinator.cassius @@ -0,0 +1,80 @@ +// SYNTAX TEST "source.yesod.cassius" "combinators" + +h1 em +// <-- meta.selector.css entity.name.tag.css +// <~~~-- meta.selector.css entity.name.tag.css + color: red +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +div * p +// <--- meta.selector.css entity.name.tag.css +// <~~~~- meta.selector.css entity.name.tag.wildcard.css +// <~~~~~~- meta.selector.css entity.name.tag.css + color: red +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +div p *[href] +// <--- meta.selector.css entity.name.tag.css +// <~~~~- meta.selector.css entity.name.tag.css +// <~~~~~~- meta.selector.css entity.name.tag.wildcard.css +// <~~~~~~~- meta.selector.css meta.attribute-selector.css punctuation.definition.entity.begin.bracket.square.css +// <~~~~~~~~~~~~ meta.selector.css meta.attribute-selector.css entity.other.attribute-name.css +// <~~~~~~~~~~~~- meta.selector.css meta.attribute-selector.css punctuation.definition.entity.end.bracket.square.css + color: red +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +body > p +// <---- meta.selector.css entity.name.tag.css +// <~~~~~- meta.selector.css keyword.operator.combinator.css +// <~~~~~~~- meta.selector.css entity.name.tag.css + color: red +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +div ol>li p +// <--- meta.selector.css entity.name.tag.css +// <~~~~-- meta.selector.css entity.name.tag.css +// <~~~~~~- meta.selector.css keyword.operator.combinator.css +// <~~~~~~~-- meta.selector.css entity.name.tag.css +// <~~~~~~~~~~- meta.selector.css entity.name.tag.css + color: red +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css + +math + p +// <---- meta.selector.css entity.name.tag.css +// <~~~~~- meta.selector.css keyword.operator.combinator.css +// <~~~~~~~- meta.selector.css entity.name.tag.css + text-indent: 0 +// ^^^^^^^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^ meta.property-list.css meta.property-value.css constant.numeric.css + +h1.opener + h2 +// <-- meta.selector.css entity.name.tag.css +// <~~- meta.selector.css entity.other.attribute-name.class.css punctuation.definition.entity.css +// <~~~------ meta.selector.css entity.other.attribute-name.class.css +// <~~~~~~~~~~- meta.selector.css keyword.operator.combinator.css +// <~~~~~~~~~~~~-- meta.selector.css entity.name.tag.css + margin-top: -5mm +// ^^^^^^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^ meta.property-list.css meta.property-value.css constant.numeric.css +// ^^ meta.property-list.css meta.property-value.css constant.numeric.css keyword.other.unit.mm.css + +img ~ p +// <--- meta.selector.css entity.name.tag.css +// <~~~~- meta.selector.css keyword.operator.combinator.css +// <~~~~~~- meta.selector.css entity.name.tag.css + color: red +// ^^^^^ meta.property-list.css meta.property-name.css support.type.property-name.css +// ^ meta.property-list.css punctuation.separator.key-value.css +// ^^^ meta.property-list.css meta.property-value.css support.constant.color.w3c-standard-color-name.css From 411cee1263c276d72c93739ed9772f60ca9f8344 Mon Sep 17 00:00:00 2001 From: isao-takejib Date: Sun, 3 Oct 2021 18:30:14 +0900 Subject: [PATCH 6/7] Modify npm scripts for cassius. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 13abce6..7d2aaa8 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "test": "npm run test-hamlet && npm run test-lucius && npm run test-cassius && npm run test-yesodroutes", "test-hamlet": "npx vscode-tmgrammar-test -s source.yesod.hamlet -g test/resources/haskell.tmLanguage.json -g syntaxes/hamlet.tmLanguage.json -t 'test/tests/hamlet/*.hamlet'", "test-lucius": "npx vscode-tmgrammar-test -s source.yesod.lucius -g test/resources/haskell.tmLanguage.json -g syntaxes/lucius.tmLanguage.json -t 'test/tests/lucius/*.lucius'", - "test-cassius": "npx vscode-tmgrammar-test -s source.yesod.cassius -g test/resources/css.tmLanguage.json -g test/resources/haskell.tmLanguage.json -g syntaxes/cassius.tmLanguage.json -t 'test/tests/cassius/*.cassius'", + "test-cassius": "npx vscode-tmgrammar-test -s source.yesod.cassius -g test/resources/haskell.tmLanguage.json -g syntaxes/cassius.tmLanguage.json -t 'test/tests/cassius/*.cassius'", "test-yesodroutes": "npx vscode-tmgrammar-test -s source.yesod.routes -g test/resources/haskell.tmLanguage.json -g syntaxes/routes.tmLanguage.json -t 'test/tests/routes/*.yesodroutes'" }, "engines": { From aa188ed29d8b4dc8c10c582dc8cb14ab726fd3ec Mon Sep 17 00:00:00 2001 From: isao-takejib Date: Sun, 3 Oct 2021 18:32:52 +0900 Subject: [PATCH 7/7] Modify changelog for #42 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cb0df2..c9792f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ### Added +- Add basic cassius test cases (selector group, class selector, id selector, combinators) [#42](https://github.com/e-bigmoon/vscode-language-yesod/pull/42) @isao-takejib - Add Haskell Syntax Highlighting as a dependency [#54](https://github.com/e-bigmoon/vscode-language-yesod/pull/54) @isao-takejib ## [0.9.0] - 2021-10-02