This patch adds support for fontifying the following grammar-elements:
- image-declarations (image-name, image-tag & image alias)
- strings in more general terms
- string-expansion statements
- treat path-values as strings
- identifiers names for ENV and ARG statements
- argument values for ENV and ARG statements
Most changes here should be fairly uncontroversial. Attached below are screenshots showing before and after patch to provide an easy reference of discussion.
One change I did, where someone might have opinions, is to Dockerfile FROM-AS statements, like the one below:
FROM python:3.13-slim AS build
A Dockerfile can have many FROM-AS statements, where each one declares a target which can be built. In my opinion that makes such a statement a -function declaration- for a function which builds that target, based on the instructions provided underneath it.
As such I changed the fontification of these statements from font-lock-constant-face to font-lock-function-name-face (which in the existing code is the same face used for numerical values).
I think this makes more sense, and makes the visually parsing files way more intuitive, efficient and logical, especially when you have many targets.
Without this change, all fontification tended to go in the "same direction", making it hard to distinguish language-elements based on fontification alone.
Let me know what you think. Screenshots below!
Cheers
Jostein
After - WITH patch: