nvim-treesitter/tests/query/highlights
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
..
bash feat(bash): update parser 2025-12-06 14:04:19 +01:00
c highlights(c/cpp): highlight case labels as constants 2022-01-29 13:11:56 +01:00
capnp feat: more @keyword.type captures 2024-05-01 09:59:50 +02:00
clojure Update Clojure highlights to be metadata aware (#6213) 2024-03-19 22:10:41 +01:00
cpp feat: more @keyword.type captures 2024-05-01 09:59:50 +02:00
dockerfile fix(dockerfile): correct bash syntax highlighting 2026-03-12 23:30:55 +01:00
ecma fix(highlights): improve member/property distinction 2024-01-19 16:58:37 +01:00
gdshader feat!(gdshader): replace gdshader parser and queries (#8244) 2025-10-30 14:59:19 +01:00
gitattributes feat!: align standard captures with upstream 2024-01-19 16:58:37 +01:00
gleam tests(gleam): fix assert tests that no longer parse correctly 2025-05-12 18:43:40 +02:00
hack feat: more @keyword.type captures 2024-05-01 09:59:50 +02:00
haskell fix(haskell): update queries and tests for rewritten parser (#6580) 2024-05-07 07:27:44 +00:00
hocon feat!: align standard captures with upstream 2024-01-19 16:58:37 +01:00
http feat(http): more comprehensive highlights 2024-11-22 08:56:14 +01:00
jinja Revert "fix(jinja): remove crashing pattern" 2025-08-05 20:06:49 +02:00
julia fix(julia): treat :: as operator in type contexts 2024-11-23 11:10:05 +01:00
kos feat(kos): highlights improvements (#8404) 2026-01-07 21:53:42 -08:00
latex feat(latex): pre-compiled header highlights, tests 2024-02-06 10:29:09 +01:00
lua feat!: drop modules, general refactor and cleanup 2025-05-12 18:43:40 +02:00
markdown feat(highlights)!: enforce documented captures (#6232) 2024-03-03 11:00:11 +01:00
nix feat(nix): misc cleanups + comment injection (#6418) 2024-04-09 14:20:26 +09:00
pascal chore(tests): consistent captures 2024-01-19 16:58:37 +01:00
php feat(php): add support for new relative_name node 2025-02-26 17:01:57 +01:00
prisma feat: more @keyword.type captures 2024-05-01 09:59:50 +02:00
promql feat(promql): do not use regex for string labels (#7669) 2025-02-20 12:17:32 +01:00
proto feat(proto): more delimiter, property highlights 2025-08-31 08:06:48 +02:00
python fix(python): regex injection not working for concatenated strings (#8197) 2025-10-26 09:25:42 -07:00
r fix(r): resolve highlight regressions 2024-06-29 09:26:53 +02:00
rust fix(rust): highlight parameters with ref in definition 2024-11-03 11:46:40 +01:00
smali feat(highlights)!: @keyword.storage@keyword.modifier 2024-03-16 20:51:16 +08:00
solidity feat: more @keyword.type captures 2024-05-01 09:59:50 +02:00
starlark fix(python): regex injection not working for concatenated strings (#8197) 2025-10-26 09:25:42 -07:00
t32 feat(t32)!: update parser and queries (#8276) 2025-11-12 10:06:04 +01:00
tiger feat: more @keyword.type captures 2024-05-01 09:59:50 +02:00
typescript feat!: align standard captures with upstream 2024-01-19 16:58:37 +01:00
usd fix(usd): misc punctuation highlights 2026-01-08 10:17:12 +01:00
wing feat(wing): add many missing highlights 2024-09-02 09:55:48 +02:00
yaml feat(promql): do not use regex for string labels (#7669) 2025-02-20 12:17:32 +01:00
zsh feat(parsers): add zsh support (#8240) 2025-11-05 20:13:53 -08:00
xhp-intro.hack feat(highlights)!: keyword @type.qualifier@keyword.modifier 2024-03-16 20:51:16 +08:00