mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-04 04:20:09 -04:00
fix: remove upstreamed directives
`#inject-lang!` and `#trim!`; fix `set-lang-from-mimetype`
This commit is contained in:
parent
dd6ec13268
commit
f13420ccff
7 changed files with 11 additions and 135 deletions
|
|
@ -1,26 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((function_call
|
||||
name: (ident) @_name
|
||||
.
|
||||
(simplexpr)
|
||||
.
|
||||
(simplexpr
|
||||
(string
|
||||
(string_fragment) @injection.content)+))
|
||||
(#any-of? @_name "replace" "search" "matches" "captures")
|
||||
(#set! injection.language "regex")
|
||||
(#set! injection.combined))
|
||||
|
||||
((function_call
|
||||
name: (ident) @_name
|
||||
.
|
||||
(simplexpr)
|
||||
.
|
||||
(simplexpr
|
||||
(string
|
||||
(string_fragment) @injection.content)+))
|
||||
(#eq? @_name "jq")
|
||||
(#set! injection.language "jq")
|
||||
(#set! injection.combined))
|
||||
|
|
|
|||
|
|
@ -3,5 +3,4 @@
|
|||
|
||||
(heredoc_template
|
||||
(template_literal) @injection.content
|
||||
(heredoc_identifier) @injection.language
|
||||
(#downcase! @injection.language))
|
||||
(heredoc_identifier) @injection.language)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
(#set! injection.language "xml"))
|
||||
|
||||
(multiline_string
|
||||
(multiline_string_type) @_lang
|
||||
(multiline_string_type) @injection.language
|
||||
(multiline_string_content) @injection.content
|
||||
(#set-lang-from-info-string! @_lang)
|
||||
(#set! injection.combined))
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
(fenced_code_block
|
||||
(info_string
|
||||
(language) @_lang)
|
||||
(code_fence_content) @injection.content
|
||||
(#set-lang-from-info-string! @_lang))
|
||||
(language) @injection.language)
|
||||
(code_fence_content) @injection.content)
|
||||
|
||||
((html_block) @injection.content
|
||||
(#set! injection.language "html")
|
||||
|
|
|
|||
|
|
@ -4,14 +4,12 @@
|
|||
(heredoc
|
||||
(heredoc_body) @injection.content
|
||||
(heredoc_end) @injection.language
|
||||
(#set! injection.include-children)
|
||||
(#downcase! @injection.language))
|
||||
(#set! injection.include-children))
|
||||
|
||||
(nowdoc
|
||||
(nowdoc_body) @injection.content
|
||||
(heredoc_end) @injection.language
|
||||
(#set! injection.include-children)
|
||||
(#downcase! @injection.language))
|
||||
(#set! injection.include-children))
|
||||
|
||||
; regex
|
||||
((function_call_expression
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
|
||||
(heredoc_body
|
||||
(heredoc_content) @injection.content
|
||||
(heredoc_end) @injection.language
|
||||
(#downcase! @injection.language))
|
||||
(heredoc_end) @injection.language)
|
||||
|
||||
(regex
|
||||
(string_content) @injection.content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue