2021-09-06 17:13:52 +08:00
|
|
|
; Scopes
|
|
|
|
|
2023-11-06 09:54:25 +08:00
|
|
|
[
|
|
|
|
(function_declaration)
|
|
|
|
(type_declaration)
|
|
|
|
(block)
|
|
|
|
] @local.scope
|
2021-09-06 17:13:52 +08:00
|
|
|
|
|
|
|
; Definitions
|
|
|
|
|
2025-02-25 01:46:34 +08:00
|
|
|
(parameter_declaration (identifier) @local.definition.variable.parameter)
|
|
|
|
(variadic_parameter_declaration (identifier) @local.definition.variable.parameter)
|
2021-09-06 17:13:52 +08:00
|
|
|
|
|
|
|
(const_declaration
|
|
|
|
(const_spec
|
2025-02-25 01:46:34 +08:00
|
|
|
name: (identifier) @local.definition.constant))
|
2021-09-06 17:13:52 +08:00
|
|
|
|
|
|
|
; References
|
|
|
|
|
|
|
|
(identifier) @local.reference
|
2025-05-31 22:41:19 +08:00
|
|
|
|
|
|
|
; Field names in struct literals are identifier rather than field_identifier,
|
|
|
|
; these cannot be locals.
|
|
|
|
(keyed_element . (literal_element (identifier) @variable.other.member))
|