mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 18:00:07 -04:00
feat(angular)!: switch to parser supporting v17 (#5779)
This commit is contained in:
parent
589fa77c23
commit
2fb2100fed
9 changed files with 159 additions and 52 deletions
|
|
@ -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")))))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue