mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
injections(nix): dynamic language injection via comments
This commit is contained in:
parent
776e4d341b
commit
811e8ba4f3
1 changed files with 9 additions and 0 deletions
|
|
@ -1,6 +1,15 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((comment) @injection.language
|
||||
. ; this is to make sure only adjacent comments are accounted for the injections
|
||||
[
|
||||
(string_expression (string_fragment) @injection.content)
|
||||
(indented_string_expression (string_fragment) @injection.content)
|
||||
]
|
||||
(#gsub! @injection.language "/%*%s*([%w%p]+)%s*%*/" "%1")
|
||||
(#set! injection.combined))
|
||||
|
||||
(apply_expression
|
||||
function: (_) @_func
|
||||
argument: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue