From 91e642ce50b0e8983daa2376accff61588f81df8 Mon Sep 17 00:00:00 2001 From: Samy AB Date: Sat, 10 Aug 2024 01:25:31 +0200 Subject: [PATCH] Add gherkin syntax highlighting (#11083) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Blaž Hrastnik --- book/src/generated/lang-support.md | 1 + languages.toml | 14 ++++++++++++-- runtime/queries/gherkin/highlights.scm | 17 +++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 runtime/queries/gherkin/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 4b0bca38c..4ce9edb9d 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -58,6 +58,7 @@ | gas | ✓ | ✓ | | | | gdscript | ✓ | ✓ | ✓ | | | gemini | ✓ | | | | +| gherkin | ✓ | | | | | git-attributes | ✓ | | | | | git-commit | ✓ | ✓ | | | | git-config | ✓ | | | | diff --git a/languages.toml b/languages.toml index d72512592..12b0ad049 100644 --- a/languages.toml +++ b/languages.toml @@ -3764,6 +3764,17 @@ grammar = "typescript" "(" = ")" '"' = '"' +[[language]] +name = "gherkin" +scope = "source.feature" +file-types = ["feature"] +comment-token = "#" +indent = { tab-width = 2, unit = " " } + +[[grammar]] +name = "gherkin" +source = { git = "https://github.com/SamyAB/tree-sitter-gherkin", rev = "43873ee8de16476635b48d52c46f5b6407cb5c09" } + [[language]] name = "thrift" scope = "source.thrift" @@ -3774,5 +3785,4 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "thrift" -source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-thrift" , rev = "68fd0d80943a828d9e6f49c58a74be1e9ca142cf" } - +source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-thrift" , rev = "68fd0d80943a828d9e6f49c58a74be1e9ca142cf" } \ No newline at end of file diff --git a/runtime/queries/gherkin/highlights.scm b/runtime/queries/gherkin/highlights.scm new file mode 100644 index 000000000..1a17e3819 --- /dev/null +++ b/runtime/queries/gherkin/highlights.scm @@ -0,0 +1,17 @@ +[ + (feature_keyword) + (rule_keyword) + (background_keyword) + (scenario_keyword) + (given_keyword) + (when_keyword) + (then_keyword) + (and_keyword) + (but_keyword) + (asterisk_keyword) +] @keyword + +(tag) @function +(doc_string) @string +(data_table) @special +(comment) @comment