mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
fix(typescript): support type param for styled components (#8066)
This commit is contained in:
parent
53049d6678
commit
896e92a7f6
2 changed files with 28 additions and 1 deletions
|
|
@ -1 +1 @@
|
|||
; inherits: ecma,jsx
|
||||
; inherits: typescript,jsx
|
||||
|
|
|
|||
|
|
@ -1 +1,28 @@
|
|||
; inherits: ecma
|
||||
|
||||
; styled.div<{}>`<css>`
|
||||
(call_expression
|
||||
function: (non_null_expression
|
||||
(instantiation_expression
|
||||
(member_expression
|
||||
object: (identifier) @_name
|
||||
(#eq? @_name "styled")
|
||||
property: (property_identifier))
|
||||
type_arguments: (type_arguments)))
|
||||
arguments: ((template_string) @injection.content
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.language "styled")))
|
||||
|
||||
; styled.div<T>`<css>`
|
||||
(binary_expression
|
||||
left: (binary_expression
|
||||
left: (member_expression
|
||||
object: (identifier) @_name
|
||||
(#eq? @_name "styled")
|
||||
property: (property_identifier))
|
||||
right: (identifier))
|
||||
right: (template_string) @injection.content
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.language "styled"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue