From 727a76f3e6fa9220f8c11df0f16613765b0830ab Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Mon, 1 Apr 2024 13:15:37 -0400 Subject: [PATCH 1/2] Use any-of instead of match in yaml injections Go back to original intent when this code was first written now that the tree-sitter version used supports any-of?. --- runtime/queries/yaml/injections.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/queries/yaml/injections.scm b/runtime/queries/yaml/injections.scm index 52b437a4ec20..4d32506b34f1 100644 --- a/runtime/queries/yaml/injections.scm +++ b/runtime/queries/yaml/injections.scm @@ -22,20 +22,20 @@ ;; Github actions ("run") / Gitlab CI ("scripts") (block_mapping_pair - key: (flow_node) @_run (#match? @_run "^(run|script|before_script|after_script)$") + key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script") value: (flow_node (plain_scalar (string_scalar) @injection.content) (#set! injection.language "bash"))) (block_mapping_pair - key: (flow_node) @_run (#match? @_run "^(run|script|before_script|after_script)$") + key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script") value: (block_node (block_scalar) @injection.content (#set! injection.language "bash"))) (block_mapping_pair - key: (flow_node) @_run (#match? @_run "^(run|script|before_script|after_script)$") + key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script") value: (block_node (block_sequence (block_sequence_item @@ -45,7 +45,7 @@ (#set! injection.language "bash"))))) (block_mapping_pair - key: (flow_node) @_run (#match? @_run "^(run|script|before_script|after_script)$") + key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script") value: (block_node (block_sequence (block_sequence_item From 22fe2f02d88cafe05213ca49645f27b3e2d366ae Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Mon, 1 Apr 2024 13:17:22 -0400 Subject: [PATCH 2/2] yaml/injections: Add injection for Buildkite Buildkite uses `command` (`commands` is an alias) to define the command(s) to run for the step. --- runtime/queries/yaml/injections.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/runtime/queries/yaml/injections.scm b/runtime/queries/yaml/injections.scm index 4d32506b34f1..46c4a9c0f4fb 100644 --- a/runtime/queries/yaml/injections.scm +++ b/runtime/queries/yaml/injections.scm @@ -20,22 +20,24 @@ ; Modified for Helix from https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/yaml/injections.scm -;; Github actions ("run") / Gitlab CI ("scripts") +;; Github actions: run +;; Gitlab CI: scripts, before_script, after_script +;; Buildkite: command, commands (block_mapping_pair - key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script") + key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script" "command" "commands") value: (flow_node (plain_scalar (string_scalar) @injection.content) (#set! injection.language "bash"))) (block_mapping_pair - key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script") + key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script" "command" "commands") value: (block_node (block_scalar) @injection.content (#set! injection.language "bash"))) (block_mapping_pair - key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script") + key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script" "command" "commands") value: (block_node (block_sequence (block_sequence_item @@ -45,7 +47,7 @@ (#set! injection.language "bash"))))) (block_mapping_pair - key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script") + key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script" "command" "commands") value: (block_node (block_sequence (block_sequence_item