NealVDV
NealVDV

Reputation: 2532

Correctly escaping in snippet?

I'm currently facing an issue where my snippet is not correctly rendered when used.

Snippet

  "Import": {
    "prefix": "import",
    "body": ["import ${1: { ${2:module} } } from \"${0:library}\";"],
    "description": "Import module (es6)"
  },

The problem

This is the first tab, as you can see it does not select the } for some reason. The other tabs are working fine. I've tried a couple of possibilities but they are not resolving the issue.

enter image description here

Upvotes: 0

Views: 37

Answers (1)

Shantanu Roy
Shantanu Roy

Reputation: 36

You need to escape the second '}' with '\'. The following works.

"body": ["import ${1:{ ${2:module} \\}} from \"${0:library}\";"],

Upvotes: 1

Related Questions