on master help sign in
Improve indent queries for python in specific cases (#5332)
873434bTriton171
runtime/queries/python/indents.scm+13
@@ -29,6 +29,19 @@
29 (class_definition)
29 (class_definition)
30] @indent
30] @indent
31
31
32+; Workaround for the tree-sitter grammar creating large errors when a
33+; try_statement is missing the except/finally clause
34+(ERROR
35+ "try"
36+ .
37+ ":" @indent @extend)
38+(ERROR
39+ .
40+ "def") @indent @extend
41+(ERROR
42+ (block) @indent @extend
43+ (#set! "scope" "all"))
44+
32[
45[
33 (if_statement)
46 (if_statement)
34 (for_statement)
47 (for_statement)