on master help sign in
feat(lang): add kdl grammar (#4481)
commitb5e7501935472f4e68bf42ac9759d54688ccb5e6 authorJaden <thejadenjack@gmail.com> dateSat 29 Oct 2022, 08:33 (4 years ago) parent5e256e4
3 files changed+35
book/src/generated/lang-support.md+1 languages.toml+12 runtime/queries/kdl/highlights.scm+22
book/src/generated/lang-support.md+1
@@ -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+12
@@ -1885,3 +1885,15 @@ grammar = "vhs"
18851885[[grammar]]
18861886name = "vhs"
18871887source = { 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.scmnew file+22
@@ -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