fixed python injections

This commit is contained in:
2024-06-06 01:30:40 -05:00
parent 486d276778
commit cbe3db74f4
2 changed files with 37 additions and 12 deletions
+34 -9
View File
@@ -1,31 +1,56 @@
(type (string (string_content) @python))
(type
(string
(string_content) @injection.content
(#set! injection.include-children)
(#set! injection.language "python")))
(type (subscript (string (string_content) @python)))
(type
(subscript
(string
(string_content) @injection.content
(#set! injection.include-children)
(#set! injection.language "python"))))
((assignment
(type (identifier) @_type)
(string (string_content) @python))
(type
(identifier) @_type)
(string
(string_content) @injection.content
(#set! injection.include-children)
(#set! injection.language "python")))
(#eq? @_type "TypeAlias"))
((assignment
(type (string (string_content) @_type))
(string (string_content) @python))
(type
(string
(string_content) @_type))
(string
(string_content) @injection.content
(#set! injection.include-children)
(#set! injection.language "python")))
(#eq? @_type "TypeAlias"))
(class_definition
(argument_list
(subscript
(string
(string_content) @python))))
(string_content) @injection.content
(#set! injection.include-children)
(#set! injection.language "python")))))
(((string (string_content) @python) @_str)
(((string
(string_content) @injection.content
(#set! injection.include-children)
(#set! injection.language "python")) @_str)
(#match? @_str "^r.*$"))
((call
(identifier) @_function
(argument_list
(string
(string_content) @python)))
(string_content) @injection.content
(#set! injection.include-children)
(#set! injection.language "python"))))
(#any-of? @_function "cast" "NewType" "TypeVar" "TypedDict"))
; Too slow