This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-24
lines changed Expand file tree Collapse file tree 2 files changed +10
-24
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ the quick brown $1fox \${2:jumped \${3:over}
116
116
117
117
118
118
it ( "parses a snippet with transformations and mirrors" , ( ) => {
119
- const bodyTree = BodyParser . parse ( "${1:placeholder}\n\ ${1/(.)/\\u$1/}\n$1" ) ;
119
+ const bodyTree = BodyParser . parse ( "${1:placeholder}\n${1/(.)/\\u$1/}\n$1" ) ;
120
120
expect ( bodyTree ) . toEqual ( [
121
121
{ index : 1 , content : [ 'placeholder' ] } ,
122
122
'\n' ,
@@ -137,7 +137,7 @@ the quick brown $1fox \${2:jumped \${3:over}
137
137
} ) ;
138
138
139
139
it ( "parses a snippet with a format string and case-control flags" , ( ) => {
140
- const bodyTree = BodyParser . parse ( "<\ ${1:p}>$0</\ ${1/(.)(.*)/\\u$1$2/}>" ) ;
140
+ const bodyTree = BodyParser . parse ( "<${1:p}>$0</${1/(.)(.*)/\\u$1$2/}>" ) ;
141
141
expect ( bodyTree ) . toEqual ( [
142
142
'<' ,
143
143
{ index : 1 , content : [ 'p' ] } ,
@@ -187,7 +187,7 @@ the quick brown $1fox \${2:jumped \${3:over}
187
187
} ) ;
188
188
189
189
it ( "parses a snippet with a placeholder that mirrors another tab stop's content" , ( ) => {
190
- const bodyTree = BodyParser . parse ( "$4console.\ ${3:log}('\ ${2:$1}', $1);$0" ) ;
190
+ const bodyTree = BodyParser . parse ( "$4console.${3:log}('${2:$1}', $1);$0" ) ;
191
191
expect ( bodyTree ) . toEqual ( [
192
192
{ index : 4 , content : [ ] } ,
193
193
'console.' ,
Original file line number Diff line number Diff line change @@ -240,9 +240,7 @@ third tabstop $3\
240
240
241
241
"large indices" : {
242
242
prefix : "t10" ,
243
- body : `\
244
- hello\${10} \${11:large} indices\${1}\
245
- `
243
+ body : "hello${10} ${11:large} indices${1}"
246
244
} ,
247
245
248
246
"no body" : {
@@ -256,40 +254,28 @@ hello\${10} \${11:large} indices\${1}\
256
254
257
255
"many tabstops" : {
258
256
prefix : "t11" ,
259
- body : `\
260
- $0one\${1} \${2:two} three\${3}\
261
- `
257
+ body : "$0one${1} ${2:two} three${3}"
262
258
} ,
263
259
264
260
"simple transform" : {
265
261
prefix : "t12" ,
266
- body : `\
267
- [\${1:b}][/\${1/[ ]+.*$//}]\
268
- `
262
+ body : "[${1:b}][/${1/[ ]+.*$//}]"
269
263
} ,
270
264
"transform with non-transforming mirrors" : {
271
265
prefix : "t13" ,
272
- body : `\
273
- \${1:placeholder}\n\${1/(.)/\\u$1/}\n$1\
274
- `
266
+ body : "${1:placeholder}\n${1/(.)/\\u$1/}\n$1"
275
267
} ,
276
268
"multiple tab stops, some with transforms and some without" : {
277
269
prefix : "t14" ,
278
- body : `\
279
- \${1:placeholder} \${1/(.)/\\u$1/} $1 \${2:ANOTHER} \${2/^(.*)$/\\L$1/} $2\
280
- `
270
+ body : "${1:placeholder} ${1/(.)/\\u$1/} $1 ${2:ANOTHER} ${2/^(.*)$/\\L$1/} $2"
281
271
} ,
282
272
"has a transformed tab stop without a corresponding ordinary tab stop" : {
283
273
prefix : 't15' ,
284
- body : `\
285
- \${1/(.)/\\u$1/} & $2\
286
- `
274
+ body : "${1/(.)/\\u$1/} & $2"
287
275
} ,
288
276
"has a transformed tab stop that occurs before the corresponding ordinary tab stop" : {
289
277
prefix : 't16' ,
290
- body : `\
291
- & \${1/(.)/\\u$1/} & \${1:q}\
292
- `
278
+ body : "& ${1/(.)/\\u$1/} & ${1:q}"
293
279
} ,
294
280
"has a placeholder that mirrors another tab stop's content" : {
295
281
prefix : 't17' ,
You can’t perform that action at this time.
0 commit comments