nvim-treesitter/queries/http/injections.scm

28 lines
652 B
Scheme

; Comments
((comment) @injection.content
(#set! injection.language "comment"))
; Body
((json_body) @injection.content
(#set! injection.language "json"))
((xml_body) @injection.content
(#set! injection.language "xml"))
((graphql_data) @injection.content
(#set! injection.language "graphql"))
; Script (default to javascript)
((script) @injection.content
(#offset! @injection.content 0 2 0 -2)
(#set! injection.language "javascript"))
; Script with other languages
((comment
name: (_) @_name
(#eq? @_name "lang")
value: (_) @injection.language)
.
(_
(script) @injection.content
(#offset! @injection.content 0 2 0 -2)))