aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/nix/injections.scm
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries/nix/injections.scm')
-rw-r--r--runtime/queries/nix/injections.scm18
1 files changed, 15 insertions, 3 deletions
diff --git a/runtime/queries/nix/injections.scm b/runtime/queries/nix/injections.scm
index 62b48233..1da63ce0 100644
--- a/runtime/queries/nix/injections.scm
+++ b/runtime/queries/nix/injections.scm
@@ -10,9 +10,11 @@
; such as those of stdenv.mkDerivation.
((binding
attrpath: (attrpath (identifier) @_path)
- expression: (indented_string_expression
- (string_fragment) @injection.content))
- (#match? @_path "(^\\w*Phase|(pre|post)\\w*|(.*\\.)?\\w*([sS]cript|[hH]ook)|(.*\\.)?startup)$")
+ expression: [
+ (indented_string_expression (string_fragment) @injection.content)
+ (binary_expression (indented_string_expression (string_fragment) @injection.content))
+ ])
+ (#match? @_path "(^\\w*Phase|command|(pre|post)\\w*|(.*\\.)?\\w*([sS]cript|[hH]ook)|(.*\\.)?startup)$")
(#set! injection.language "bash")
(#set! injection.combined))
@@ -150,3 +152,13 @@
; (#match? @_func "(^|\\.)writeFSharp(Bin)?$")
; (#set! injection.language "f-sharp")
; (#set! injection.combined))
+
+((apply_expression
+ function: (apply_expression function: (_) @_func
+ argument: (string_expression (string_fragment) @injection.filename))
+ argument: (indented_string_expression (string_fragment) @injection.content))
+ (#match? @_func "(^|\\.)write(Text|Script(Bin)?)$")
+ (#set! injection.combined))
+
+((indented_string_expression (string_fragment) @injection.shebang @injection.content)
+ (#set! injection.combined)) \ No newline at end of file