feat: improve KDL queries

This commit is contained in:
Amaan Qureshi 2023-02-05 21:28:27 -05:00 committed by Stephan Seitz
parent 24d5be6e71
commit c3a7dd4768
8 changed files with 30 additions and 5 deletions

View file

@ -1,3 +1,8 @@
; Folds
(node_children) @fold
[
(node)
(node_children)
(string)
(multi_line_comment)
] @fold

View file

@ -48,7 +48,7 @@
[
(single_line_comment)
(multi_line_comment)
] @comment
] @comment @spell
(node (node_comment) (#set! "priority" 105)) @comment
(node (node_field (node_field_comment) (#set! "priority" 105)) @comment)

7
queries/kdl/indents.scm Normal file
View file

@ -0,0 +1,7 @@
(node (node_children) @indent)
"}" @indent_end
[ "{" "}" ] @branch
[ "(" ")" ] @branch

View file

@ -0,0 +1,4 @@
[
(single_line_comment)
(multi_line_comment)
] @comment

10
queries/kdl/locals.scm Normal file
View file

@ -0,0 +1,10 @@
(document) @scope
(node (node_children) @scope)
(node_children (node) @scope)
(identifier) @reference
(node_field) @definition.field
(node (identifier) @definition.type)
(type) @definition.type