microsoft / vscode-docker

Docker Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
Other
1.21k stars 515 forks source link

Syntax highlighting doesn't handle escaped quotes #4126

Open lionello opened 11 months ago

lionello commented 11 months ago

For example,

ARG VERSION
RUN go build -ldflags="-w -s -X \"main.version=${VERSION}\"" -o /server ./cmd/server

The backslashes around main.version= are needed to handle the case where ${VERSION} has spaces. However, VSCode sees the 2nd double quote (this one: \"main) as the end of the string literal. See the syntax coloring in the image: image

I expect the entire sting literal "-w -s -X \"main.version=${VERSION}\"" to be yellow, apart from ${VERSION} which is correctly colored white.

bwateratmsft commented 11 months ago

@rcjsuen can you take a look? Thanks!

rcjsuen commented 11 months ago

I can indeed reproduce this. Not sure when I'll be able to get to it though.