microsoft / microsoft/vscode-containers

Syntax highlighting doesn't handle escaped quotes

Open
#109 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

language-server
Dominant language
TypeScript
Stars
139
Forks
87
Avg merge
9h 15m
Merged PRs (30d)
9

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The payload names no source file or test. Reproduce the Dockerfile ARG/RUN example in VS Code and compare its syntax coloring with the expected result; done means the escaped quotes remain within the yellow string literal while ${VERSION} keeps its existing coloring.

Written by the indexing model from the issue text.

Assessment

Tech stack
dockerfile, typescript, vscode
Domain
devtools, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.