mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 01:16:18 +04:00
replace kdl tree-sitter to fix highlighting (#8652)
* replace kdl tree-sitter * kdl: adopt highlights for new tree-sitter * kdl: add indent queries * kdl: add textobjects * kdl: improve syntax highlighting * kdl: update lang-support * kdl: make indents more concise --------- Co-authored-by: Constantin Gahr <constantin.gahr@ipp.mpg.de>
This commit is contained in:
parent
70bbbd7d19
commit
5c325fe342
@ -81,7 +81,7 @@
|
||||
| jsx | ✓ | ✓ | ✓ | `typescript-language-server` |
|
||||
| julia | ✓ | ✓ | ✓ | `julia` |
|
||||
| just | ✓ | ✓ | ✓ | |
|
||||
| kdl | ✓ | | | |
|
||||
| kdl | ✓ | ✓ | ✓ | |
|
||||
| kotlin | ✓ | | | `kotlin-language-server` |
|
||||
| latex | ✓ | ✓ | | `texlab` |
|
||||
| lean | ✓ | | | `lean` |
|
||||
|
@ -2340,7 +2340,7 @@ injection-regex = "kdl"
|
||||
|
||||
[[grammar]]
|
||||
name = "kdl"
|
||||
source = { git = "https://github.com/Unoqwy/tree-sitter-kdl", rev = "e1cd292c6d15df6610484e1d4b5c987ecad52373" }
|
||||
source = { git = "https://github.com/amaanq/tree-sitter-kdl", rev = "3ca569b9f9af43593c24f9e7a21f02f43a13bb88" }
|
||||
|
||||
[[language]]
|
||||
name = "xml"
|
||||
|
@ -1,12 +1,12 @@
|
||||
(comment) @comment
|
||||
(single_line_comment) @comment
|
||||
(multi_line_comment) @comment
|
||||
|
||||
(node
|
||||
name: (identifier) @function)
|
||||
(prop (identifier) @attribute)
|
||||
(type) @type
|
||||
(identifier) @variable)
|
||||
|
||||
(bare_identifier) @variable.other.member
|
||||
(prop (identifier) @attribute)
|
||||
|
||||
(type (_) @type) @punctuation.bracket
|
||||
|
||||
(keyword) @keyword
|
||||
|
||||
|
3
runtime/queries/kdl/indents.scm
Normal file
3
runtime/queries/kdl/indents.scm
Normal file
@ -0,0 +1,3 @@
|
||||
(node_children) @indent
|
||||
|
||||
"}" @outdent
|
27
runtime/queries/kdl/textobjects.scm
Normal file
27
runtime/queries/kdl/textobjects.scm
Normal file
@ -0,0 +1,27 @@
|
||||
(type (_) @test.inside) @test.around
|
||||
|
||||
(node
|
||||
children: (node_children)? @class.inside) @class.around
|
||||
|
||||
(node
|
||||
children: (node_children)? @function.inside) @function.around
|
||||
|
||||
(node (identifier) @function.movement)
|
||||
|
||||
[
|
||||
(single_line_comment)
|
||||
(multi_line_comment)
|
||||
] @comment.inside
|
||||
|
||||
[
|
||||
(single_line_comment)+
|
||||
(multi_line_comment)+
|
||||
] @comment.around
|
||||
|
||||
[
|
||||
(prop)
|
||||
(value)
|
||||
] @parameter.inside
|
||||
|
||||
(value (type) ? (_) @parameter.inside @parameter.movement . ) @parameter.around
|
||||
|
Loading…
Reference in New Issue
Block a user