1
0
mirror of https://github.com/helix-editor/helix synced 2026-03-07 08:41:40 +01:00
helix/runtime/queries/docker-bake/injections.scm
kpbaks 0928e5ea1c feat: add docker-bake language
Docker bake files are primarily written in `hcl`, but you can also write
it in `json` and `yaml`. The official material and documentation for the
feature uses `hcl`, which is why this commit makes the choice of
associating the `docker-bake` language with `docker-bake.hcl` files.
The primary motivation of this specialization is to inject the
`dockerfile` language into the `dockerfile-inline` attribute.
2025-09-05 10:35:26 -04:00

24 lines
678 B
Scheme

((comment) @injection.content
(#set! injection.language "comment"))
; https://docs.docker.com/build/bake/reference/#targetdockerfile-inline
(block
(identifier) @_target (#eq? @_target "target")
(body
(attribute
(identifier) @_attr (#eq? @_attr "dockerfile-inline")
(expression
(template_expr
(heredoc_template
(template_literal) @injection.content)))))
(#set! injection.language "dockerfile"))
(function_call
(identifier) @_name (#eq? @_name "regex")
(function_arguments
(expression
(literal_value
(string_lit
(template_literal) @injection.content))))
(#set! injection.language "regex"))