aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python
diff options
context:
space:
mode:
authorSantos Gallegos <stsewd@protonmail.com>2020-09-03 11:09:57 -0500
committerThomas Vigouroux <tomvig38@gmail.com>2020-09-03 18:14:28 +0200
commitbdf43b15df799ae12fadd4eb214e13704454dd98 (patch)
tree31f9c03ab6307fc5b20fc1902bd84d4ea95ab427 /queries/python
parentAdd warning about required Neovim version (diff)
downloadnvim-treesitter-bdf43b15df799ae12fadd4eb214e13704454dd98.tar
nvim-treesitter-bdf43b15df799ae12fadd4eb214e13704454dd98.tar.gz
nvim-treesitter-bdf43b15df799ae12fadd4eb214e13704454dd98.tar.bz2
nvim-treesitter-bdf43b15df799ae12fadd4eb214e13704454dd98.tar.lz
nvim-treesitter-bdf43b15df799ae12fadd4eb214e13704454dd98.tar.xz
nvim-treesitter-bdf43b15df799ae12fadd4eb214e13704454dd98.tar.zst
nvim-treesitter-bdf43b15df799ae12fadd4eb214e13704454dd98.zip
Python: add folds
Diffstat (limited to 'queries/python')
-rw-r--r--queries/python/fold.scm24
1 files changed, 24 insertions, 0 deletions
diff --git a/queries/python/fold.scm b/queries/python/fold.scm
new file mode 100644
index 000000000..22e03b426
--- /dev/null
+++ b/queries/python/fold.scm
@@ -0,0 +1,24 @@
+(function_definition (block) @fold)
+(class_definition (block) @fold)
+
+(while_statement (block) @fold)
+(for_statement (block) @fold)
+(if_statement (block) @fold)
+(with_statement (block) @fold)
+(try_statement (block) @fold)
+
+[
+ (import_from_statement)
+ (parameters)
+
+ (parenthesized_expression)
+ (generator_expression)
+ (list_comprehension)
+ (set_comprehension)
+ (dictionary_comprehension)
+
+ (tuple)
+ (list)
+ (set)
+ (dictionary)
+] @fold