nvim-treesitter/tests/query/injections
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
..
cuda chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
dockerfile fix(dockerfile): correct bash syntax highlighting 2026-03-12 23:30:55 +01:00
ecma chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
html feat(html): use gsub for mimetype lookup 2025-05-12 18:43:40 +02:00
http feat(http): more comprehensive highlights 2024-11-22 08:56:14 +01:00
nix fix(nix): make all bash injections combined 2026-01-29 10:41:43 +01:00
promql feat(promql): do not use regex for string labels (#7669) 2025-02-20 12:17:32 +01:00
python fix(python): regex injection not working for concatenated strings (#8197) 2025-10-26 09:25:42 -07:00
query fix(query): properly apply predicate injections 2024-07-27 17:17:26 +02:00
ruby feat(ruby): add injection for debugger command strings (#7480) 2024-12-30 11:14:03 +01:00
starlark fix(python): regex injection not working for concatenated strings (#8197) 2025-10-26 09:25:42 -07:00
svelte chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
vue chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
yaml More bash injection support for Taskfile (#7805) 2025-04-07 21:08:22 +02:00