From b4494e1dc54f342d8c765b793bf934ae730b5253 Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 3 Feb 2023 23:09:55 +0100 Subject: [PATCH] queries/nix: add injection rule for python test scripts --- runtime/queries/nix/injections.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/runtime/queries/nix/injections.scm b/runtime/queries/nix/injections.scm index 1da63ce08..03a6dc368 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