2022-04-14 12:01:23 +08:00
|
|
|
; let bindings
|
2022-11-14 00:10:02 +08:00
|
|
|
(let (bind . (attrpath) @definition.var)) @scope
|
2022-04-14 12:01:23 +08:00
|
|
|
|
|
|
|
; rec attrsets
|
2022-11-14 00:10:02 +08:00
|
|
|
(rec_attrset (bind . (attrpath) @definition.field)) @scope
|
2022-04-14 12:01:23 +08:00
|
|
|
|
|
|
|
; functions and parameters
|
2022-11-14 00:10:02 +08:00
|
|
|
(function . [
|
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-14 00:10:02 +08:00
|
|
|
; some identifiers can't be references, but @reference doesn't seem to have an inverse like @none
|
|
|
|
(identifier) @reference
|