fix(kdl): highlight query order (#7688)

This just fixes the highlighting queries so everything
isn't highlighted as a variable due to the order of the queries
meaning several queries were ignored.

I also changed the node names to be highlighted as `@tag` since KDL is an
xml-like format so `@tag` seemed more appropriate than type and it differentiates it
from the type annotations.

This does NOT update to the latest KDL version 2, that would need
grammar changes. It does "mostly" work with
KDL 2 though (notably unquoted strings seem to throw the grammar off.).
This commit is contained in:
Paul Hansen 2025-02-27 02:53:58 -06:00 committed by GitHub
parent 00e797ea25
commit 28f76678ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,18 +1,19 @@
; Types
; Variables
(identifier) @variable
; Nodes
(node
(identifier) @tag)
; Type annotation
(type
(identifier) @type)
(type) @type
(annotation_type) @type.builtin
; Properties
(prop
(identifier) @property)
; Variables
(identifier) @variable
; Operators
[
"="