feat(angular)!: switch to parser supporting v17 (#5779)

This commit is contained in:
Dennis van den Berg 2024-01-27 12:17:25 +01:00 committed by GitHub
parent 589fa77c23
commit 2fb2100fed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 159 additions and 52 deletions

View file

@ -137,3 +137,65 @@
(string
(string_fragment) @injection.content)
(#set! injection.language "html"))
;---- Angular injections -----
; @Component({
; template: `<html>`
; })
(decorator
(call_expression
function:
((identifier) @_name
(#eq? @_name "Component"))
arguments:
(arguments
(object
(pair
key:
((property_identifier) @_prop
(#eq? @_prop "template"))
value:
((template_string) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "angular")))))))
; @Component({
; styles: [`<css>`]
; })
(decorator
(call_expression
function:
((identifier) @_name
(#eq? @_name "Component"))
arguments:
(arguments
(object
(pair
key:
((property_identifier) @_prop
(#eq? @_prop "styles"))
value:
(array
((template_string) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "css"))))))))
; @Component({
; styles: `<css>`
; })
(decorator
(call_expression
function:
((identifier) @_name
(#eq? @_name "Component"))
arguments:
(arguments
(object
(pair
key:
((property_identifier) @_prop
(#eq? @_prop "styles"))
value:
((template_string) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "css")))))))