diff options
| author | Anthony Fiddes <11233666+Anthony-Fiddes@users.noreply.github.com> | 2025-04-06 17:09:27 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-06 19:09:27 +0200 |
| commit | 205faba1768a6e4c854f156bc6a21a41b242599c (patch) | |
| tree | c5277800f0fadfbddec949d2e001f39170b72a7c | |
| parent | ci(bot): bump create-github-app-token to v2 (diff) | |
| download | nvim-treesitter-205faba1768a6e4c854f156bc6a21a41b242599c.tar nvim-treesitter-205faba1768a6e4c854f156bc6a21a41b242599c.tar.gz nvim-treesitter-205faba1768a6e4c854f156bc6a21a41b242599c.tar.bz2 nvim-treesitter-205faba1768a6e4c854f156bc6a21a41b242599c.tar.lz nvim-treesitter-205faba1768a6e4c854f156bc6a21a41b242599c.tar.xz nvim-treesitter-205faba1768a6e4c854f156bc6a21a41b242599c.tar.zst nvim-treesitter-205faba1768a6e4c854f156bc6a21a41b242599c.zip | |
feat(yaml): inject bash for taskfiles (#7804)
| -rw-r--r-- | queries/yaml/injections.scm | 9 | ||||
| -rw-r--r-- | tests/query/injections/yaml/bash-on-taskfiles.yml | 15 |
2 files changed, 20 insertions, 4 deletions
diff --git a/queries/yaml/injections.scm b/queries/yaml/injections.scm index b05c332fe..d0a3c930f 100644 --- a/queries/yaml/injections.scm +++ b/queries/yaml/injections.scm @@ -2,9 +2,10 @@ (#set! injection.language "comment")) ; Github actions ("run") / Gitlab CI ("scripts") +; Taskfile scripts ("cmds", "sh") (block_mapping_pair key: (flow_node) @_run - (#any-of? @_run "run" "script" "before_script" "after_script") + (#any-of? @_run "run" "script" "before_script" "after_script" "cmds" "sh") value: (flow_node (plain_scalar (string_scalar) @injection.content) @@ -12,7 +13,7 @@ (block_mapping_pair key: (flow_node) @_run - (#any-of? @_run "run" "script" "before_script" "after_script") + (#any-of? @_run "run" "script" "before_script" "after_script" "cmds" "sh") value: (block_node (block_scalar) @injection.content (#set! injection.language "bash") @@ -20,7 +21,7 @@ (block_mapping_pair key: (flow_node) @_run - (#any-of? @_run "run" "script" "before_script" "after_script") + (#any-of? @_run "run" "script" "before_script" "after_script" "cmds" "sh") value: (block_node (block_sequence (block_sequence_item @@ -31,7 +32,7 @@ (block_mapping_pair key: (flow_node) @_run - (#any-of? @_run "script" "before_script" "after_script") + (#any-of? @_run "script" "before_script" "after_script" "cmds" "sh") value: (block_node (block_sequence (block_sequence_item diff --git a/tests/query/injections/yaml/bash-on-taskfiles.yml b/tests/query/injections/yaml/bash-on-taskfiles.yml new file mode 100644 index 000000000..87a699cc3 --- /dev/null +++ b/tests/query/injections/yaml/bash-on-taskfiles.yml @@ -0,0 +1,15 @@ +# https://taskfile.dev + +version: '3' + +vars: + GREETING: + sh: echo "Hello, World!" + # ^ @bash + +tasks: + default: + cmds: + - echo "{{.GREETING}}" + # ^ @bash + silent: true |
