2022-11-02 16:21:44 -05:00
|
|
|
;;; Variables
|
2022-12-03 11:42:07 +01:00
|
|
|
(assignment
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.var)
|
2022-12-03 11:42:07 +01:00
|
|
|
(assignment
|
2022-11-02 16:21:44 -05:00
|
|
|
(tuple_expression
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.var))
|
2022-11-02 16:21:44 -05:00
|
|
|
|
|
|
|
|
;;; let/const bindings
|
2022-12-03 11:42:07 +01:00
|
|
|
(let_binding
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.var)
|
2022-12-03 11:42:07 +01:00
|
|
|
(let_binding
|
2020-11-09 20:05:34 +01:00
|
|
|
(tuple_expression
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.var))
|
2022-11-02 16:21:44 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; For bindings
|
2020-11-09 20:05:34 +01:00
|
|
|
(for_binding
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.var)
|
2020-11-09 20:05:34 +01:00
|
|
|
(for_binding
|
2022-11-02 16:21:44 -05:00
|
|
|
(tuple_expression
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.var))
|
2020-11-09 20:05:34 +01:00
|
|
|
|
|
|
|
|
|
2022-11-02 16:21:44 -05:00
|
|
|
;;; Types
|
|
|
|
|
|
2020-11-09 20:05:34 +01:00
|
|
|
(struct_definition
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.type)
|
2022-11-02 16:21:44 -05:00
|
|
|
(abstract_definition
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.type)
|
2022-11-02 16:21:44 -05:00
|
|
|
(abstract_definition
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.type)
|
2022-11-02 16:21:44 -05:00
|
|
|
|
|
|
|
|
(type_parameter_list
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.type)
|
2022-11-02 16:21:44 -05:00
|
|
|
|
|
|
|
|
;;; Module imports
|
|
|
|
|
|
|
|
|
|
(import_statement
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.import)
|
2022-11-02 16:21:44 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Parameters
|
2020-11-09 20:05:34 +01:00
|
|
|
|
|
|
|
|
(parameter_list
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.parameter)
|
2022-11-02 16:21:44 -05:00
|
|
|
(optional_parameter .
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.parameter)
|
2022-11-02 16:21:44 -05:00
|
|
|
(slurp_parameter
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.parameter)
|
2022-11-02 16:21:44 -05:00
|
|
|
|
2020-11-09 20:05:34 +01:00
|
|
|
(typed_parameter
|
2023-07-22 15:29:32 +02:00
|
|
|
parameter: (identifier) @local.definition.parameter
|
2022-11-02 16:21:44 -05:00
|
|
|
(_))
|
|
|
|
|
|
2024-01-05 03:19:54 +09:00
|
|
|
;; Single parameter arrow function
|
2020-11-09 20:05:34 +01:00
|
|
|
(function_expression
|
2024-01-05 03:19:54 +09:00
|
|
|
. (identifier) @local.definition.parameter)
|
2022-11-02 16:21:44 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Function/macro definitions
|
2020-11-09 20:05:34 +01:00
|
|
|
|
|
|
|
|
(function_definition
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.function) @local.scope
|
2022-11-02 16:21:44 -05:00
|
|
|
(short_function_definition
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.function) @local.scope
|
2020-11-09 20:05:34 +01:00
|
|
|
(macro_definition
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.macro) @local.scope
|
2020-11-09 20:05:34 +01:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.reference
|
2020-11-09 20:05:34 +01:00
|
|
|
|
|
|
|
|
[
|
2022-11-02 16:21:44 -05:00
|
|
|
(for_statement)
|
|
|
|
|
(while_statement)
|
2020-11-09 20:05:34 +01:00
|
|
|
(try_statement)
|
2022-11-02 16:21:44 -05:00
|
|
|
(catch_clause)
|
2020-11-09 20:05:34 +01:00
|
|
|
(finally_clause)
|
|
|
|
|
(let_statement)
|
2022-11-02 16:21:44 -05:00
|
|
|
(quote_statement)
|
|
|
|
|
(do_clause)
|
2023-07-22 15:29:32 +02:00
|
|
|
] @local.scope
|