mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 20:00:07 -04:00
feat: import statement folds for common languages
This commit is contained in:
parent
f58cae6c22
commit
9a47a523e3
8 changed files with 18 additions and 4 deletions
|
|
@ -16,6 +16,7 @@
|
||||||
(preproc_function_def)
|
(preproc_function_def)
|
||||||
(initializer_list)
|
(initializer_list)
|
||||||
(gnu_asm_expression)
|
(gnu_asm_expression)
|
||||||
|
(preproc_include)+
|
||||||
] @fold
|
] @fold
|
||||||
|
|
||||||
(compound_statement
|
(compound_statement
|
||||||
|
|
|
||||||
|
|
@ -8,4 +8,7 @@ accessors: (accessor_list) @fold
|
||||||
|
|
||||||
initializer: (initializer_expression) @fold
|
initializer: (initializer_expression) @fold
|
||||||
|
|
||||||
(block) @fold
|
[
|
||||||
|
(block)
|
||||||
|
(using_directive)+
|
||||||
|
] @fold
|
||||||
|
|
|
||||||
|
|
@ -1 +1,4 @@
|
||||||
(rule_set) @fold
|
[
|
||||||
|
(rule_set)
|
||||||
|
(import_statement)+
|
||||||
|
] @fold
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
(switch_statement)
|
(switch_statement)
|
||||||
(switch_case)
|
(switch_case)
|
||||||
(switch_default)
|
(switch_default)
|
||||||
(import_statement)
|
(import_statement)+
|
||||||
(if_statement)
|
(if_statement)
|
||||||
(try_statement)
|
(try_statement)
|
||||||
(catch_clause)
|
(catch_clause)
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,5 @@
|
||||||
(exp_apply)
|
(exp_apply)
|
||||||
(exp_do)
|
(exp_do)
|
||||||
(function)
|
(function)
|
||||||
|
(import)+
|
||||||
] @fold
|
] @fold
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,5 @@
|
||||||
(constructor_declaration)
|
(constructor_declaration)
|
||||||
(argument_list)
|
(argument_list)
|
||||||
(annotation_argument_list)
|
(annotation_argument_list)
|
||||||
|
(import_declaration)+
|
||||||
] @fold
|
] @fold
|
||||||
|
|
|
||||||
|
|
@ -21,3 +21,8 @@
|
||||||
(dictionary)
|
(dictionary)
|
||||||
(string)
|
(string)
|
||||||
] @fold
|
] @fold
|
||||||
|
|
||||||
|
[
|
||||||
|
(import_statement)
|
||||||
|
(import_from_statement)
|
||||||
|
]+ @fold
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
(type_item)
|
(type_item)
|
||||||
(union_item)
|
(union_item)
|
||||||
(const_item)
|
(const_item)
|
||||||
(use_declaration)
|
(use_declaration)+
|
||||||
(let_declaration)
|
(let_declaration)
|
||||||
(loop_expression)
|
(loop_expression)
|
||||||
(for_expression)
|
(for_expression)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue