2022-04-14 12:01:23 +08:00
|
|
|
; let bindings
|
2022-11-13 23:50:23 +08:00
|
|
|
(let_expression (binding_set (binding . (attrpath) @definition.var))) @scope
|
2022-04-14 12:01:23 +08:00
|
|
|
|
|
|
|
; rec attrsets
|
2022-11-13 23:50:23 +08:00
|
|
|
(rec_attrset_expression (binding_set (binding . (attrpath) @definition.field))) @scope
|
2022-04-14 12:01:23 +08:00
|
|
|
|
|
|
|
; functions and parameters
|
2022-11-13 23:50:23 +08:00
|
|
|
(function_expression . [
|
2022-04-14 12:01:23 +08: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-11-13 23:50:23 +08:00
|
|
|
(variable_expression (identifier) @reference)
|
|
|
|
(inherited_attrs attr: (identifier) @reference)
|