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

syntax highlighting problems with Dockerfiles #4480

Open
aep-sunlife opened this issue Jan 23, 2025 · 4 comments
Open

syntax highlighting problems with Dockerfiles #4480

aep-sunlife opened this issue Jan 23, 2025 · 4 comments

Comments

@aep-sunlife
Copy link

aep-sunlife commented Jan 23, 2025

RUN is not the only Dockerfile directive that supports multiline statements with backslash (\). For example, ARG and potentially other directives also support this syntax. However, the Microsoft Docker VSCode plugin struggles to highlight multiline ARG instructions.

ARG supports declaring multiple variables in one instruction:

https://docs.docker.com/reference/dockerfile/#arg

However, the plugin doesn't consistently highlight the bindings in the same color.

Example:

ARG http_proxy_host \
    https_proxy_host \
    http_proxy_port \
    https_proxy_port \
    no_proxy
@bwateratmsft
Copy link
Collaborator

@rcjsuen for visibility

This could be a problem in the built-in vscode.docker extension which provides basic syntax highlighting. @aep-sunlife if you disable the Docker extension, which would leave only the built-in vscode.docker extension active, does the syntax highlighting look correct?

@rcjsuen
Copy link
Contributor

rcjsuen commented Jan 23, 2025

This could be a problem in the built-in vscode.docker extension which provides basic syntax highlighting. @aep-sunlife if you disable the Docker extension, which would leave only the built-in vscode.docker extension active, does the syntax highlighting look correct?

What is the difference "built-in vscode.docker extension" vs "the Docker extension"? 🤔
Did you mean the default Dockerfile TextMate grammar that comes pre-installed with Visual Studio Code?

@bwateratmsft
Copy link
Collaborator

Yes, that's the one. The human-readable title for it is "Docker Language Basics"

@bwateratmsft
Copy link
Collaborator

@aep-sunlife can you also share a screenshot? When I try with the Docker extension both enabled and disabled, it is showing them the same color:

Enabled:
Image

Disabled:
Image

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

No branches or pull requests

3 participants