nvim-treesitter/queries/nix/locals.scm

35 lines
698 B
Scheme
Raw Permalink Normal View History

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