mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
fix(query): use #any-of instead of #match
This commit is contained in:
parent
bb4b04c82d
commit
3244ed848f
2 changed files with 13 additions and 16 deletions
|
|
@ -103,8 +103,6 @@
|
|||
|
||||
(bracket) @punctuation.bracket
|
||||
|
||||
; === END EXPR ===
|
||||
; === BEGIN CORE ===
|
||||
(locktype) @variable
|
||||
|
||||
(macro_arg) @variable
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue