Skip to content

Commit 82d318b

Browse files
greym0uthShekhinah Memmel
authored andcommitted
feat(lang): add kdl grammar (helix-editor#4481)
1 parent dae9e12 commit 82d318b

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

book/src/generated/lang-support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
| jsonnet || | | `jsonnet-language-server` |
6161
| jsx |||| `typescript-language-server` |
6262
| julia || | | `julia` |
63+
| kdl || | | |
6364
| kotlin || | | `kotlin-language-server` |
6465
| latex ||| | `texlab` |
6566
| lean || | | `lean` |

languages.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,3 +1885,15 @@ grammar = "vhs"
18851885
[[grammar]]
18861886
name = "vhs"
18871887
source = { git = "https://github.com/charmbracelet/tree-sitter-vhs", rev = "c6d81f34c011c29ee86dd73b45a8ecc9f2e2bdaf" }
1888+
1889+
[[language]]
1890+
name = "kdl"
1891+
scope = "source.kdl"
1892+
file-types = ["kdl"]
1893+
roots = []
1894+
comment-token = "//"
1895+
injection-regex = "kdl"
1896+
1897+
[[grammar]]
1898+
name = "kdl"
1899+
source = { git = "https://github.com/Unoqwy/tree-sitter-kdl", rev = "e1cd292c6d15df6610484e1d4b5c987ecad52373" }

runtime/queries/kdl/highlights.scm

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(comment) @comment
2+
(single_line_comment) @comment
3+
4+
(node
5+
name: (identifier) @function)
6+
(prop (identifier) @attribute)
7+
(type) @type
8+
9+
(bare_identifier) @variable.other.member
10+
11+
(keyword) @keyword
12+
13+
(string) @string
14+
(number) @constant.numeric
15+
(boolean) @constant.builtin.boolean
16+
17+
"." @punctuation.delimiter
18+
19+
"=" @operator
20+
21+
"{" @punctuation.bracket
22+
"}" @punctuation.bracket

0 commit comments

Comments
 (0)