Skip to content

Commit

Permalink
Add gherkin syntax highlighting (helix-editor#11083)
Browse files Browse the repository at this point in the history
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
  • Loading branch information
SamyAB and archseer authored Aug 9, 2024
1 parent e604d9f commit 91e642c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
| gas ||| | |
| gdscript |||| |
| gemini || | | |
| gherkin || | | |
| git-attributes || | | |
| git-commit ||| | |
| git-config || | | |
Expand Down
14 changes: 12 additions & 2 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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" }
17 changes: 17 additions & 0 deletions runtime/queries/gherkin/highlights.scm
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 91e642c

Please sign in to comment.