Reputation: 17764
I want to create a VS Code snippet that uses the choices feature:
"Fool's Dart Types": {
"scope": "dart",
"prefix": "foolsTypes",
"body": [
"${1|bool,String,int,double,num,List<Map<String, dynamic>>,Map<String, dynamic>,dynamic|} ${2:variableName};"
]
},
The issue is that the commas inside my List
and Map
choices break up the choices so they look like this:
I tried using the \
character but that doesn't work inside the choices brackets.
Upvotes: 0
Views: 21
Reputation: 17764
I was using the \
wrong. You have to use 2 backslashes to escape the characters so doing this works:
"Fool's Dart Types": {
"scope": "dart",
"prefix": "foolsTypes",
"body": [
"${1|bool,String,int,double,num,List<Map<String\\, dynamic>>,Map<String\\, dynamic>,dynamic|} ${2:variableName};"
]
},
Upvotes: 0