camdencheek / tree-sitter-dockerfile

A tree-sitter grammar for Dockerfile
MIT License
71 stars 20 forks source link

`USER` statement with numeric value breaks syntax highlighting #30

Closed gruhn closed 4 months ago

gruhn commented 1 year ago
Screenshot 2023-01-11 at 19 10 58

For copy/paste:

FROM ubuntu

USER root
WORKDIR /home

USER 1000
WORKDIR /home
camdencheek commented 1 year ago

Thanks for the report! I'm hoping to do some triage this weekend.

gruhn commented 1 year ago

Actually, can't reproduce anymore. Maybe I was on an older version. Sorry, for the noise. Issue can be closed from my side.

LeoniePhiline commented 1 year ago

I can still reproduce the issue.

See https://github.com/helix-editor/helix/issues/6797

edit: hm, should be fixed with https://github.com/camdencheek/tree-sitter-dockerfile/commit/71ac1e88805ba0f1826051be9148cb3fde70321c Maybe Helix needs to update to a newer ref.

Helix uses 7af32bc04a66ab196f5b9f92ac471f29372ae2ce - that’s really old.

Quitlox commented 1 year ago

I have found a related issue, albeit in a very specific scenario. It seems that the format USER <capital letters><dash><any> breaks the formatting:

image

image

Should I make a separate issue?

LeoniePhiline commented 1 year ago

The regex at https://github.com/camdencheek/tree-sitter-dockerfile/blob/8ee3a0f7587b2bd8c45c8cb7d28bd414604aec62/grammar.js#L123 excludes capital letters.

Edit: Yes, that would be a different issue.

camdencheek commented 4 months ago

Closing since I can no longer reproduce on the latest main and it looks like this was a case of "downstream hadn't updated for a while"