typescript treesitter injection for angular templates
This commit is contained in:
@@ -1,21 +1,14 @@
|
||||
((attribute
|
||||
(attribute_name) @_alpine
|
||||
(quoted_attribute_value (attribute_value) @javascript))
|
||||
(quoted_attribute_value
|
||||
(attribute_value) @javascript))
|
||||
(#lua-match? @_alpine "^[@:]%l+.-$"))
|
||||
|
||||
((attribute
|
||||
(attribute_name) @_alpine
|
||||
(quoted_attribute_value (attribute_value) @javascript))
|
||||
(quoted_attribute_value
|
||||
(attribute_value) @javascript))
|
||||
(#lua-match? @_alpine "^x[-]%l+$"))
|
||||
|
||||
(script_element
|
||||
(raw_text) @javascript)
|
||||
|
||||
;((text) @htmldjango (#lua-match? @htmldjango "^{%p%s+%l+.-%s+%p}$"))
|
||||
;
|
||||
;((text) @htmldjango (#lua-match? @htmldjango "^{{%s+.-%s+}}$"))
|
||||
;
|
||||
;((attribute
|
||||
; (quoted_attribute_value (attribute_value) @htmldjango))
|
||||
; (#lua-match? @htmldjango "^{{%s+.-%s+}}$"))
|
||||
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
(type (string (string_content) @python))
|
||||
|
||||
((assignment
|
||||
(type (identifier) @_type)
|
||||
(string (string_content) @python))
|
||||
(type
|
||||
(identifier) @_type)
|
||||
(string
|
||||
(string_content) @python))
|
||||
(#eq? @_type "TypeAlias"))
|
||||
|
||||
((assignment
|
||||
(type (string (string_content) @_type))
|
||||
(string (string_content) @python))
|
||||
(type
|
||||
(string
|
||||
(string_content) @_type))
|
||||
(string
|
||||
(string_content) @python))
|
||||
(#eq? @_type "TypeAlias"))
|
||||
|
||||
(class_definition (argument_list (subscript (string (string_content) @python))))
|
||||
(class_definition
|
||||
(argument_list
|
||||
(subscript
|
||||
(string
|
||||
(string_content) @python))))
|
||||
|
||||
(((string (string_content) @python) @_str)
|
||||
(#match? @_str "^r.*$"))
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
; angular inline templates
|
||||
((decorator
|
||||
(call_expression
|
||||
(identifier) @_decorator
|
||||
(arguments
|
||||
(object
|
||||
(pair
|
||||
(property_identifier) @_key
|
||||
(template_string) @html)))))
|
||||
(#eq? @_decorator "Component") (#eq? @_key "template"))
|
||||
Reference in New Issue
Block a user