mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 10:20:11 -04:00
feat: add gotemplate and helm parser support
This commit is contained in:
parent
f8d4e5c1ba
commit
9e1f3c3369
7 changed files with 252 additions and 0 deletions
39
queries/helm/injections.scm
Normal file
39
queries/helm/injections.scm
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
; inherits: gotmpl
|
||||
|
||||
((text) @injection.content
|
||||
(#set! injection.language "yaml")
|
||||
(#set! injection.combined))
|
||||
|
||||
; {{ regexFind "[a-zA-Z][1-9]" "abcd1234" }}
|
||||
(function_call
|
||||
function: (identifier) @_function
|
||||
arguments:
|
||||
(argument_list
|
||||
.
|
||||
(interpreted_string_literal) @injection.content)
|
||||
(#any-of? @_function
|
||||
"regexMatch" "mustRegexMatch" "regexFindAll" "mustRegexFinDall" "regexFind" "mustRegexFind"
|
||||
"regexReplaceAll" "mustRegexReplaceAll" "regexReplaceAllLiteral" "mustRegexReplaceAllLiteral"
|
||||
"regexSplit" "mustRegexSplit")
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
(function_call
|
||||
function: (identifier) @_function
|
||||
arguments:
|
||||
(argument_list
|
||||
.
|
||||
(interpreted_string_literal) @injection.content)
|
||||
(#any-of? @_function "fromYaml" "fromYamlArray")
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.language "yaml"))
|
||||
|
||||
(function_call
|
||||
function: (identifier) @_function
|
||||
arguments:
|
||||
(argument_list
|
||||
.
|
||||
(interpreted_string_literal) @injection.content)
|
||||
(#any-of? @_function "fromJson" "fromJsonArray")
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.language "json"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue