This website requires JavaScript.
Explore
Help
Sign in
benbot
/
nvim-treesitter
Watch
1
Star
0
Fork
You've already forked nvim-treesitter
0
mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced
2026-07-09 15:00:04 -04:00
Code
Issues
Projects
Releases
Packages
Wiki
Activity
Actions
051d1ad753
nvim-treesitter
/
tests
/
query
/
injections
/
dockerfile
/
bash-on-run-instructions.dockerfile
12 lines
105 B
Text
Raw
Normal View
History
Unescape
Escape
fix(dockerfile): bash injection on run instructions
2023-09-17 13:35:17 +02:00
FROM foo
RUN bar
chore(tests): consistent captures
2023-12-24 12:52:21 +01:00
# ^ @bash
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-02-25 13:57:40 +01:00
FROM haha
# ^ @!bash
fix(dockerfile): bash injection on run instructions
2023-09-17 13:35:17 +02:00
RUN \
baz
chore(tests): consistent captures
2023-12-24 12:52:21 +01:00
# ^ @bash
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-02-25 13:57:40 +01:00
COPY apt apt
# ^ @!bash
Reference in a new issue
Copy permalink