fix(treesitter): update queries

This commit is contained in:
Christian Clason 2024-05-05 12:57:36 +02:00
parent 97b7ddc376
commit 3d4eb9d544
8 changed files with 65 additions and 26 deletions

View File

@ -228,5 +228,5 @@
((program
.
(comment) @keyword.directive)
(comment) @keyword.directive @nospell)
(#lua-match? @keyword.directive "^#!/"))

View File

@ -16,6 +16,7 @@
(preproc_function_def)
(initializer_list)
(gnu_asm_expression)
(preproc_include)+
] @fold
(compound_statement

View File

@ -7,15 +7,18 @@
[
"default"
"enum"
"struct"
"typedef"
"union"
"goto"
"asm"
"__asm__"
] @keyword
[
"enum"
"struct"
"union"
"typedef"
] @keyword.type
[
"sizeof"
"offsetof"

View File

@ -33,10 +33,17 @@
] @markup.link
(#set! conceal ""))
[
(link_label)
(link_text)
(link_title)
(image_description)
] @markup.link.label
(inline_link
(link_text) @markup.link.label
(link_destination) @markup.link
(#set! @markup.link.label "url" @markup.link))
(link_text) @_label
(link_destination) @_url
(#set! @_label "url" @_url))
; Conceal image links
(image
@ -80,13 +87,6 @@
(uri_autolink)
] @markup.link.url @nospell
[
(link_label)
(link_text)
(link_title)
(image_description)
] @markup.link.label
; Replace common HTML entities.
((entity_reference) @character.special
(#eq? @character.special " ")

View File

@ -21,3 +21,8 @@
(dictionary)
(string)
] @fold
[
(import_statement)
(import_from_statement)
]+ @fold

View File

@ -188,7 +188,7 @@
((module
.
(comment) @keyword.directive)
(comment) @keyword.directive @nospell)
(#lua-match? @keyword.directive "^#!/"))
(string) @string
@ -204,19 +204,41 @@
(comment)*
.
(expression_statement
(string) @string.documentation @spell))
(string) @string.documentation))
(class_definition
body: (block
.
(expression_statement
(string) @string.documentation @spell)))
(string) @string.documentation)))
(function_definition
body: (block
.
(expression_statement
(string) @string.documentation @spell)))
(string) @string.documentation)))
(module
.
(comment)*
.
(expression_statement
(string
(string_content) @spell)))
(class_definition
body: (block
.
(expression_statement
(string
(string_content) @spell))))
(function_definition
body: (block
.
(expression_statement
(string
(string_content) @spell))))
; Tokens
[
@ -278,7 +300,6 @@
[
"assert"
"class"
"exec"
"global"
"nonlocal"
@ -286,9 +307,13 @@
"print"
"with"
"as"
"type"
] @keyword
[
"type"
"class"
] @keyword.type
[
"async"
"await"

View File

@ -53,17 +53,17 @@
.
(comment)*
.
(comment) @keyword.import)
(comment) @keyword.import @nospell)
(#lua-match? @keyword.import "^;+ *inherits *:"))
((program
.
(comment)*
.
(comment) @keyword.directive)
(comment) @keyword.directive @nospell)
(#lua-match? @keyword.directive "^;+ *extends *$"))
((comment) @keyword.directive
((comment) @keyword.directive @nospell
(#lua-match? @keyword.directive "^;+%s*format%-ignore%s*$"))
((predicate

View File

@ -126,6 +126,7 @@
"view"
"eval"
"sign"
"abort"
] @keyword
(map_statement
@ -277,8 +278,6 @@
"/"
"%"
".."
"is"
"isnot"
"=="
"!="
">"
@ -297,9 +296,15 @@
"..="
"<<"
"=<<"
"->"
(match_case)
] @operator
[
"is"
"isnot"
] @keyword.operator
; Some characters have different meanings based on the context
(unary_operation
"!" @operator)