Closed romintomasetti closed 1 week ago
When using
heredocs
sections in a Docker file, this extension does not seem to correctly highlight.See the below screenshot. The comment is not colorized.
However, other linters I've tried manage to do it correctly. I'll mention https://github.com/hadolint/hadolint for instance.
@romintomasetti Sorry, could you explain how hadolint provides syntax highlighting? It is a tool for linting Dockerfiles and not about syntax highlighting.
Let's compare the output in VS Code . |
without this extension | with this extension enabled |
---|---|---|
Basically, the # Command
was in green but your extension makes it blue (in my color settings), making the code harder to read.
Basically, the
# Command
was in green but your extension makes it blue (in my color settings), making the code harder to read.
@romintomasetti That is a (positive) side effect of the #
character being the character for comments in a Dockerfile.
FROM alpine
COPY <<EOF test.go
// this is a comment
EOF
If you had the above Dockerfile where //
is the character for comments it would not get highlighted.
"[dockerfile]": {
"editor.semanticHighlighting.enabled": false
}
If you would like to disable semantic highlighting, you can put the snippet above in your settings.json
which will put you in the default colouring provided by Visual Studio Code instead of what the language server is calculating.
@bwateratmsft I think we can consider this to be a duplicate of #4183.
When using
heredocs
sections in a Docker file, this extension does not seem to correctly highlight.See the below screenshot. The comment is not colorized.
However, other linters I've tried manage to do it correctly. I'll mention https://github.com/hadolint/hadolint for instance.
Is there anything I can do to help you with this?