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

Dockerfile syntax highlighting for escaped quotes is not quite right #75

Closed
dlech opened this issue Mar 23, 2017 · 9 comments
Closed

Dockerfile syntax highlighting for escaped quotes is not quite right #75

dlech opened this issue Mar 23, 2017 · 9 comments
Labels

Comments

@dlech
Copy link
Contributor

dlech commented Mar 23, 2017

Given the following dockerfile snippet...

# setup a new user
COPY compiler.sudoers /etc/sudoers.d/compiler
RUN chmod 0440 /etc/sudoers.d/compiler && \
    adduser --disabled-password --gecos \"\" compiler && \
    usermod -a -G sudo compiler
USER compiler
WORKDIR /home/compiler
CMD ["/bin/bash"] ["--login"]

The escaped quotes after gecos appear to throw off the syntax highlighting.

selection_014

@natemcmaster
Copy link

+1

image

@craigguest
Copy link

Also seems to be an issue when using backslashes within quoted paths:

image

@dcormier
Copy link

Another example of the problem:

# escape=`

FROM repo:label

RUN command `
	-arg1=\"val1\" `
	-arg2=\"val2\" `
	-arg3=\"val3\"

RUN echo "and now all the syntax highlighting is backwards"

Which shows up as:
image

@rcjsuen
Copy link
Contributor

rcjsuen commented Jul 4, 2018

I wonder if this issue should really belong in Microsoft/vscode or moby/moby instead. The syntax highlighting is provided by the docker.tmLanguage.json file which lives in Microsoft/vscode (which is a converted version of the file in moby/moby).

@Leon99
Copy link

Leon99 commented Apr 3, 2019

@PrashanthCorp so any chances to get this fixed here or we need to log an issue in https://github.com/Microsoft/vscode?
Also, just an observation - this problem doesn't happen in VS (just wondering if there is any potential for syntax rules reuse).

@rcjsuen
Copy link
Contributor

rcjsuen commented Oct 10, 2019

@Leon99 Could you please provide an example of your Dockerfile that has proper syntax highlighting in Visual Studio Code but doesn't when the vscode-docker extension is installed?

@Leon99
Copy link

Leon99 commented Oct 10, 2019

@rcjsuen I can't, I never said that was the case. It worked fine in VS2019, not in VSCode.

@rcjsuen
Copy link
Contributor

rcjsuen commented Oct 11, 2019

@rcjsuen I can't, I never said that was the case. It worked fine in VS2019, not in VSCode.

You're right, I misread your comment. You were talking about Visual Studio 2019 and not Visual Studio Code. My mistake and sorry for the confusion.

Could you share a screenshot of how something looks in VS2019 and VSCode for comparison? Thanks!

@bwateratmsft
Copy link
Collaborator

Since syntax highlighting is provided by VSCode with the tmLanguage file, I've created microsoft/vscode#82988 and will close this one as external to that one.

@bwateratmsft bwateratmsft added external and removed bug labels Oct 21, 2019
@BigMorty BigMorty removed their assignment Oct 21, 2019
@bwateratmsft bwateratmsft removed this from the Future milestone Nov 4, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests