Files
nvim/queries/gotmpl/injections.scm
T

39 lines
1.1 KiB
Scheme

; SPDX-License-Identifier: Apache-2.0
; Source: nvim-treesitter (https://github.com/nvim-treesitter/nvim-treesitter)
((comment) @injection.content
(#set! injection.language "comment"))
; {{"put" | printf "%s%s" "out" | printf "%q"}}
(function_call
function: (identifier) @_function
arguments: (argument_list
.
(interpreted_string_literal) @injection.content)
(#eq? @_function "printf")
(#set! injection.language "printf"))
; {{ js "var a = 1 + 1" }}
(function_call
function: (identifier) @_function
arguments: (argument_list
.
(interpreted_string_literal) @injection.content)
(#eq? @_function "js")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "javascript"))
; {{ html "<h1>hello</h1>" }}
(function_call
function: (identifier) @_function
arguments: (argument_list
.
(interpreted_string_literal) @injection.content)
(#eq? @_function "html")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "html"))
((text) @injection.content
(#set! injection.language "html")
(#set! injection.combined))