mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-21 12:50:09 -04:00
With large if/else/else if blocks, it's difficult to notice that folding an if statement also folds the else and else if statements along with them. By allowing the folds of the if, else, and else if statements to be separate, the folds are easier to distinguish and are more granular.
32 lines
602 B
Scheme
32 lines
602 B
Scheme
[
|
|
(arguments)
|
|
(for_in_statement)
|
|
(for_statement)
|
|
(while_statement)
|
|
(arrow_function)
|
|
(function_expression)
|
|
(function_declaration)
|
|
(class_declaration)
|
|
(method_definition)
|
|
(do_statement)
|
|
(with_statement)
|
|
(switch_statement)
|
|
(switch_case)
|
|
(switch_default)
|
|
(import_statement)+
|
|
(if_statement)
|
|
(try_statement)
|
|
(catch_clause)
|
|
(array)
|
|
(object)
|
|
(generator_function)
|
|
(generator_function_declaration)
|
|
] @fold
|
|
|
|
(if_statement
|
|
consequence: (statement_block) @fold
|
|
(#offset! @fold 0 0 -1 0))
|
|
|
|
(if_statement
|
|
alternative: (else_clause) @fold
|
|
(#offset! @fold 0 0 -1 0))
|