Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment in line continuation breaks highlighting #13

Open
devnev opened this issue Jan 7, 2025 · 1 comment
Open

Comment in line continuation breaks highlighting #13

devnev opened this issue Jan 7, 2025 · 1 comment

Comments

@devnev
Copy link

devnev commented Jan 7, 2025

As per https://docs.docker.com/reference/dockerfile/#format, the following are equivalent

RUN echo hello \
# comment
world

RUN echo hello \
world

However, in Zed, after such a comment, the syntax highlighting misbehaves. The way it turns out depends on the command before the comment, e.g. with

FROM alpine
RUN echo hello \
    # comment
    world
ENTRYPOINT [ "/bin/sh" ]

the only issue is that the worldtoken is highlighted as a shell command, whereas with

FROM alpine
ENV A=1 \
    # comment
    B=2
ENTRYPOINT [ "/bin/sh" ]

the ENTRYPOINT (and all later tokens) are not highlighted, except some special characters like @ and :

@devnev
Copy link
Author

devnev commented Jan 7, 2025

Possibly related to camdencheek/tree-sitter-dockerfile#59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant