aboutsummaryrefslogtreecommitdiffstats
path: root/queries/nix/locals.scm
blob: 1720a848c204284a67891f384cd8555d3962823f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; let bindings
(let (bind . (attrpath) @definition.var)) @scope

; rec attrsets
(rec_attrset (bind . (attrpath) @definition.field)) @scope

; functions and parameters
(function . [
    (identifier) @definition.parameter
    (formals (formal . (identifier) @definition.parameter))
]) @scope
((formals) "@" (identifier) @definition.parameter) ; I couldn't get this to work properly inside the (function)

; some identifiers can't be references, but @reference doesn't seem to have an inverse like @none
(identifier) @reference