From 6e44a6a289c538c9e05a5114ddb7f91f581e8965 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 19 Nov 2024 09:46:55 +0100 Subject: fix(treesitter): update queries --- runtime/queries/c/highlights.scm | 13 +++++++++++-- runtime/queries/lua/highlights.scm | 2 -- runtime/queries/markdown_inline/highlights.scm | 13 ++++--------- runtime/queries/query/highlights.scm | 2 +- runtime/queries/vim/highlights.scm | 1 + 5 files changed, 17 insertions(+), 14 deletions(-) (limited to 'runtime/queries') diff --git a/runtime/queries/c/highlights.scm b/runtime/queries/c/highlights.scm index eba272d5c9..bd6857fd17 100644 --- a/runtime/queries/c/highlights.scm +++ b/runtime/queries/c/highlights.scm @@ -252,13 +252,22 @@ ; Preproc def / undef (preproc_def - name: (_) @constant) + name: (_) @constant.macro) (preproc_call directive: (preproc_directive) @_u - argument: (_) @constant + argument: (_) @constant.macro (#eq? @_u "#undef")) +(preproc_ifdef + name: (identifier) @constant.macro) + +(preproc_elifdef + name: (identifier) @constant.macro) + +(preproc_defined + (identifier) @constant.macro) + (call_expression function: (identifier) @function.call) diff --git a/runtime/queries/lua/highlights.scm b/runtime/queries/lua/highlights.scm index 01c280f2d5..79ab165aa7 100644 --- a/runtime/queries/lua/highlights.scm +++ b/runtime/queries/lua/highlights.scm @@ -151,8 +151,6 @@ ((identifier) @constant (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) -(vararg_expression) @constant - (nil) @constant.builtin [ diff --git a/runtime/queries/markdown_inline/highlights.scm b/runtime/queries/markdown_inline/highlights.scm index 148ef0fad0..5fb9e911dd 100644 --- a/runtime/queries/markdown_inline/highlights.scm +++ b/runtime/queries/markdown_inline/highlights.scm @@ -40,14 +40,12 @@ (image_description) ] @markup.link.label -(inline_link - (link_text) @_label - (link_destination) @_url +((inline_link + (link_destination) @_url) @_label (#set! @_label url @_url)) -(image - (image_description) @_label - (link_destination) @_url +((image + (link_destination) @_url) @_label (#set! @_label url @_url)) ; Conceal image links @@ -93,9 +91,6 @@ (email_autolink) ] @markup.link.url @nospell -((link_destination) @_url - (#set! @_url url @_url)) - ((uri_autolink) @_url (#offset! @_url 0 1 0 -1) (#set! @_url url @_url)) diff --git a/runtime/queries/query/highlights.scm b/runtime/queries/query/highlights.scm index e459b44602..f839ec985c 100644 --- a/runtime/queries/query/highlights.scm +++ b/runtime/queries/query/highlights.scm @@ -43,7 +43,7 @@ "#" ] @punctuation.special -"_" @constant +"_" @character.special ((parameters (identifier) @number) diff --git a/runtime/queries/vim/highlights.scm b/runtime/queries/vim/highlights.scm index 14e5a8128f..df7b3cf483 100644 --- a/runtime/queries/vim/highlights.scm +++ b/runtime/queries/vim/highlights.scm @@ -287,6 +287,7 @@ "=~" "!~" "=" + "^=" "+=" "-=" "*=" -- cgit From 1103d9fc10d8ffac7e375c3aa9d1bdfe16691776 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Tue, 4 Feb 2025 00:56:11 -0800 Subject: build(deps): bump tree-sitter-query to v0.5.0 (#32299) and sync queries from nvim-treesitter (adds support for `MISSING` nodes). --- runtime/queries/query/highlights.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'runtime/queries') diff --git a/runtime/queries/query/highlights.scm b/runtime/queries/query/highlights.scm index f839ec985c..cbd192a8ff 100644 --- a/runtime/queries/query/highlights.scm +++ b/runtime/queries/query/highlights.scm @@ -11,6 +11,9 @@ (named_node name: (identifier) @variable) +(missing_node + name: (identifier) @variable) + (field_definition name: (identifier) @variable.member) @@ -43,8 +46,13 @@ "#" ] @punctuation.special +(predicate + "." @punctuation.special) + "_" @character.special +"MISSING" @keyword + ((parameters (identifier) @number) (#match? @number "^[-+]?[0-9]+(.[0-9]+)?$")) -- cgit