mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(nix): add writeText/writeTextDir injection
This commit is contained in:
parent
539abf6da5
commit
4a53f4cb18
2 changed files with 55 additions and 0 deletions
|
|
@ -255,6 +255,48 @@
|
|||
(#lua-match? @_func "^%a*%.*writeRust%a*$")
|
||||
(#set! injection.combined))
|
||||
|
||||
((apply_expression
|
||||
function: (apply_expression
|
||||
function: (_) @_func
|
||||
argument: [
|
||||
(string_expression
|
||||
.
|
||||
(string_fragment) @injection.filename .)
|
||||
(indented_string_expression
|
||||
.
|
||||
(string_fragment) @injection.filename .)
|
||||
])
|
||||
. ; only match on adjacent text, so that we can use a comment to change the language
|
||||
argument: [
|
||||
(string_expression
|
||||
(string_fragment) @injection.content)
|
||||
(indented_string_expression
|
||||
(string_fragment) @injection.content)
|
||||
])
|
||||
(#lua-match? @_func "^%a*%.*writeText$")
|
||||
(#set! injection.combined))
|
||||
|
||||
((apply_expression
|
||||
function: (apply_expression
|
||||
function: (_) @_func
|
||||
argument: [
|
||||
(string_expression
|
||||
.
|
||||
(string_fragment) @injection.filename .)
|
||||
(indented_string_expression
|
||||
.
|
||||
(string_fragment) @injection.filename .)
|
||||
])
|
||||
. ; only match on adjacent text, so that we can use a comment to change the language
|
||||
argument: [
|
||||
(string_expression
|
||||
(string_fragment) @injection.content)
|
||||
(indented_string_expression
|
||||
(string_fragment) @injection.content)
|
||||
])
|
||||
(#lua-match? @_func "^%a*%.*writeTextDir$")
|
||||
(#set! injection.combined))
|
||||
|
||||
; (runTest) testScript
|
||||
(apply_expression
|
||||
function: (_) @_func
|
||||
|
|
|
|||
|
|
@ -70,6 +70,19 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
drv13 = pkgs.writeText "config.json" ''
|
||||
{
|
||||
"foo": 1,
|
||||
"bar": 2
|
||||
}
|
||||
'';
|
||||
|
||||
drv14 = pkgs.writeTextDir "etc/ssh/ssh_config" ''
|
||||
Host *
|
||||
AddressFamily any
|
||||
ForwardX11 no
|
||||
'';
|
||||
|
||||
mod1 = {
|
||||
type = "lua";
|
||||
config = ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue