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:
Zach Riegel 2025-08-25 08:30:09 -07:00 committed by GitHub
parent 69127d2bea
commit fda5111dc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 45 additions and 0 deletions

View file

@ -11,6 +11,21 @@
(#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
function: (identifier) @_name (#eq? @_name "html")
arguments: (template_string) @injection.content

View file

@ -11,6 +11,21 @@
(#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
function: (identifier) @_name (#eq? @_name "html")
arguments: (template_string (string_fragment) @injection.content

View file

@ -15,6 +15,21 @@
(#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
function: (identifier) @_name (#eq? @_name "html")
arguments: (template_string) @injection.content