[language-python] Prevent type annotations from hinting at indents

This commit is contained in:
Andrew Dupont 2024-04-11 17:53:25 -07:00
parent bf62b01757
commit 03af1244d3

View File

@ -1,10 +1,16 @@
; Excluding dictionary key/value separators…
(dictionary
(pair ":" @_IGNORE_
(#set! capture.final true)))
(#set! capture.final)))
; …lambda functions…
((lambda ":" @_IGNORE_)
(#set! capture.final true))
(#set! capture.final))
; …and type annotations on function parameters/class members…
(":" @_IGNORE_ . (type) (#set! capture.final))
; …all other colons we encounter hint at upcoming indents.
":" @indent
; When typing out "else" after an "if" statement, tree-sitter-python won't