Skip to content

How to escape json schema defaultSnippets snippet syntax #984

Discussion options

You must be logged in to vote

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

{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"title": "defaultSnippets",
	"type": "object",
	"properties": {
		"vscode bug": {
			"defaultSnippets": [
				{
					"label": "vscode bug",
					"body": [
						"^\"\\$1\""
					]
				}
			]
		}
	}
}

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@RedCMD
Comment options

Comment options

You must be logged in to vote
1 reply
@RedCMD
Comment options

Answer selected by isidorn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants