I'd like to create a snippet in VS Code, which includes exact string ${code}
. However, when I enter it in this form, VS Code tries to interpret it as snippet parameter. How should I escape it properly?
VS Code snippet - escape ${file}
Asked Answered
"}" AND "$" can be escaped with "\\". Some cases "$" can be escaped with "$$" but not in your case.
Your snippet should look like this.
"Return Code With Squirly And Dollar": {
"prefix": "code_snippet",
"body" : [
"\\${code\\}"
],
"description": "Code Snippet"
}
This should help you
© 2022 - 2024 — McMap. All rights reserved.
"console.log(`${1:debugEl}: \\${ ${1:debugEl} \\}`)"
– Petulah