aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Hansen <mail@paul.rs>2025-02-27 02:53:58 -0600
committerGitHub <noreply@github.com>2025-02-27 09:53:58 +0100
commit28f76678cae8d474cdaec0738e8ff733b14fdeb8 (patch)
tree73893704878fbbaa5ba6622d38125978ce909600
parentfeat(typescript): highlight abstract methods (diff)
downloadnvim-treesitter-28f76678cae8d474cdaec0738e8ff733b14fdeb8.tar
nvim-treesitter-28f76678cae8d474cdaec0738e8ff733b14fdeb8.tar.gz
nvim-treesitter-28f76678cae8d474cdaec0738e8ff733b14fdeb8.tar.bz2
nvim-treesitter-28f76678cae8d474cdaec0738e8ff733b14fdeb8.tar.lz
nvim-treesitter-28f76678cae8d474cdaec0738e8ff733b14fdeb8.tar.xz
nvim-treesitter-28f76678cae8d474cdaec0738e8ff733b14fdeb8.tar.zst
nvim-treesitter-28f76678cae8d474cdaec0738e8ff733b14fdeb8.zip
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.).
-rw-r--r--queries/kdl/highlights.scm15
1 files 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
[
"="