From 28f76678cae8d474cdaec0738e8ff733b14fdeb8 Mon Sep 17 00:00:00 2001 From: Paul Hansen Date: Thu, 27 Feb 2025 02:53:58 -0600 Subject: 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.). --- queries/kdl/highlights.scm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/queries/kdl/highlights.scm b/queries/kdl/highlights.scm index e61361f96..7d200c85e 100644 --- a/queries/kdl/highlights.scm +++ b/queries/kdl/highlights.scm @@ -1,18 +1,19 @@ ; Types -(node - (identifier) @type) +; Variables +(identifier) @variable -(type) @type +; Nodes +(node + (identifier) @tag) -(annotation_type) @type.builtin +; Type annotation +(type + (identifier) @type) ; Properties (prop (identifier) @property) -; Variables -(identifier) @variable - ; Operators [ "=" -- cgit v1.2.3-70-g09d2