mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-13 17:00:09 -04:00
injections(nix): add nixosTest.testScript + home-manager nvim config
(+ add Check to mkDerivation bash matches) (+ add Check to mkDerivation bash matches)
This commit is contained in:
parent
3b79045583
commit
fa32df466b
1 changed files with 33 additions and 1 deletions
|
|
@ -20,7 +20,7 @@
|
||||||
(indented_string_expression
|
(indented_string_expression
|
||||||
((string_fragment) @injection.content (#set! injection.language "bash")))
|
((string_fragment) @injection.content (#set! injection.language "bash")))
|
||||||
]
|
]
|
||||||
(#match? @_path "(^\\w+(Phase|Hook)|(pre|post)[A-Z]\\w+|script)$"))
|
(#match? @_path "(^\\w+(Phase|Hook|Check)|(pre|post)[A-Z]\\w+|script)$"))
|
||||||
|
|
||||||
(apply_expression
|
(apply_expression
|
||||||
function: (_) @_func
|
function: (_) @_func
|
||||||
|
|
@ -129,3 +129,35 @@
|
||||||
])
|
])
|
||||||
(#match? @_func "(^|\\.)writeRust(Bin)?$")
|
(#match? @_func "(^|\\.)writeRust(Bin)?$")
|
||||||
(#set! injection.combined))
|
(#set! injection.combined))
|
||||||
|
|
||||||
|
;; (nixosTest) testScript
|
||||||
|
((binding
|
||||||
|
attrpath: (attrpath) @_attr_name
|
||||||
|
(#eq? @_attr_name "nodes")
|
||||||
|
)
|
||||||
|
(binding
|
||||||
|
attrpath: (attrpath) @_func_name (#eq? @_func_name "testScript")
|
||||||
|
(_
|
||||||
|
(string_fragment) @injection.content (#set! injection.language "python")
|
||||||
|
))
|
||||||
|
(#set! injection.combined))
|
||||||
|
|
||||||
|
;; home-manager Neovim plugin config
|
||||||
|
(attrset_expression
|
||||||
|
(binding_set
|
||||||
|
(binding
|
||||||
|
attrpath: (attrpath) @_ty_attr
|
||||||
|
(_
|
||||||
|
(string_fragment) @_ty
|
||||||
|
)
|
||||||
|
(#eq? @_ty_attr "type")
|
||||||
|
(#eq? @_ty "lua"))
|
||||||
|
(binding
|
||||||
|
|
||||||
|
attrpath: (attrpath) @_cfg_attr
|
||||||
|
(_
|
||||||
|
(string_fragment) @injection.content (#set! injection.language "lua")
|
||||||
|
)
|
||||||
|
(#eq? @_cfg_attr "config")
|
||||||
|
))
|
||||||
|
(#set! injection.combined))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue