How to escape json schema defaultSnippets
snippet syntax
#984
-
I've been making a schema for my extension and wanted to add some minimal schema: {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "defaultSnippets",
"type": "object",
"properties": {
"vscode bug": {
"defaultSnippets": [
{
"label": "vscode bug",
"body": [
"$1",
"\\$2",
"\\\\$3",
"$\\4",
"$\\\\5",
"\\$\\6"
]
}
]
}
}
} minimal json file with schema active: trigger intellisense code completions with ctrl+space: userdefinedsnippets#_grammar states I can just escape the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Maybe @aeschli can help here |
Beta Was this translation helpful? Give feedback.
-
The problem is that the item is stringified, so all The solution is to use
|
Beta Was this translation helpful? Give feedback.
-
One more trick (my memory comes back):
|
Beta Was this translation helpful? Give feedback.
One more trick (my memory comes back):
In
body
, start your string literal with^
. Again, that string literal will not be stringified but inserted as is