diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-01-28 07:59:56 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-28 13:59:56 +0100 |
| commit | aad763de6ba7d5fbc93377d2d20cae7e374a466b (patch) | |
| tree | e621fcb307e8f779e57f34439937e43fb8696d9f /queries | |
| parent | fix(capnp): update highlights (diff) | |
| download | nvim-treesitter-aad763de6ba7d5fbc93377d2d20cae7e374a466b.tar nvim-treesitter-aad763de6ba7d5fbc93377d2d20cae7e374a466b.tar.gz nvim-treesitter-aad763de6ba7d5fbc93377d2d20cae7e374a466b.tar.bz2 nvim-treesitter-aad763de6ba7d5fbc93377d2d20cae7e374a466b.tar.lz nvim-treesitter-aad763de6ba7d5fbc93377d2d20cae7e374a466b.tar.xz nvim-treesitter-aad763de6ba7d5fbc93377d2d20cae7e374a466b.tar.zst nvim-treesitter-aad763de6ba7d5fbc93377d2d20cae7e374a466b.zip | |
feat: add kdl (#4227)
* feat: add kdl
* feat: comment queries
* fix(kdl): comments properly highlighted now
* feat(kdl): folds
* chore: bump revision to feature-complete parser
* fix: folds
Diffstat (limited to 'queries')
| -rw-r--r-- | queries/kdl/folds.scm | 3 | ||||
| -rw-r--r-- | queries/kdl/highlights.scm | 55 |
2 files changed, 58 insertions, 0 deletions
diff --git a/queries/kdl/folds.scm b/queries/kdl/folds.scm new file mode 100644 index 000000000..04a2ba28e --- /dev/null +++ b/queries/kdl/folds.scm @@ -0,0 +1,3 @@ +; Folds + +(node_children) @fold diff --git a/queries/kdl/highlights.scm b/queries/kdl/highlights.scm new file mode 100644 index 000000000..0ef693d5a --- /dev/null +++ b/queries/kdl/highlights.scm @@ -0,0 +1,55 @@ +; Types + +(node (identifier) @type) + +(type) @type + +(annotation_type) @type.builtin + +; Properties + +(prop (identifier) @property) + +; Variables + +(identifier) @variable + +; Operators +[ + "=" + "+" + "-" +] @operator + +; Literals + +(string) @string + +(escape) @string.escape + +(number) @number + +(number (decimal) @float) +(number (exponent) @float) +(number (decimal) (exponent) @float) + +(boolean) @boolean + +; Misc + +"null" @constant.builtin + +["{" "}"] @punctuation.bracket + +["(" ")"] @punctuation.bracket + +; Comments + +[ + (single_line_comment) + (multi_line_comment) +] @comment + +(node (node_comment) (#set! "priority" 105)) @comment +(node (node_field (node_field_comment) (#set! "priority" 105)) @comment) +(node_children (node_children_comment) (#set! "priority" 105)) @comment |
