nvim-treesitter/queries/nix/locals.scm

16 lines
564 B
Scheme
Raw Normal View History

2020-11-18 16:52:41 -05:00
; let bindings
2022-05-22 13:22:01 +02:00
(let_expression (binding_set (binding . (attrpath) @definition.var))) @scope
2020-11-18 16:52:41 -05:00
; rec attrsets
2022-05-22 13:22:01 +02:00
(rec_attrset_expression (binding_set (binding . (attrpath) @definition.field))) @scope
2020-11-18 16:52:41 -05:00
; functions and parameters
2022-05-22 13:22:01 +02:00
(function_expression . [
2020-11-18 16:52:41 -05:00
(identifier) @definition.parameter
(formals (formal . (identifier) @definition.parameter))
]) @scope
((formals) "@" (identifier) @definition.parameter) ; I couldn't get this to work properly inside the (function)
2022-05-22 13:22:01 +02:00
(variable_expression (identifier) @reference)
(inherited_attrs attr: (identifier) @reference)