Improve indent queries for python in specific cases (#5332)

where the tree-sitter completely fails to parse incomplete code.
This commit is contained in:
Triton171 2023-01-07 06:39:31 +01:00 committed by GitHub
parent 9f0d939f25
commit 873434b927
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)