Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/cylc/injections.scm')
-rw-r--r--runtime/queries/cylc/injections.scm20
1 files changed, 20 insertions, 0 deletions
diff --git a/runtime/queries/cylc/injections.scm b/runtime/queries/cylc/injections.scm
new file mode 100644
index 00000000..d10931f4
--- /dev/null
+++ b/runtime/queries/cylc/injections.scm
@@ -0,0 +1,20 @@
+((setting
+ key: (key) @key
+ (#match? @key "^script$|-script$|^script-")
+ value: (_
+ (string_content) @injection.content))
+ (#set! "injection.language" "bash"))
+
+; Requires no spacing around "=" in environment settings for proper highlighting.
+; Could be improved if Tree-sitter allowed to specify the target node of the injected
+; language, instead of always using the root node.
+; See this proposal:
+; https://github.com/tree-sitter/tree-sitter/issues/3625
+((task_section
+ (sub_section_2
+ name: (_) @section_name
+ (#eq? @section_name "environment")
+ (setting) @injection.content))
+ (#set! "injection.language" "bash")
+ (#set! injection.combined)
+ (#set! injection.include-children))