2021-03-07 22:08:43 +07:00
|
|
|
[
|
|
|
|
|
(class_body)
|
|
|
|
|
(function_body)
|
2023-04-11 21:05:00 +02:00
|
|
|
(function_expression_body)
|
2021-03-07 22:08:43 +07:00
|
|
|
(declaration (initializers))
|
|
|
|
|
(switch_block)
|
|
|
|
|
(if_statement)
|
|
|
|
|
(formal_parameter_list)
|
|
|
|
|
(formal_parameter)
|
|
|
|
|
(list_literal)
|
|
|
|
|
(return_statement)
|
|
|
|
|
(arguments)
|
2023-04-10 08:52:50 +02:00
|
|
|
(try_statement)
|
2023-03-20 14:44:39 -07:00
|
|
|
] @indent.begin
|
2021-03-07 22:08:43 +07:00
|
|
|
|
2023-04-13 01:42:53 +09:00
|
|
|
(switch_block
|
|
|
|
|
(_) @indent.begin
|
|
|
|
|
(#set! indent.immediate 1)
|
|
|
|
|
(#set! indent.start_at_same_line 1))
|
|
|
|
|
|
|
|
|
|
(switch_label) @indent.branch
|
|
|
|
|
|
2021-03-07 22:08:43 +07:00
|
|
|
[
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
"{"
|
|
|
|
|
"}"
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
2023-03-20 14:44:39 -07:00
|
|
|
] @indent.branch
|
2021-03-07 22:08:43 +07:00
|
|
|
|
2023-02-25 05:06:31 +08:00
|
|
|
[
|
|
|
|
|
"}"
|
2023-03-20 14:44:39 -07:00
|
|
|
] @indent.end
|
2023-02-25 05:06:31 +08:00
|
|
|
|
2023-04-13 01:42:53 +09:00
|
|
|
(return_statement ";" @indent.end)
|
|
|
|
|
(break_statement ";" @indent.end)
|
|
|
|
|
|
2021-03-07 22:08:43 +07:00
|
|
|
; this one is for dedenting the else block
|
2023-03-20 14:44:39 -07:00
|
|
|
(if_statement (block) @indent.branch)
|
2021-03-07 22:08:43 +07:00
|
|
|
|
2023-03-20 14:44:39 -07:00
|
|
|
(comment) @indent.ignore
|