2022-08-29 01:03:39 +04:00
|
|
|
(function_item
|
2023-08-14 12:06:25 +04:00
|
|
|
body: (_) @function.inside) @function.around
|
|
|
|
|
|
|
|
(closure_expression
|
|
|
|
body: (_) @function.inside) @function.around
|
2021-10-23 06:41:19 +04:00
|
|
|
|
2022-08-29 01:03:39 +04:00
|
|
|
(struct_item
|
|
|
|
body: (_) @class.inside) @class.around
|
2022-06-06 19:18:14 +04:00
|
|
|
|
2022-08-29 01:03:39 +04:00
|
|
|
(enum_item
|
|
|
|
body: (_) @class.inside) @class.around
|
2021-10-23 06:41:19 +04:00
|
|
|
|
2022-08-29 01:03:39 +04:00
|
|
|
(union_item
|
|
|
|
body: (_) @class.inside) @class.around
|
2021-10-23 06:41:19 +04:00
|
|
|
|
2022-08-29 01:03:39 +04:00
|
|
|
(trait_item
|
|
|
|
body: (_) @class.inside) @class.around
|
2021-10-23 06:41:19 +04:00
|
|
|
|
2022-08-29 01:03:39 +04:00
|
|
|
(impl_item
|
|
|
|
body: (_) @class.inside) @class.around
|
2021-10-23 06:41:19 +04:00
|
|
|
|
2022-05-23 16:24:30 +04:00
|
|
|
(parameters
|
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
|
|
|
|
2022-05-20 05:19:46 +04:00
|
|
|
(type_parameters
|
2022-05-23 16:24:30 +04:00
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
|
|
|
|
|
|
|
(type_arguments
|
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
2021-10-23 06:41:19 +04:00
|
|
|
|
|
|
|
(closure_parameters
|
2022-05-23 16:24:30 +04:00
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
2021-10-23 06:41:19 +04:00
|
|
|
|
|
|
|
(arguments
|
2022-05-23 16:24:30 +04:00
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
2022-03-06 09:24:24 +04:00
|
|
|
|
2024-02-17 20:08:44 +04:00
|
|
|
(field_initializer_list
|
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
|
|
|
|
2022-03-06 09:24:24 +04:00
|
|
|
[
|
|
|
|
(line_comment)
|
|
|
|
(block_comment)
|
|
|
|
] @comment.inside
|
|
|
|
|
|
|
|
(line_comment)+ @comment.around
|
|
|
|
|
|
|
|
(block_comment) @comment.around
|
2022-06-20 06:36:33 +04:00
|
|
|
|
|
|
|
(; #[test]
|
|
|
|
(attribute_item
|
2022-11-12 02:51:58 +04:00
|
|
|
(attribute
|
2022-06-20 06:36:33 +04:00
|
|
|
(identifier) @_test_attribute))
|
|
|
|
; allow other attributes like #[should_panic] and comments
|
|
|
|
[
|
|
|
|
(attribute_item)
|
|
|
|
(line_comment)
|
|
|
|
]*
|
|
|
|
; the test function
|
|
|
|
(function_item
|
|
|
|
body: (_) @test.inside) @test.around
|
|
|
|
(#eq? @_test_attribute "test"))
|
2024-03-31 20:53:15 +04:00
|
|
|
|
|
|
|
(array_expression
|
|
|
|
(_) @entry.around)
|
|
|
|
|
|
|
|
(tuple_expression
|
|
|
|
(_) @entry.around)
|
|
|
|
|
|
|
|
(tuple_pattern
|
|
|
|
(_) @entry.around)
|
|
|
|
|
|
|
|
; Commonly used vec macro intializer is special cased
|
|
|
|
(macro_invocation
|
|
|
|
(identifier) @_id (token_tree (_) @entry.around)
|
|
|
|
(#eq? @_id "vec"))
|
|
|
|
|
|
|
|
(enum_variant) @entry.around
|
|
|
|
|
|
|
|
(field_declaration
|
|
|
|
(_) @entry.inside) @entry.around
|
|
|
|
|
|
|
|
(field_initializer
|
|
|
|
(_) @entry.inside) @entry.around
|
|
|
|
|
|
|
|
(shorthand_field_initializer) @entry.around
|