nvim-treesitter/queries/julia/locals.scm

76 lines
1.3 KiB
Scheme
Raw Permalink Normal View History

2024-11-11 08:39:00 +01:00
; References
(identifier) @local.reference
2024-01-06 15:05:50 +09:00
; Variables
(assignment
(identifier) @local.definition.var)
2024-01-06 15:05:50 +09:00
(assignment
2022-11-02 16:21:44 -05:00
(tuple_expression
(identifier) @local.definition.var))
2022-11-02 16:21:44 -05:00
2024-01-06 15:05:50 +09:00
; let/const bindings
(let_binding
2024-01-06 15:05:50 +09:00
(identifier) @local.definition.var)
2022-11-02 16:21:44 -05:00
2024-01-06 15:05:50 +09:00
(let_binding
(tuple_expression
(identifier) @local.definition.var))
2022-11-02 16:21:44 -05:00
2024-01-06 15:05:50 +09:00
; For bindings
(for_binding
(identifier) @local.definition.var)
2024-01-06 15:05:50 +09:00
(for_binding
2022-11-02 16:21:44 -05:00
(tuple_expression
(identifier) @local.definition.var))
2024-01-06 15:05:50 +09:00
; Types
2024-11-11 08:39:00 +01:00
(module_definition
(identifier) @local.definition.type)
2024-01-06 15:05:50 +09:00
2024-11-11 08:39:00 +01:00
(struct_definition
(identifier) @local.definition.type)
2022-11-02 16:21:44 -05:00
2024-11-11 08:39:00 +01:00
(type_head
(identifier) @local.definition.type)
2022-11-02 16:21:44 -05:00
2024-11-11 08:39:00 +01:00
(type_head
(binary_expression
.
(identifier) @local.definition.type))
2024-01-06 15:05:50 +09:00
; Module imports
2022-11-02 16:21:44 -05:00
(import_statement
(identifier) @local.definition.import)
2022-11-02 16:21:44 -05:00
2024-11-11 08:39:00 +01:00
(using_statement
(identifier) @local.definition.import)
(selected_import
(identifier) @local.definition.import)
; Scopes
(function_definition
(signature
(call_expression
.
(identifier) @local.definition.function))) @local.scope
2024-01-06 15:05:50 +09:00
(macro_definition
(signature
(call_expression
.
(identifier) @local.definition.function))) @local.scope
[
2024-11-11 08:39:00 +01:00
(quote_statement)
(let_statement)
2022-11-02 16:21:44 -05:00
(for_statement)
(while_statement)
(try_statement)
2022-11-02 16:21:44 -05:00
(catch_clause)
(finally_clause)
2022-11-02 16:21:44 -05:00
(do_clause)
] @local.scope