Add CSS language injections for calls to styled
(#33966)
…emotion). Closes: https://github.com/zed-industries/zed/issues/17026 Release Notes: - Added CSS language injection support for styled-components and emotion in JavaScript, TypeScript, and TSX files.
This commit is contained in:
parent
69127d2bea
commit
fda5111dc0
3 changed files with 45 additions and 0 deletions
|
@ -11,6 +11,21 @@
|
||||||
(#set! injection.language "css"))
|
(#set! injection.language "css"))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (member_expression
|
||||||
|
object: (identifier) @_obj (#eq? @_obj "styled")
|
||||||
|
property: (property_identifier))
|
||||||
|
arguments: (template_string (string_fragment) @injection.content
|
||||||
|
(#set! injection.language "css"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (call_expression
|
||||||
|
function: (identifier) @_name (#eq? @_name "styled"))
|
||||||
|
arguments: (template_string (string_fragment) @injection.content
|
||||||
|
(#set! injection.language "css"))
|
||||||
|
)
|
||||||
|
|
||||||
(call_expression
|
(call_expression
|
||||||
function: (identifier) @_name (#eq? @_name "html")
|
function: (identifier) @_name (#eq? @_name "html")
|
||||||
arguments: (template_string) @injection.content
|
arguments: (template_string) @injection.content
|
||||||
|
|
|
@ -11,6 +11,21 @@
|
||||||
(#set! injection.language "css"))
|
(#set! injection.language "css"))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (member_expression
|
||||||
|
object: (identifier) @_obj (#eq? @_obj "styled")
|
||||||
|
property: (property_identifier))
|
||||||
|
arguments: (template_string (string_fragment) @injection.content
|
||||||
|
(#set! injection.language "css"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (call_expression
|
||||||
|
function: (identifier) @_name (#eq? @_name "styled"))
|
||||||
|
arguments: (template_string (string_fragment) @injection.content
|
||||||
|
(#set! injection.language "css"))
|
||||||
|
)
|
||||||
|
|
||||||
(call_expression
|
(call_expression
|
||||||
function: (identifier) @_name (#eq? @_name "html")
|
function: (identifier) @_name (#eq? @_name "html")
|
||||||
arguments: (template_string (string_fragment) @injection.content
|
arguments: (template_string (string_fragment) @injection.content
|
||||||
|
|
|
@ -15,6 +15,21 @@
|
||||||
(#set! injection.language "css"))
|
(#set! injection.language "css"))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (member_expression
|
||||||
|
object: (identifier) @_obj (#eq? @_obj "styled")
|
||||||
|
property: (property_identifier))
|
||||||
|
arguments: (template_string (string_fragment) @injection.content
|
||||||
|
(#set! injection.language "css"))
|
||||||
|
)
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (call_expression
|
||||||
|
function: (identifier) @_name (#eq? @_name "styled"))
|
||||||
|
arguments: (template_string (string_fragment) @injection.content
|
||||||
|
(#set! injection.language "css"))
|
||||||
|
)
|
||||||
|
|
||||||
(call_expression
|
(call_expression
|
||||||
function: (identifier) @_name (#eq? @_name "html")
|
function: (identifier) @_name (#eq? @_name "html")
|
||||||
arguments: (template_string) @injection.content
|
arguments: (template_string) @injection.content
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue