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:
cgahr 2023-11-03 22:21:54 +01:00 committed by GitHub
parent 70bbbd7d19
commit 5c325fe342
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 7 deletions

View File

@ -81,7 +81,7 @@
| jsx | ✓ | ✓ | ✓ | `typescript-language-server` | | jsx | ✓ | ✓ | ✓ | `typescript-language-server` |
| julia | ✓ | ✓ | ✓ | `julia` | | julia | ✓ | ✓ | ✓ | `julia` |
| just | ✓ | ✓ | ✓ | | | just | ✓ | ✓ | ✓ | |
| kdl | ✓ | | | | | kdl | ✓ | | | |
| kotlin | ✓ | | | `kotlin-language-server` | | kotlin | ✓ | | | `kotlin-language-server` |
| latex | ✓ | ✓ | | `texlab` | | latex | ✓ | ✓ | | `texlab` |
| lean | ✓ | | | `lean` | | lean | ✓ | | | `lean` |

View File

@ -2340,7 +2340,7 @@ injection-regex = "kdl"
[[grammar]] [[grammar]]
name = "kdl" 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]] [[language]]
name = "xml" name = "xml"

View File

@ -1,12 +1,12 @@
(comment) @comment
(single_line_comment) @comment (single_line_comment) @comment
(multi_line_comment) @comment
(node (node
name: (identifier) @function) (identifier) @variable)
(prop (identifier) @attribute)
(type) @type
(bare_identifier) @variable.other.member (prop (identifier) @attribute)
(type (_) @type) @punctuation.bracket
(keyword) @keyword (keyword) @keyword

View File

@ -0,0 +1,3 @@
(node_children) @indent
"}" @outdent

View 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