fix(query): use #any-of instead of #match

This commit is contained in:
Hannah 2026-03-16 11:41:28 -04:00
parent bb4b04c82d
commit 3244ed848f
No known key found for this signature in database
GPG key ID: 0C1C205F4C354DE1
2 changed files with 13 additions and 16 deletions

View file

@ -103,8 +103,6 @@
(bracket) @punctuation.bracket
; === END EXPR ===
; === BEGIN CORE ===
(locktype) @variable
(macro_arg) @variable

View file

@ -32,7 +32,7 @@
(rhs) @_lang))
(external_method_body_content) @injection.content
(#set! injection.include-children "true")
(#match? @_lang "^[Pp][Yy][Tt][Hh][Oo][Nn]$")
(#any-of? @_lang "python" "Python" "PYTHON")
(#set! injection.language "python"))
(method_definition
@ -41,7 +41,7 @@
(rhs) @_lang))
(external_method_body_content) @injection.content
(#set! injection.include-children "true")
(#match? @_lang "^[Tt][Ss][Qq][Ll]$")
(#any-of? @_lang "tsql" "TSQL" "tSQL" "tSql" "TSql")
(#set! injection.language "tsql"))
(method_definition
@ -50,7 +50,7 @@
(rhs) @_lang))
(external_method_body_content) @injection.content
(#set! injection.include-children "true")
(#match? @_lang "^[Ii][Ss][Pp][Ll]$")
(#any-of? @_lang "ispl" "ISPL" "ISpl" "iSpl")
(#set! injection.language "ispl"))
((trigger
@ -60,7 +60,7 @@
(rhs) @_lang))
(external_method_body_content) @injection.content))
(#set! injection.include-children "true")
(#match? @_lang "^[Pp][Yy][Tt][Hh][Oo][Nn]$")
(#any-of? @_lang "python" "Python" "PYTHON")
(#set! injection.language "python"))
((trigger
@ -70,14 +70,14 @@
(rhs) @_lang))
(external_method_body_content) @injection.content))
(#set! injection.include-children "true")
(#match? @_lang "^[Tt][Ss][Qq][Ll]$")
(#any-of? @_lang "tsql" "TSQL" "tSQL" "tSql" "TSql")
(#set! injection.language "tsql"))
(query
(return_type
(typename
(identifier) @_querytype
(#match? @_querytype "^%[Ss][Qq][Ll][Qq][Uu][Ee][Rr][Yy]$")))
(#any-of? @_querytype "%SqlQuery" "%sqlquery" "%SQLQUERY" "%Sqlquery" "%SQLQuery")))
(query_body
(query_body_content) @injection.content)
(#set! injection.language "sql")
@ -90,7 +90,7 @@
(rhs) @_mt))
(external_method_body_content) @injection.content)
(#set! injection.include-children "true")
(#match? @_mt "^\"?text/markdown\"?$")
(#any-of? @_mt "text/markdown" "\"text/markdown\"")
(#set! injection.language "markdown"))
(xdata
@ -100,8 +100,7 @@
(rhs) @_mt))
(external_method_body_content) @injection.content)
(#set! injection.include-children "true")
(#match? @_mt
"^\"?([Tt][Ee][Xx][Tt]|[Aa][Pp][Pp][Ll][Ii][Cc][Aa][Tt][Ii][Oo][Nn])/[Xx][Mm][Ll]\"?$")
(#any-of? @_mt "text/xml" "\"text/xml\"" "application/xml" "\"application/xml\"")
(#set! injection.language "xml"))
(xdata
@ -111,7 +110,7 @@
(rhs) @_mt))
(external_method_body_content) @injection.content)
(#set! injection.include-children "true")
(#match? @_mt "^\"?text/html\"?$")
(#any-of? @_mt "text/html" "\"text/html\"")
(#set! injection.language "html"))
(xdata
@ -121,7 +120,7 @@
(rhs) @_mt))
(external_method_body_content) @injection.content)
(#set! injection.include-children "true")
(#match? @_mt "^\"?application/json\"?$")
(#any-of? @_mt "application/json" "\"application/json\"")
(#set! injection.language "json"))
(xdata
@ -131,8 +130,7 @@
(rhs) @_mt))
(external_method_body_content) @injection.content)
(#set! injection.include-children "true")
(#match? @_mt
"^\"?([Tt][Ee][Xx][Tt]|[Aa][Pp][Pp][Ll][Ii][Cc][Aa][Tt][Ii][Oo][Nn])/[Yy][Aa][Mm][Ll]\"?$")
(#any-of? @_mt "text/yaml" "\"text/yaml\"" "application/yaml" "\"application/yaml\"")
(#set! injection.language "yaml"))
(xdata
@ -142,7 +140,7 @@
(rhs) @_mt))
(external_method_body_content) @injection.content)
(#set! injection.include-children "true")
(#match? @_mt "^\"?text/css\"?$")
(#any-of? @_mt "text/css" "\"text/css\"")
(#set! injection.language "css"))
(xdata
@ -157,3 +155,4 @@
(external_method_body_content) @injection.content)
(#set! injection.language "xml")
(#set! injection.include-children "true"))