Debian Codegraph @

runtime/queries/rust/textobjects.scm

raw symbols SCIP
1 (function_item
2 body: (_) @function.inside) @function.around
3
4 (closure_expression
5 body: (_) @function.inside) @function.around
6
7 (struct_item
8 body: (_) @class.inside) @class.around
9
10 (enum_item
11 body: (_) @class.inside) @class.around
12
13 (union_item
14 body: (_) @class.inside) @class.around
15
16 (trait_item
17 body: (_) @class.inside) @class.around
18
19 (impl_item
20 body: (_) @class.inside) @class.around
21
22 (parameters
23 ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
24
25 (type_parameters
26 ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
27
28 (type_arguments
29 ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
30
31 (closure_parameters
32 ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
33
34 (arguments
35 ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
36
37 (field_initializer_list
38 ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
39
40 [
41 (line_comment)
42 (block_comment)
43 ] @comment.inside
44
45 (line_comment)+ @comment.around
46
47 (block_comment) @comment.around
48
49 (; #[test]
50 (attribute_item
51 (attribute
52 (identifier) @_test_attribute))
53 ; allow other attributes like #[should_panic] and comments
54 [
55 (attribute_item)
56 (line_comment)
57 ]*
58 ; the test function
59 (function_item
60 body: (_) @test.inside) @test.around
61 (#eq? @_test_attribute "test"))
62
63 (array_expression
64 (_) @entry.around)
65
66 (tuple_expression
67 (_) @entry.around)
68
69 (tuple_pattern
70 (_) @entry.around)
71
72 ; Commonly used vec macro initializer is special cased
73 (macro_invocation
74 (identifier) @_id (token_tree (_) @entry.around)
75 (#eq? @_id "vec"))
76
77 (enum_variant) @entry.around
78
79 (field_declaration
80 (_) @entry.inside) @entry.around
81
82 (field_initializer
83 (_) @entry.inside) @entry.around
84
85 (shorthand_field_initializer) @entry.around