mirror of
https://github.com/nvim-treesitter/nvim-treesitter
synced 2024-09-16 14:34:05 +02:00
feat(javascript): update parser and queries
This commit is contained in:
parent
e090c5b22d
commit
a1573a9135
2 changed files with 24 additions and 53 deletions
|
@ -354,7 +354,7 @@
|
|||
"revision": "245b05c6ba900fa708242835f6168ef76f9d951e"
|
||||
},
|
||||
"javascript": {
|
||||
"revision": "15887341e5b57ffdb423aff840aef142b8f53d6d"
|
||||
"revision": "463fec0831011cab830429fbe1da2796cfc1cfb4"
|
||||
},
|
||||
"jq": {
|
||||
"revision": "13990f530e8e6709b7978503da9bc8701d366791"
|
||||
|
|
|
@ -7,11 +7,7 @@
|
|||
|
||||
; html(`...`), html`...`, sql(`...`), etc.
|
||||
(call_expression
|
||||
function: [
|
||||
(await_expression
|
||||
(identifier) @injection.language)
|
||||
(identifier) @injection.language
|
||||
]
|
||||
function: (identifier) @injection.language
|
||||
arguments: [
|
||||
(arguments
|
||||
(template_string) @injection.content)
|
||||
|
@ -27,13 +23,8 @@
|
|||
|
||||
; svg`...` or svg(`...`)
|
||||
(call_expression
|
||||
function: [
|
||||
(await_expression
|
||||
(identifier) @_name
|
||||
(#eq? @_name "svg"))
|
||||
((identifier) @_name
|
||||
(#eq? @_name "svg"))
|
||||
]
|
||||
function: (identifier) @_name
|
||||
(#eq? @_name "svg")
|
||||
arguments: [
|
||||
(arguments
|
||||
(template_string) @injection.content)
|
||||
|
@ -46,13 +37,8 @@
|
|||
; Vercel PostgreSQL
|
||||
; foo.sql`...` or foo.sql(`...`)
|
||||
(call_expression
|
||||
function: [
|
||||
(await_expression
|
||||
(member_expression
|
||||
property: (property_identifier) @injection.language))
|
||||
(member_expression
|
||||
property: (property_identifier) @injection.language)
|
||||
]
|
||||
function: (member_expression
|
||||
property: (property_identifier) @injection.language)
|
||||
arguments: [
|
||||
(arguments
|
||||
(template_string) @injection.content)
|
||||
|
@ -63,44 +49,29 @@
|
|||
(#set! injection.include-children))
|
||||
|
||||
(call_expression
|
||||
function: [
|
||||
(await_expression
|
||||
(identifier) @_name
|
||||
(#eq? @_name "gql"))
|
||||
((identifier) @_name
|
||||
(#eq? @_name "gql"))
|
||||
]
|
||||
arguments: ((template_string) @injection.content
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.language "graphql")))
|
||||
function: (identifier) @_name
|
||||
(#eq? @_name "gql")
|
||||
arguments: (template_string) @injection.content
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.language "graphql"))
|
||||
|
||||
(call_expression
|
||||
function: [
|
||||
(await_expression
|
||||
(identifier) @_name
|
||||
(#eq? @_name "hbs"))
|
||||
((identifier) @_name
|
||||
(#eq? @_name "hbs"))
|
||||
]
|
||||
arguments: ((template_string) @injection.content
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.language "glimmer")))
|
||||
function: (identifier) @_name
|
||||
(#eq? @_name "hbs")
|
||||
arguments: (template_string) @injection.content
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.language "glimmer"))
|
||||
|
||||
; css`<css>`, keyframes`<css>`
|
||||
(call_expression
|
||||
function: [
|
||||
(await_expression
|
||||
(identifier) @_name
|
||||
(#any-of? @_name "css" "keyframes"))
|
||||
((identifier) @_name
|
||||
(#any-of? @_name "css" "keyframes"))
|
||||
]
|
||||
arguments: ((template_string) @injection.content
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.language "styled")))
|
||||
function: (identifier) @_name
|
||||
(#any-of? @_name "css" "keyframes")
|
||||
arguments: (template_string) @injection.content
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.language "styled"))
|
||||
|
||||
; styled.div`<css>`
|
||||
(call_expression
|
||||
|
|
Loading…
Reference in a new issue