2020-07-11 00:10:17 +02:00
|
|
|
; Imports
|
|
|
|
|
(extern_crate_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
name: (identifier) @local.definition.import)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(use_declaration
|
2024-03-21 20:44:35 +09:00
|
|
|
argument: (scoped_identifier
|
|
|
|
|
name: (identifier) @local.definition.import))
|
2020-07-11 00:10:17 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(use_as_clause
|
2023-07-22 15:29:32 +02:00
|
|
|
alias: (identifier) @local.definition.import)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
(use_list
|
2024-01-06 15:05:50 +09:00
|
|
|
(identifier) @local.definition.import) ; use std::process::{Child, Command, Stdio};
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
; Functions
|
2024-01-06 15:05:50 +09:00
|
|
|
(function_item
|
|
|
|
|
name: (identifier) @local.definition.function)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(function_item
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.method
|
2024-03-21 20:44:35 +09:00
|
|
|
parameters: (parameters
|
|
|
|
|
(self_parameter)))
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
; Variables
|
2024-01-06 15:05:50 +09:00
|
|
|
(parameter
|
|
|
|
|
pattern: (identifier) @local.definition.var)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(let_declaration
|
2023-07-22 15:29:32 +02:00
|
|
|
pattern: (identifier) @local.definition.var)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(const_item
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.var)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
(tuple_pattern
|
2024-01-06 15:05:50 +09:00
|
|
|
(identifier) @local.definition.var)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
2022-11-05 10:31:02 +01:00
|
|
|
(let_condition
|
2024-03-21 20:44:35 +09:00
|
|
|
pattern: (_
|
|
|
|
|
(identifier) @local.definition.var))
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
(tuple_struct_pattern
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.var)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
(closure_parameters
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.var)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
(self_parameter
|
2023-07-22 15:29:32 +02:00
|
|
|
(self) @local.definition.var)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(for_expression
|
2023-07-22 15:29:32 +02:00
|
|
|
pattern: (identifier) @local.definition.var)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
; Types
|
|
|
|
|
(struct_item
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (type_identifier) @local.definition.type)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(constrained_type_parameter
|
2023-07-22 15:29:32 +02:00
|
|
|
left: (type_identifier) @local.definition.type) ; the P in remove_file<P: AsRef<Path>>(path: P)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
(enum_item
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (type_identifier) @local.definition.type)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
; Fields
|
|
|
|
|
(field_declaration
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (field_identifier) @local.definition.field)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
(enum_variant
|
2024-01-06 15:05:50 +09:00
|
|
|
name: (identifier) @local.definition.field)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
; References
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.reference
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
((type_identifier) @local.reference
|
2024-01-06 15:05:50 +09:00
|
|
|
(#set! reference.kind "type"))
|
2020-07-11 00:10:17 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
((field_identifier) @local.reference
|
|
|
|
|
(#set! reference.kind "field"))
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
; Macros
|
|
|
|
|
(macro_definition
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.macro)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
; Module
|
2024-01-06 15:05:50 +09:00
|
|
|
(mod_item
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.namespace)
|
2020-07-11 00:10:17 +02:00
|
|
|
|
|
|
|
|
; Scopes
|
|
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
(block)
|
|
|
|
|
(function_item)
|
|
|
|
|
(closure_expression)
|
|
|
|
|
(while_expression)
|
|
|
|
|
(for_expression)
|
|
|
|
|
(loop_expression)
|
|
|
|
|
(if_expression)
|
|
|
|
|
(match_expression)
|
|
|
|
|
(match_arm)
|
|
|
|
|
(struct_item)
|
|
|
|
|
(enum_item)
|
|
|
|
|
(impl_item)
|
2023-07-22 15:29:32 +02:00
|
|
|
] @local.scope
|