aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/rust/rainbows.scm
blob: 0656047be470ce3a41bbbeabe80cb6a652eb0378 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
[
  ; {/}
  (declaration_list)
  (field_declaration_list)
  (field_initializer_list)
  (enum_variant_list)
  (block)
  (match_block)
  (use_list)
  (struct_pattern)

  ; (/)
  (ordered_field_declaration_list)
  (arguments)
  (parameters)
  (tuple_type)
  (tuple_expression)
  (tuple_pattern)
  (tuple_struct_pattern)
  (unit_type)
  (unit_expression)
  (visibility_modifier)
  (parenthesized_expression)
  (token_repetition_pattern)

  ; </>
  (type_parameters)
  (type_arguments)
  (bracketed_type)
  (for_lifetimes)

  ; [/]
  (array_type)
  (array_expression)
  (index_expression)
  (slice_pattern)

  ; attributes #[]
  (attribute_item)
  (inner_attribute_item)

  ; macros
  (token_tree_pattern)
  (macro_definition)

  ; closures
  (closure_parameters)
] @rainbow.scope

; attributes like `#[serde(rename_all = "kebab-case")]`
(attribute arguments: (token_tree) @rainbow.scope)

[
  "#"
  "[" "]"
  "(" ")"
  "{" "}"
  "<" ">"
  "|"
] @rainbow.bracket