nvim-treesitter/runtime/queries/nix/locals.scm

16 lines
624 B
Scheme
Raw Normal View History

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