| 1 | ; Scopes |
| 2 | |
| 3 | [ |
| 4 | (function_definition) |
| 5 | (let_expression) |
| 6 | ] @local.scope |
| 7 | |
| 8 | ; Definitions |
| 9 | |
| 10 | ; `function_parameter` is `name: (identifier) type: (parameter_type)`. |
| 11 | (function_parameter |
| 12 | (identifier) @local.definition.variable.parameter) |
| 13 | |
| 14 | ; `local_binding` in a `let` is `name: (identifier) value: (_)`; anchor the name. |
| 15 | (let_expression |
| 16 | (local_binding |
| 17 | . (identifier) @local.definition.variable)) |
| 18 | |
| 19 | ; References |
| 20 | |
| 21 | (identifier) @local.reference |
| 22 | |
| 23 | ; The function name in a signature is a definition site, not a reference. |
| 24 | (function_signature |
| 25 | (identifier) @_) |
| 26 | |
| 27 | ; Operators in call forms are function names, not variable references. |
| 28 | (contract_function_call |
| 29 | operator: (identifier) @_) |
| 30 | |
| 31 | ; Tuple keys are field names, not variable references. |
| 32 | (tuple_lit |
| 33 | key: (identifier) @_) |
| 34 | (tuple_type |
| 35 | key: (identifier) @_) |