From 3e88e394801778ea05b25df1935fcbcdb12a30d1 Mon Sep 17 00:00:00 2001 From: isao-takejib Date: Wed, 19 Aug 2020 10:29:15 +0000 Subject: [PATCH 1/9] conditionals testcase --- test/tests/hamlet/conditionals.hamlet | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/tests/hamlet/conditionals.hamlet diff --git a/test/tests/hamlet/conditionals.hamlet b/test/tests/hamlet/conditionals.hamlet new file mode 100644 index 0000000..c3da4c1 --- /dev/null +++ b/test/tests/hamlet/conditionals.hamlet @@ -0,0 +1,16 @@ +$# SYNTAX TEST "source.yesod.hamlet" "conditionals" +$if isAdmin +$# <- keyword.control.hamlet +$# ^ keyword.control.hamlet +

Welcome to the admin section. +$# ^^^ meta.embedded.line.hamlet +$elseif isLoggedIn +$# <- keyword.control.hamlet +$#^^^^^ keyword.control.hamlet +

You are not the administrator. +$# ^^^ meta.embedded.line.hamlet +$else +$# <- keyword.control.hamlet +$#^^^ keyword.control.hamlet +

I don't know who you are. Please log in so I can decide if you get access. +$# ^^^ meta.embedded.line.hamlet From 6dc12aeb1fdb59990d94cf7396c4e8c658c3afa7 Mon Sep 17 00:00:00 2001 From: isao-takejib Date: Wed, 19 Aug 2020 10:34:09 +0000 Subject: [PATCH 2/9] Add interpolation testcase --- test/tests/hamlet/interpolation.hamlet | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/tests/hamlet/interpolation.hamlet diff --git a/test/tests/hamlet/interpolation.hamlet b/test/tests/hamlet/interpolation.hamlet new file mode 100644 index 0000000..4592f1e --- /dev/null +++ b/test/tests/hamlet/interpolation.hamlet @@ -0,0 +1,9 @@ +$# SYNTAX TEST "source.yesod.hamlet" "interpolation" + +$# <- meta.embedded.line.hamlet +$# ^ meta.embedded.line.hamlet + #{title} +$# ^^^^^^^ meta.embedded.line.hamlet +$# ^^ punctuation.section.embedded.begin.hamlet +$# ^^^^^ source.haskell +$# ^ punctuation.section.embedded.end.hamlet From 23786b8cd5988e659d00e0fa152a0d017f808cd4 Mon Sep 17 00:00:00 2001 From: isao-takejib <isao.takeji.bigmoon@gmail.com> Date: Sat, 20 Mar 2021 10:39:19 +0000 Subject: [PATCH 3/9] Add conditiona testcase for hamlet --- test/tests/hamlet/conditionals.hamlet | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/test/tests/hamlet/conditionals.hamlet b/test/tests/hamlet/conditionals.hamlet index c3da4c1..771d801 100644 --- a/test/tests/hamlet/conditionals.hamlet +++ b/test/tests/hamlet/conditionals.hamlet @@ -1,16 +1,13 @@ $# SYNTAX TEST "source.yesod.hamlet" "conditionals" $if isAdmin -$# <- keyword.control.hamlet -$# ^ keyword.control.hamlet +$# <--- keyword.control.hamlet +$# ^ - keyword.control.hamlet <p>Welcome to the admin section. -$# ^^^ meta.embedded.line.hamlet $elseif isLoggedIn -$# <- keyword.control.hamlet -$#^^^^^ keyword.control.hamlet +$# <------- keyword.control.hamlet +$# ^ - keyword.control.hamlet <p>You are not the administrator. -$# ^^^ meta.embedded.line.hamlet $else -$# <- keyword.control.hamlet -$#^^^ keyword.control.hamlet +$# <---- keyword.control.hamlet +$# ^ - keyword.control.hamlet <p>I don't know who you are. Please log in so I can decide if you get access. -$# ^^^ meta.embedded.line.hamlet From cba67699a1efa6ba2d7f0879191f4ee92a90881c Mon Sep 17 00:00:00 2001 From: isao-takejib <isao.takeji.bigmoon@gmail.com> Date: Sat, 10 Apr 2021 06:05:41 +0000 Subject: [PATCH 4/9] Modify interpolation case --- test/tests/hamlet/interpolation.hamlet | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/tests/hamlet/interpolation.hamlet b/test/tests/hamlet/interpolation.hamlet index 4592f1e..948f7ac 100644 --- a/test/tests/hamlet/interpolation.hamlet +++ b/test/tests/hamlet/interpolation.hamlet @@ -1,7 +1,6 @@ $# SYNTAX TEST "source.yesod.hamlet" "interpolation" <head> -$# <- meta.embedded.line.hamlet -$# ^ meta.embedded.line.hamlet +$# <------ meta.embedded.line.hamlet <title>#{title} $# ^^^^^^^ meta.embedded.line.hamlet $# ^^ punctuation.section.embedded.begin.hamlet From d6b10f30fb54d9b0c7184e2e0bac4c901213b4e5 Mon Sep 17 00:00:00 2001 From: isao-takejib <isao.takeji.bigmoon@gmail.com> Date: Sat, 19 Jun 2021 05:03:03 +0000 Subject: [PATCH 5/9] Modify test (conditionals case) --- syntaxes/hamlet.tmLanguage.json | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/syntaxes/hamlet.tmLanguage.json b/syntaxes/hamlet.tmLanguage.json index b6b7bc2..98850a7 100644 --- a/syntaxes/hamlet.tmLanguage.json +++ b/syntaxes/hamlet.tmLanguage.json @@ -47,13 +47,18 @@ "keyword": { "patterns": [ { - "match": "\\$(else|nothing|doctype|newline)\\s+", - "name": "keyword.control.hamlet" + "match": "(\\$(else|nothing|doctype|newline))\\s+", + "captures": { + "1": { + "name": "keyword.control.hamlet" + } + }, + "name": "meta.interpolation.hamlet" }, { - "begin": "\\$(if|elseif|maybe|forall|case|of|with)\\s+", + "begin": "(\\$(if|elseif|maybe|forall|case|of|with))\\s+", "beginCaptures": { - "0": { + "1": { "name": "keyword.control.hamlet" } }, From 5b26141cec6f9376f03eba94a7d6b7b2d1b41c0a Mon Sep 17 00:00:00 2001 From: isao-takejib <isao.takeji.bigmoon@gmail.com> Date: Sat, 19 Jun 2021 05:03:23 +0000 Subject: [PATCH 6/9] Modified test (conditional case) --- test/tests/hamlet/conditionals.hamlet | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/tests/hamlet/conditionals.hamlet b/test/tests/hamlet/conditionals.hamlet index 771d801..6302b9a 100644 --- a/test/tests/hamlet/conditionals.hamlet +++ b/test/tests/hamlet/conditionals.hamlet @@ -1,13 +1,22 @@ $# SYNTAX TEST "source.yesod.hamlet" "conditionals" $if isAdmin -$# <--- keyword.control.hamlet +$# <--- meta.interpolation.hamlet keyword.control.hamlet $# ^ - keyword.control.hamlet <p>Welcome to the admin section. +$# ^ meta.tag.hamlet punctuation.definition.tag.begin.hamlet +$# ^ meta.tag.hamlet entity.name.tag.hamlet +$# ^ meta.tag.hamlet punctuation.definition.tag.end.hamlet $elseif isLoggedIn -$# <------- keyword.control.hamlet +$# <------- meta.interpolation.hamlet keyword.control.hamlet $# ^ - keyword.control.hamlet <p>You are not the administrator. +$# ^ meta.tag.hamlet punctuation.definition.tag.begin.hamlet +$# ^ meta.tag.hamlet entity.name.tag.hamlet +$# ^ meta.tag.hamlet punctuation.definition.tag.end.hamlet $else -$# <---- keyword.control.hamlet +$# <---- meta.interpolation.hamlet keyword.control.hamlet $# ^ - keyword.control.hamlet <p>I don't know who you are. Please log in so I can decide if you get access. +$# ^ meta.tag.hamlet punctuation.definition.tag.begin.hamlet +$# ^ meta.tag.hamlet entity.name.tag.hamlet +$# ^ meta.tag.hamlet punctuation.definition.tag.end.hamlet From 10156e59ea6278330b31029653f4a3bf8f463421 Mon Sep 17 00:00:00 2001 From: isao-takejib <isao.takeji.bigmoon@gmail.com> Date: Sat, 19 Jun 2021 05:16:06 +0000 Subject: [PATCH 7/9] Modifed conditional case. --- test/tests/hamlet/conditionals.hamlet | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/tests/hamlet/conditionals.hamlet b/test/tests/hamlet/conditionals.hamlet index 6302b9a..561c265 100644 --- a/test/tests/hamlet/conditionals.hamlet +++ b/test/tests/hamlet/conditionals.hamlet @@ -2,6 +2,7 @@ $# SYNTAX TEST "source.yesod.hamlet" "conditionals" $if isAdmin $# <--- meta.interpolation.hamlet keyword.control.hamlet $# ^ - keyword.control.hamlet +$# ^^^^^^^ meta.interpolation.hamlet source.haskell.embedded <p>Welcome to the admin section. $# ^ meta.tag.hamlet punctuation.definition.tag.begin.hamlet $# ^ meta.tag.hamlet entity.name.tag.hamlet @@ -9,6 +10,7 @@ $# ^ meta.tag.hamlet punctuation.definition.tag.end.hamlet $elseif isLoggedIn $# <------- meta.interpolation.hamlet keyword.control.hamlet $# ^ - keyword.control.hamlet +$# ^^^^^^^^^^ meta.interpolation.hamlet source.haskell.embedded <p>You are not the administrator. $# ^ meta.tag.hamlet punctuation.definition.tag.begin.hamlet $# ^ meta.tag.hamlet entity.name.tag.hamlet From a8eb2660e8ff236d65540d5829aceb2efd87c208 Mon Sep 17 00:00:00 2001 From: isao-takejib <isao.takeji.bigmoon@gmail.com> Date: Sat, 19 Jun 2021 05:20:45 +0000 Subject: [PATCH 8/9] Modified test (interpolation case). --- test/tests/hamlet/interpolation.hamlet | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/tests/hamlet/interpolation.hamlet b/test/tests/hamlet/interpolation.hamlet index 948f7ac..7d6663a 100644 --- a/test/tests/hamlet/interpolation.hamlet +++ b/test/tests/hamlet/interpolation.hamlet @@ -1,8 +1,12 @@ $# SYNTAX TEST "source.yesod.hamlet" "interpolation" <head> -$# <------ meta.embedded.line.hamlet +$# <- meta.tag.hamlet punctuation.definition.tag.begin.hamlet +$# <~---- meta.tag.hamlet entity.name.tag.hamlet +$# ^ meta.tag.hamlet punctuation.definition.tag.end.hamlet <title>#{title} -$# ^^^^^^^ meta.embedded.line.hamlet -$# ^^ punctuation.section.embedded.begin.hamlet -$# ^^^^^ source.haskell -$# ^ punctuation.section.embedded.end.hamlet +$# ^ meta.tag.hamlet punctuation.definition.tag.begin.hamlet +$# ^^^^^ meta.tag.hamlet entity.name.tag.hamlet +$# ^ meta.tag.hamlet punctuation.definition.tag.end.hamlet +$# ^^ meta.interpolation.hamlet punctuation.section.interpolation.begin.hamlet +$# ^^^^^ meta.interpolation.hamlet source.haskell.embedded +$# ^ meta.interpolation.hamlet punctuation.section.interpolation.end.hamlet \ No newline at end of file From 38961076d7b3ebb91daf5a5ab70564e4236f7fed Mon Sep 17 00:00:00 2001 From: isao-takejib <isao.takeji.bigmoon@gmail.com> Date: Sat, 19 Jun 2021 05:24:21 +0000 Subject: [PATCH 9/9] Added #25 changes to changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 737a894..0cacaa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ### Changed +- Fix existing test cases for hamlet and add Hamlet testcases (interpolation and conditional) [#25](https://github.com/e-bigmoon/vscode-language-yesod/pull/25) @isao-takejib - Changed to also use Haskell syntax files for testing [#38](https://github.com/e-bigmoon/vscode-language-yesod/pull/38) @isao-takejib - Add a badge for github actions [#36](https://github.com/e-bigmoon/vscode-language-yesod/pull/36) @isao-takejib - Fixing test cases [#35](https://github.com/e-bigmoon/vscode-language-yesod/pull/35) @isao-takejib