aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/python/indents.scm
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries/python/indents.scm')
-rw-r--r--runtime/queries/python/indents.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/runtime/queries/python/indents.scm b/runtime/queries/python/indents.scm
index 743971ad..835b40d3 100644
--- a/runtime/queries/python/indents.scm
+++ b/runtime/queries/python/indents.scm
@@ -29,6 +29,19 @@
(class_definition)
] @indent
+; Workaround for the tree-sitter grammar creating large errors when a
+; try_statement is missing the except/finally clause
+(ERROR
+ "try"
+ .
+ ":" @indent @extend)
+(ERROR
+ .
+ "def") @indent @extend
+(ERROR
+ (block) @indent @extend
+ (#set! "scope" "all"))
+
[
(if_statement)
(for_statement)