2021-01-05 19:26:08 +07:00
|
|
|
[
|
|
|
|
|
(mod_item)
|
|
|
|
|
(struct_item)
|
|
|
|
|
(enum_item)
|
|
|
|
|
(impl_item)
|
|
|
|
|
(struct_expression)
|
2024-03-21 06:33:27 -04:00
|
|
|
(struct_pattern)
|
2024-03-26 21:23:03 -04:00
|
|
|
(tuple_struct_pattern)
|
2021-02-08 10:38:38 +07:00
|
|
|
(tuple_expression)
|
2024-04-03 18:48:19 -05:00
|
|
|
(tuple_type)
|
2024-04-04 10:12:31 -05:00
|
|
|
(tuple_pattern)
|
2021-02-23 09:58:32 -05:00
|
|
|
(match_block)
|
2021-01-05 19:26:08 +07:00
|
|
|
(call_expression)
|
|
|
|
|
(assignment_expression)
|
|
|
|
|
(arguments)
|
|
|
|
|
(block)
|
|
|
|
|
(where_clause)
|
2021-02-08 10:38:38 +07:00
|
|
|
(use_list)
|
2022-01-18 21:17:26 +06:00
|
|
|
(array_expression)
|
|
|
|
|
(ordered_field_declaration_list)
|
|
|
|
|
(field_declaration_list)
|
|
|
|
|
(enum_variant_list)
|
|
|
|
|
(parameters)
|
|
|
|
|
(token_tree)
|
2024-03-21 06:33:27 -04:00
|
|
|
(token_repetition)
|
2022-01-18 21:17:26 +06:00
|
|
|
(macro_definition)
|
2023-03-20 14:44:39 -07:00
|
|
|
] @indent.begin
|
2022-01-18 21:17:26 +06:00
|
|
|
|
2023-12-26 21:57:22 +09:00
|
|
|
; Typing in "(" inside macro definitions breaks the tree entirely
|
|
|
|
|
; Making macro_definition becoming errors
|
|
|
|
|
; Offset this by adding back one indent for start of macro rules
|
|
|
|
|
(ERROR
|
|
|
|
|
.
|
|
|
|
|
"macro_rules!"
|
2024-03-20 17:12:26 -04:00
|
|
|
[
|
|
|
|
|
"("
|
|
|
|
|
"{"
|
|
|
|
|
"["
|
|
|
|
|
] @indent.begin
|
2023-12-26 21:57:22 +09:00
|
|
|
(#set! indent.immediate)
|
|
|
|
|
(#set! indent.start_at_same_line))
|
|
|
|
|
|
2024-03-20 17:12:26 -04:00
|
|
|
(macro_definition
|
|
|
|
|
[
|
|
|
|
|
")"
|
|
|
|
|
"}"
|
|
|
|
|
"]"
|
|
|
|
|
] @indent.end)
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(trait_item
|
|
|
|
|
body: (_) @indent.begin)
|
|
|
|
|
|
|
|
|
|
(string_literal
|
|
|
|
|
(escape_sequence)) @indent.begin
|
|
|
|
|
|
|
|
|
|
(block
|
|
|
|
|
"}" @indent.end)
|
|
|
|
|
|
2022-01-21 19:51:13 +06:00
|
|
|
(enum_item
|
2024-03-21 20:44:35 +09:00
|
|
|
body: (enum_variant_list
|
|
|
|
|
"}" @indent.end))
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2022-01-21 19:51:13 +06:00
|
|
|
(impl_item
|
2024-03-21 20:44:35 +09:00
|
|
|
body: (declaration_list
|
|
|
|
|
"}" @indent.end))
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2022-01-21 19:51:13 +06:00
|
|
|
(match_expression
|
2024-03-21 20:44:35 +09:00
|
|
|
body: (match_block
|
|
|
|
|
"}" @indent.end))
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2022-01-21 19:51:13 +06:00
|
|
|
(mod_item
|
2024-03-21 20:44:35 +09:00
|
|
|
body: (declaration_list
|
|
|
|
|
"}" @indent.end))
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2022-01-21 19:51:13 +06:00
|
|
|
(struct_item
|
2024-03-21 20:44:35 +09:00
|
|
|
body: (field_declaration_list
|
|
|
|
|
"}" @indent.end))
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2024-03-21 06:33:27 -04:00
|
|
|
(struct_expression
|
2024-03-21 20:44:35 +09:00
|
|
|
body: (field_initializer_list
|
|
|
|
|
"}" @indent.end))
|
2024-03-21 06:33:27 -04:00
|
|
|
|
|
|
|
|
(struct_pattern
|
|
|
|
|
"}" @indent.end)
|
|
|
|
|
|
2024-03-26 21:23:03 -04:00
|
|
|
(tuple_struct_pattern
|
|
|
|
|
")" @indent.end)
|
|
|
|
|
|
2024-04-03 18:48:19 -05:00
|
|
|
(tuple_type
|
|
|
|
|
")" @indent.end)
|
|
|
|
|
|
2024-04-04 10:12:31 -05:00
|
|
|
(tuple_pattern
|
|
|
|
|
")" @indent.end)
|
|
|
|
|
|
2022-01-21 19:51:13 +06:00
|
|
|
(trait_item
|
2024-03-21 20:44:35 +09:00
|
|
|
body: (declaration_list
|
|
|
|
|
"}" @indent.end))
|
2022-01-21 19:51:13 +06:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(impl_item
|
|
|
|
|
(where_clause) @indent.dedent)
|
2021-01-05 19:26:08 +07:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"where"
|
|
|
|
|
")"
|
|
|
|
|
"]"
|
|
|
|
|
"}"
|
2023-03-20 14:44:39 -07:00
|
|
|
] @indent.branch
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(impl_item
|
|
|
|
|
(declaration_list) @indent.branch)
|
2021-03-01 20:20:37 +07:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
(line_comment)
|
2022-01-18 21:17:26 +06:00
|
|
|
(string_literal)
|
2023-03-20 14:44:39 -07:00
|
|
|
] @indent.ignore
|
2022-01-18 21:17:26 +06:00
|
|
|
|
2023-03-20 14:44:39 -07:00
|
|
|
(raw_string_literal) @indent.auto
|