Skip to content

Commit

Permalink
feat(lang): add kdl grammar (#4481)
Browse files Browse the repository at this point in the history
  • Loading branch information
greym0uth authored Oct 29, 2022
1 parent 5e256e4 commit b5e7501
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 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 @@ -60,6 +60,7 @@
| jsonnet || | | `jsonnet-language-server` |
| jsx |||| `typescript-language-server` |
| julia || | | `julia` |
| kdl || | | |
| kotlin || | | `kotlin-language-server` |
| latex ||| | `texlab` |
| lean || | | `lean` |
Expand Down
12 changes: 12 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1885,3 +1885,15 @@ grammar = "vhs"
[[grammar]]
name = "vhs"
source = { git = "https://github.com/charmbracelet/tree-sitter-vhs", rev = "c6d81f34c011c29ee86dd73b45a8ecc9f2e2bdaf" }

[[language]]
name = "kdl"
scope = "source.kdl"
file-types = ["kdl"]
roots = []
comment-token = "//"
injection-regex = "kdl"

[[grammar]]
name = "kdl"
source = { git = "https://github.com/Unoqwy/tree-sitter-kdl", rev = "e1cd292c6d15df6610484e1d4b5c987ecad52373" }
22 changes: 22 additions & 0 deletions runtime/queries/kdl/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(comment) @comment
(single_line_comment) @comment

(node
name: (identifier) @function)
(prop (identifier) @attribute)
(type) @type

(bare_identifier) @variable.other.member

(keyword) @keyword

(string) @string
(number) @constant.numeric
(boolean) @constant.builtin.boolean

"." @punctuation.delimiter

"=" @operator

"{" @punctuation.bracket
"}" @punctuation.bracket

0 comments on commit b5e7501

Please sign in to comment.