diff options
| author | Mikkel Mondrup Kristensen <monrad@github.com> | 2025-04-07 21:08:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-07 21:08:22 +0200 |
| commit | 0e21ee8df6235511c02bab4a5b391d18e165a58d (patch) | |
| tree | ff945c68d39dbba40f2dce3fea881c7b9d83a23a | |
| parent | feat(yaml): inject bash for taskfiles (#7804) (diff) | |
| download | nvim-treesitter-0e21ee8df6235511c02bab4a5b391d18e165a58d.tar nvim-treesitter-0e21ee8df6235511c02bab4a5b391d18e165a58d.tar.gz nvim-treesitter-0e21ee8df6235511c02bab4a5b391d18e165a58d.tar.bz2 nvim-treesitter-0e21ee8df6235511c02bab4a5b391d18e165a58d.tar.lz nvim-treesitter-0e21ee8df6235511c02bab4a5b391d18e165a58d.tar.xz nvim-treesitter-0e21ee8df6235511c02bab4a5b391d18e165a58d.tar.zst nvim-treesitter-0e21ee8df6235511c02bab4a5b391d18e165a58d.zip | |
More bash injection support for Taskfile (#7805)
| -rw-r--r-- | queries/yaml/injections.scm | 6 | ||||
| -rw-r--r-- | tests/query/injections/yaml/bash-on-taskfiles.yml | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/queries/yaml/injections.scm b/queries/yaml/injections.scm index d0a3c930f..143af1924 100644 --- a/queries/yaml/injections.scm +++ b/queries/yaml/injections.scm @@ -2,10 +2,10 @@ (#set! injection.language "comment")) ; Github actions ("run") / Gitlab CI ("scripts") -; Taskfile scripts ("cmds", "sh") +; Taskfile scripts ("cmds", "cmd", "sh") (block_mapping_pair key: (flow_node) @_run - (#any-of? @_run "run" "script" "before_script" "after_script" "cmds" "sh") + (#any-of? @_run "run" "script" "before_script" "after_script" "cmds" "cmd" "sh") value: (flow_node (plain_scalar (string_scalar) @injection.content) @@ -13,7 +13,7 @@ (block_mapping_pair key: (flow_node) @_run - (#any-of? @_run "run" "script" "before_script" "after_script" "cmds" "sh") + (#any-of? @_run "run" "script" "before_script" "after_script" "cmds" "cmd" "sh") value: (block_node (block_scalar) @injection.content (#set! injection.language "bash") diff --git a/tests/query/injections/yaml/bash-on-taskfiles.yml b/tests/query/injections/yaml/bash-on-taskfiles.yml index 87a699cc3..c99dc4667 100644 --- a/tests/query/injections/yaml/bash-on-taskfiles.yml +++ b/tests/query/injections/yaml/bash-on-taskfiles.yml @@ -13,3 +13,12 @@ tasks: - echo "{{.GREETING}}" # ^ @bash silent: true + cmd: + cmd: echo "{{.GREETING}}" + # ^ @bash + silent: true + cmd-block: + cmd: | + echo "{{.GREETING}}" + # ^ @bash + silent: true |
