runnables.scm

 1
 2(
 3    (mod_item
 4        name: (_) @run
 5        (#eq? @run "tests")
 6    )
 7    (#set! tag rust-mod-test)
 8)
 9
10(
11    (
12        (attribute_item (attribute
13            [((identifier) @_attribute)
14                (scoped_identifier (identifier) @_attribute)
15                ])
16            (#match? @_attribute "test")
17        ) @_start
18        .
19        (attribute_item) *
20        .
21        [(line_comment) (block_comment)] *
22        .
23        (function_item
24            name: (_) @run
25            body: _
26        ) @_end
27    )
28    (#set! tag rust-test)
29)
30
31; Rust main function
32(
33    (
34        (function_item
35            name: (_) @run
36            body: _
37        ) @_rust_main_function_end
38        (#eq? @run "main")
39    )
40    (#set! tag rust-main)
41)