helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
32.48k stars 2.4k forks source link

Dockerfile syntax #3166

Open hholst80 opened 2 years ago

hholst80 commented 2 years ago

Summary

HERE document parsing does not work

Example

FROM ubuntu:20.04
RUN <<EOF
  apt-get update
  apt-get install tree
EOF
RUN tree /tmp

The last line will not color correctly.

Reproduction Steps

No response

Helix log

No response

Platform

Linux

Terminal Emulator

xterm-256color

Helix Version

helix 22.05 (27609f50)

amitbeka commented 2 years ago

Validated this on the most recent version: helix 22.05 (dfc31e74)

amitbeka commented 2 years ago

It is an upstream bug in the treesitter grammar itself, unfortunately: https://github.com/camdencheek/tree-sitter-dockerfile/issues/4

hholst80 commented 2 years ago

There is a workaround, but I think its brittle and ugly to have to use the backslashes all over

image

amitbeka commented 2 years ago

There is no heredoc in this screenshot, so the problem doesn't exist. If you mean to use backslashes and && instead of a heredoc -- yeah that's always possible, I'm very used to it.