1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-12-13 20:41:09 +01:00

plugins/treesitter: match -> any-of pattern

No real performance gain but might be easier to maintain / understand.
This commit is contained in:
Austin Horstman 2025-12-08 14:07:36 -06:00
parent 507d48c3ae
commit 3e6e23a719

View file

@ -11,7 +11,7 @@
((string_fragment) @injection.content ((string_fragment) @injection.content
(#set! injection.language "lua"))) (#set! injection.language "lua")))
] ]
(#match? @_path "(^(extraConfigLua(Pre|Post)?|__raw))$")) (#any-of? @_path "__raw" "extraConfigLua" "extraConfigLuaPre" "extraConfigLuaPost"))
(binding (binding
attrpath: (attrpath attrpath: (attrpath
@ -25,7 +25,7 @@
((string_fragment) @injection.content ((string_fragment) @injection.content
(#set! injection.language "lua"))) (#set! injection.language "lua")))
]) ])
(#match? @_path "(^(extraConfigLua(Pre|Post)?|__raw))$")) (#any-of? @_path "__raw" "extraConfigLua" "extraConfigLuaPre" "extraConfigLuaPost"))
(apply_expression (apply_expression
function: (_) @_func function: (_) @_func
@ -50,7 +50,7 @@
((string_fragment) @injection.content ((string_fragment) @injection.content
(#set! injection.language "vim"))) (#set! injection.language "vim")))
] ]
(#match? @_path "(^extraConfigVim(Pre|Post)?)$")) (#any-of? @_path "extraConfigVim" "extraConfigVimPre" "extraConfigVimPost"))
(binding (binding
attrpath: (attrpath attrpath: (attrpath
@ -64,7 +64,7 @@
((string_fragment) @injection.content ((string_fragment) @injection.content
(#set! injection.language "vim"))) (#set! injection.language "vim")))
]) ])
(#match? @_path "(^extraConfigVim(Pre|Post)?)$")) (#any-of? @_path "extraConfigVim" "extraConfigVimPre" "extraConfigVimPost"))
(binding (binding
attrpath: (attrpath attrpath: (attrpath
@ -78,8 +78,8 @@
((string_fragment) @injection.content ((string_fragment) @injection.content
(#set! injection.language "lua"))) (#set! injection.language "lua")))
] ]
(#match? @namespace "^luaConfig$") (#eq? @namespace "luaConfig")
(#match? @name "^(pre|post|content)$")) (#any-of? @name "pre" "post" "content"))
(binding (binding
attrpath: (attrpath attrpath: (attrpath
@ -98,6 +98,6 @@
((string_fragment) @injection.content ((string_fragment) @injection.content
(#set! injection.language "lua"))) (#set! injection.language "lua")))
] ]
(#match? @_nested_path "^(pre|post|content)$")))) (#any-of? @_nested_path "pre" "post" "content"))))
] ]
(#match? @_path "^luaConfig$")) (#eq? @_path "luaConfig"))