nvim-treesitter/tests/query
Valentin Krasontovitsch b760eef0ba
fix(dockerfile): correct bash syntax highlighting
when a dockerfile contains several RUN statements, the syntax
highlighting would sometimes run over and encompass dockerfile
statements after the RUN command (typically everything between the first
and last RUN statement, though the bash syntax bleed can be broken by
terminating a RUN statement with a semicolon, or a space 🙄)

we fix this by using a slightly different approach to recognizing /
grouping (the content of) RUN commands:

- instead of having shell_command at the top level of the block we
  changed, we're using run_instruction - so parsing happens per `RUN`
  statement, which is really what we want
- inseade of `injection.combined`, we use `injection.include-children`,
  which combines all the shell fragments (the text parts of a shell
  command, including after newline continuations), which is really what
  we want, as that's all the text of a RUN statement

that fixes the highlight bleed, and preserves correct highlighting for
each RUN statement.

we also add a regression test for highlighting.

Closes #6530, #6975
2026-03-12 23:30:55 +01:00
..
highlights fix(dockerfile): correct bash syntax highlighting 2026-03-12 23:30:55 +01:00
injections fix(dockerfile): correct bash syntax highlighting 2026-03-12 23:30:55 +01:00
highlights_spec.lua feat(tests)!: new infrastructure based on makefile 2025-05-12 18:43:41 +02:00
injection_spec.lua feat(tests)!: new infrastructure based on makefile 2025-05-12 18:43:41 +02:00