fix: remove upstreamed directives

`#inject-lang!` and `#trim!`; fix `set-lang-from-mimetype`
This commit is contained in:
Christian Clason 2023-06-24 14:33:45 +02:00
parent dd6ec13268
commit f13420ccff
7 changed files with 11 additions and 135 deletions

View file

@ -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))

View file

@ -3,5 +3,4 @@
(heredoc_template
(template_literal) @injection.content
(heredoc_identifier) @injection.language
(#downcase! @injection.language))
(heredoc_identifier) @injection.language)

View file

@ -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))

View file

@ -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")

View file

@ -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

View file

@ -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