2022-05-20 03:19:46 +02:00
|
|
|
(
|
|
|
|
[
|
|
|
|
(attribute_item)+
|
|
|
|
(line_comment)+
|
|
|
|
]*
|
|
|
|
.
|
|
|
|
(function_item
|
|
|
|
body: (_) @function.inside)) @function.around
|
2021-10-23 04:41:19 +02:00
|
|
|
|
2022-06-06 17:18:14 +02:00
|
|
|
(closure_expression body: (_) @function.inside) @function.around
|
|
|
|
|
2022-05-20 03:19:46 +02:00
|
|
|
(
|
|
|
|
[
|
|
|
|
(attribute_item)+
|
|
|
|
(line_comment)+
|
|
|
|
]*
|
|
|
|
.
|
|
|
|
(struct_item
|
|
|
|
body: (_) @class.inside)) @class.around
|
2021-10-23 04:41:19 +02:00
|
|
|
|
2022-05-20 03:19:46 +02:00
|
|
|
(
|
|
|
|
[
|
|
|
|
(attribute_item)+
|
|
|
|
(line_comment)+
|
|
|
|
]*
|
|
|
|
.
|
|
|
|
(enum_item
|
|
|
|
body: (_) @class.inside)) @class.around
|
2021-10-23 04:41:19 +02:00
|
|
|
|
2022-05-20 03:19:46 +02:00
|
|
|
(
|
|
|
|
[
|
|
|
|
(attribute_item)+
|
|
|
|
(line_comment)+
|
|
|
|
]*
|
|
|
|
.
|
|
|
|
(union_item
|
|
|
|
body: (_) @class.inside)) @class.around
|
2021-10-23 04:41:19 +02:00
|
|
|
|
2022-05-20 03:19:46 +02:00
|
|
|
(
|
|
|
|
[
|
|
|
|
(attribute_item)+
|
|
|
|
(line_comment)+
|
|
|
|
]*
|
|
|
|
.
|
|
|
|
(trait_item
|
|
|
|
body: (_) @class.inside)) @class.around
|
2021-10-23 04:41:19 +02:00
|
|
|
|
2022-05-20 03:19:46 +02:00
|
|
|
(
|
|
|
|
[
|
|
|
|
(attribute_item)+
|
|
|
|
(line_comment)+
|
|
|
|
]*
|
|
|
|
.
|
|
|
|
(impl_item
|
|
|
|
body: (_) @class.inside)) @class.around
|
2021-10-23 04:41:19 +02:00
|
|
|
|
2022-05-23 14:24:30 +02:00
|
|
|
(parameters
|
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
|
|
|
|
2022-05-20 03:19:46 +02:00
|
|
|
(type_parameters
|
2022-05-23 14:24:30 +02:00
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
|
|
|
|
|
|
|
(type_arguments
|
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
2021-10-23 04:41:19 +02:00
|
|
|
|
|
|
|
(closure_parameters
|
2022-05-23 14:24:30 +02:00
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
2021-10-23 04:41:19 +02:00
|
|
|
|
|
|
|
(arguments
|
2022-05-23 14:24:30 +02:00
|
|
|
((_) @parameter.inside . ","? @parameter.around) @parameter.around)
|
2022-03-06 06:24:24 +01:00
|
|
|
|
|
|
|
[
|
|
|
|
(line_comment)
|
|
|
|
(block_comment)
|
|
|
|
] @comment.inside
|
|
|
|
|
|
|
|
(line_comment)+ @comment.around
|
|
|
|
|
|
|
|
(block_comment) @comment.around
|
2022-06-20 04:36:33 +02:00
|
|
|
|
|
|
|
(; #[test]
|
|
|
|
(attribute_item
|
|
|
|
(meta_item
|
|
|
|
(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"))
|