2022-03-30 17:08:07 +02:00
|
|
|
[
|
|
|
|
(import_declaration)
|
|
|
|
(const_declaration)
|
|
|
|
(type_declaration)
|
|
|
|
(type_spec)
|
|
|
|
(func_literal)
|
|
|
|
(literal_value)
|
2022-12-02 15:06:35 +01:00
|
|
|
(literal_element)
|
2022-03-30 17:08:07 +02:00
|
|
|
(keyed_element)
|
|
|
|
(expression_case)
|
|
|
|
(default_case)
|
|
|
|
(type_case)
|
|
|
|
(communication_case)
|
|
|
|
(argument_list)
|
|
|
|
(field_declaration_list)
|
|
|
|
(block)
|
2022-11-27 16:36:52 +01:00
|
|
|
(var_declaration)
|
2022-03-30 17:08:07 +02:00
|
|
|
] @indent
|
|
|
|
|
|
|
|
[
|
|
|
|
"]"
|
|
|
|
")"
|
|
|
|
] @outdent
|
2023-02-08 08:17:34 +01:00
|
|
|
|
2023-04-26 01:05:23 +02:00
|
|
|
; Switches and selects aren't indented, only their case bodies are.
|
|
|
|
; Outdent all closing braces except those closing switches or selects.
|
|
|
|
(
|
|
|
|
(_ "}" @outdent) @outer
|
|
|
|
(#not-kind-eq? @outer "select_statement")
|
|
|
|
(#not-kind-eq? @outer "type_switch_statement")
|
|
|
|
(#not-kind-eq? @outer "expression_switch_statement")
|
|
|
|
)
|
|
|
|
|
|
|
|
; Starting a line after a new case should indent.
|
|
|
|
[
|
|
|
|
(communication_case)
|
|
|
|
(expression_case)
|
|
|
|
(default_case)
|
|
|
|
(type_case)
|
|
|
|
] @extend
|