summaryrefslogtreecommitdiff
path: root/runtime/queries/nix
diff options
context:
space:
mode:
authorpacien2023-02-03 22:09:55 +0000
committerMichael Davis2023-09-16 20:09:07 +0000
commitb4494e1dc54f342d8c765b793bf934ae730b5253 (patch)
tree7cd72722d83b68cc624dd8f8ea11a9ecef3179cc /runtime/queries/nix
parent0e556484b7dbb4078a416ef0b3d923a206e6670e (diff)
queries/nix: add injection rule for python test scripts
Diffstat (limited to 'runtime/queries/nix')
-rw-r--r--runtime/queries/nix/injections.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/queries/nix/injections.scm b/runtime/queries/nix/injections.scm
index 1da63ce0..03a6dc36 100644
--- a/runtime/queries/nix/injections.scm
+++ b/runtime/queries/nix/injections.scm
@@ -6,6 +6,16 @@
(indented_string_expression (string_fragment) @injection.content))
(#set! injection.combined))
+; Common attribute keys corresponding to Python scripts,
+; such as those for NixOS VM tests in nixpkgs/nixos/tests.
+((binding
+ attrpath: (attrpath (identifier) @_path)
+ expression: (indented_string_expression
+ (string_fragment) @injection.content))
+ (#match? @_path "(^|\\.)testScript$")
+ (#set! injection.language "python")
+ (#set! injection.combined))
+
; Common attribute keys corresponding to scripts,
; such as those of stdenv.mkDerivation.
((binding