typescript: Add highlighting for Angular inline components (#26553)
Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ... Before <img width="1004" alt="image" src="https://github.com/user-attachments/assets/9a611e8d-e00e-4dc7-b4c9-bd76fec95525" /> After <img width="936" alt="Image" src="https://github.com/user-attachments/assets/b83d3309-1aab-492c-a2f1-c45cd19e6bcc" />
This commit is contained in:
parent
f61d3d28e0
commit
fdcacb3849
1 changed files with 37 additions and 0 deletions
|
@ -62,3 +62,40 @@
|
|||
arguments: (arguments (template_string (string_fragment) @injection.content
|
||||
(#set! injection.language "graphql")))
|
||||
)
|
||||
|
||||
;; Angular Component template injection
|
||||
(call_expression
|
||||
function: [
|
||||
(identifier) @_decorator (#eq? @_decorator "Component")
|
||||
(member_expression property: (property_identifier) @_decorator (#eq? @_decorator "Component"))
|
||||
]
|
||||
arguments: (arguments (object
|
||||
(pair
|
||||
key: (property_identifier) @_prop (#eq? @_prop "template")
|
||||
value: [
|
||||
(string) @injection.content
|
||||
(template_string) @injection.content
|
||||
(template_string (string_fragment) @injection.content)
|
||||
]
|
||||
)))
|
||||
(#set! injection.language "angular"))
|
||||
|
||||
;; Angular Component styles injection
|
||||
(call_expression
|
||||
function: [
|
||||
(identifier) @_decorator (#eq? @_decorator "Component")
|
||||
(member_expression property: (property_identifier) @_decorator (#eq? @_decorator "Component"))
|
||||
]
|
||||
arguments: (arguments (object
|
||||
(pair
|
||||
key: (property_identifier) @_prop (#eq? @_prop "styles")
|
||||
value: [
|
||||
(string) @injection.content
|
||||
(template_string) @injection.content
|
||||
(template_string (string_fragment) @injection.content)
|
||||
(array (string) @injection.content)
|
||||
(array (template_string) @injection.content)
|
||||
(array (template_string (string_fragment)) @injection.content)
|
||||
]
|
||||
)))
|
||||
(#set! injection.language "css"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue