nvim-treesitter/queries/hare/locals.scm

66 lines
882 B
Scheme
Raw Normal View History

2023-03-11 03:02:30 -05:00
; Scopes
[
(module)
(function_declaration)
(if_statement)
(for_statement)
(match_expression)
(switch_expression)
] @local.scope
2023-03-11 03:02:30 -05:00
; References
[
(identifier)
(scoped_type_identifier)
] @local.reference
2023-03-11 03:02:30 -05:00
; Definitions
(global_binding
2024-01-06 15:05:50 +09:00
(identifier) @local.definition.constant
.
":"
(_))
2023-03-11 03:02:30 -05:00
(const_declaration
2024-01-06 15:05:50 +09:00
"const"
(identifier) @local.definition.constant
.
"=")
2023-03-11 03:02:30 -05:00
(field
2024-01-06 15:05:50 +09:00
.
(identifier) @local.definition.field)
2023-03-11 03:02:30 -05:00
(field_assignment
2024-01-06 15:05:50 +09:00
.
(identifier) @local.definition.field)
2023-03-11 03:02:30 -05:00
(function_declaration
2024-01-06 15:05:50 +09:00
"fn"
.
(identifier) @local.definition.function)
2023-03-11 03:02:30 -05:00
(parameter
2024-01-06 15:05:50 +09:00
(_) @local.definition.parameter
.
":")
2023-03-11 03:02:30 -05:00
(type_declaration
2024-01-06 15:05:50 +09:00
"type"
(identifier) @local.definition.type
.
"=")
2023-03-11 03:02:30 -05:00
(type_declaration
2024-01-06 15:05:50 +09:00
"type"
(identifier) @local.definition.enum
.
"="
(enum_type))
2023-03-11 03:02:30 -05:00
(let_declaration
2024-01-06 15:05:50 +09:00
"let"
.
(identifier) @local.definition.var
2024-01-06 15:05:50 +09:00
","?)