mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -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
|
((comment) @injection.content
|
||||||
(#set! injection.language "comment"))
|
(#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
|
(apply_expression
|
||||||
function: (_) @_func
|
function: (_) @_func
|
||||||
argument: [
|
argument: [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue