mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
fix(nix): refactor nixosTest injections for better performance (#8378)
This commit is contained in:
parent
36fcb4a423
commit
7efc1b58a8
2 changed files with 32 additions and 14 deletions
|
|
@ -251,17 +251,35 @@
|
|||
(#lua-match? @_func "^%a*%.*writeRust%a*$")
|
||||
(#set! injection.combined))
|
||||
|
||||
; (nixosTest) testScript
|
||||
((binding
|
||||
attrpath: (attrpath) @_attr_name
|
||||
(#eq? @_attr_name "nodes"))
|
||||
(binding
|
||||
attrpath: (attrpath) @_func_name
|
||||
(#eq? @_func_name "testScript")
|
||||
; (runTest) testScript
|
||||
(apply_expression
|
||||
function: (_) @_func
|
||||
argument: (_
|
||||
(_)*
|
||||
(_
|
||||
(string_fragment) @injection.content
|
||||
(#set! injection.language "python")))
|
||||
(#set! injection.combined))
|
||||
(binding
|
||||
attrpath: (attrpath) @_func_name
|
||||
expression: (_
|
||||
(string_fragment) @injection.content
|
||||
(#set! injection.language "python")))
|
||||
(#eq? @_func_name "testScript")
|
||||
(#lua-match? @_func "^.*%.*runTest$")
|
||||
(#set! injection.combined))))
|
||||
|
||||
; (nixosTest) testScript
|
||||
(apply_expression
|
||||
function: (_) @_func
|
||||
argument: (_
|
||||
(_)*
|
||||
(_
|
||||
(binding
|
||||
attrpath: (attrpath) @_func_name
|
||||
expression: (_
|
||||
(string_fragment) @injection.content
|
||||
(#set! injection.language "python")))
|
||||
(#eq? @_func_name "testScript")
|
||||
(#lua-match? @_func "^.*%.*nixosTest$")
|
||||
(#set! injection.combined))))
|
||||
|
||||
; home-manager Neovim plugin config
|
||||
(attrset_expression
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue