@@ -11,24 +11,24 @@ describe("Snippet Body Parser", () => {
1111 describe ( "when parsing tab stops" , ( ) => {
1212 it ( "parses simple tab stops" , ( ) => {
1313 expectMatch ( "hello$1world${2}" , [
14- "hello" , { index : 1 , content : [ ] } , "world" , { index : 2 , content : [ ] } ,
14+ "hello" , { index : 1 } , "world" , { index : 2 } ,
1515 ] ) ;
1616 } ) ;
1717
1818 it ( "skips escaped tab stops" , ( ) => {
1919 expectMatch ( "$1 \\$2 $3" , [
20- { index : 1 , content : [ ] } ,
20+ { index : 1 } ,
2121 " $2 " ,
22- { index : 3 , content : [ ] } ,
22+ { index : 3 } ,
2323 ] ) ;
2424 } ) ;
2525
2626 it ( "only allows non-negative integer stop numbers" , ( ) => {
27- expectMatch ( "$0" , [ { index : 0 , content : [ ] } ] ) ;
28- expectMatch ( "$99999" , [ { index : 99999 , content : [ ] } ] ) ;
27+ expectMatch ( "$0" , [ { index : 0 } ] ) ;
28+ expectMatch ( "$99999" , [ { index : 99999 } ] ) ;
2929 expectMatch ( "$-1" , [ "$-1" ] ) ;
3030 expectMatch ( "${-1}" , [ "${-1}" ] ) ;
31- expectMatch ( "$1.5" , [ { index : 1 , content : [ ] } , ".5" ] ) ;
31+ expectMatch ( "$1.5" , [ { index : 1 } , ".5" ] ) ;
3232 expectMatch ( "${1.5}" , [ "${1.5}" ] ) ;
3333 } ) ;
3434
@@ -42,7 +42,7 @@ describe("Snippet Body Parser", () => {
4242 {
4343 index : 1 ,
4444 content : [
45- { index : 2 , content : [ ] } ,
45+ { index : 2 } ,
4646 { variable : "foo" } ,
4747 { index : 3 , choices : [ "a" , "b" ] } ,
4848 ]
@@ -144,7 +144,7 @@ describe("Snippet Body Parser", () => {
144144 } ) ;
145145
146146 it ( "doesn't allow names to start with a number" , ( ) => {
147- expectMatch ( "$1foo" , [ { index : 1 , content : [ ] } , "foo" ] ) ;
147+ expectMatch ( "$1foo" , [ { index : 1 } , "foo" ] ) ;
148148 } ) ;
149149 } ) ;
150150
@@ -156,7 +156,7 @@ describe("Snippet Body Parser", () => {
156156 {
157157 variable : "foo" ,
158158 content : [
159- { index : 2 , content : [ ] } ,
159+ { index : 2 } ,
160160 { variable : "bar" } ,
161161 { index : 3 , choices : [ "a" , "b" ] } ,
162162 ]
@@ -242,7 +242,7 @@ describe("Snippet Body Parser", () => {
242242 expectMatch ( "${1/foo/bar/a}" , [ "${1/foo/bar/a}" ] ) ; // invalid flag
243243 expectMatch ( "${1/fo)o$1/$bar/}" , [
244244 "${1/fo)o" ,
245- { index : 1 , content : [ ] } ,
245+ { index : 1 } ,
246246 "/" ,
247247 { variable : "bar" } ,
248248 "/}"
@@ -433,8 +433,8 @@ describe("Snippet Body Parser", () => {
433433 it ( "accepts the first character as text and resumes" , ( ) => {
434434 expectMatch ( "${1:${2}${3}" , [
435435 "${1:" ,
436- { index : 2 , content : [ ] } ,
437- { index : 3 , content : [ ] }
436+ { index : 2 } ,
437+ { index : 3 }
438438 ] ) ;
439439 } ) ;
440440 } ) ;
@@ -443,7 +443,7 @@ describe("Snippet Body Parser", () => {
443443 it ( "breaks a snippet body into lines, with each line containing tab stops at the appropriate position" , ( ) => {
444444 expectMatch ( "the quick brown $1fox ${2:jumped ${3:over}\n}the ${4:lazy} dog" , [
445445 "the quick brown " ,
446- { index : 1 , content : [ ] } ,
446+ { index : 1 } ,
447447 "fox " ,
448448 {
449449 index : 2 ,
@@ -492,7 +492,7 @@ describe("Snippet Body Parser", () => {
492492 '<' ,
493493 { index : 1 , content : [ 'p' ] } ,
494494 '>' ,
495- { index : 0 , content : [ ] } ,
495+ { index : 0 } ,
496496 '</' ,
497497 { index : 1 , transformation : { find : / f / , replace : [ 'F' ] } } ,
498498 '>' ,
@@ -514,7 +514,7 @@ describe("Snippet Body Parser", () => {
514514 } ,
515515 } ,
516516 ' ' ,
517- { index : 1 , content : [ ] } ,
517+ { index : 1 } ,
518518 ' ' ,
519519 { index : 2 , content : [ 'ANOTHER' ] } ,
520520 ' ' ,
@@ -529,7 +529,7 @@ describe("Snippet Body Parser", () => {
529529 } ,
530530 } ,
531531 ' ' ,
532- { index : 2 , content : [ ] } ,
532+ { index : 2 } ,
533533 ] ) ;
534534 } ) ;
535535
@@ -548,7 +548,7 @@ describe("Snippet Body Parser", () => {
548548 } ,
549549 } ,
550550 '\n' ,
551- { index : 1 , content : [ ] } ,
551+ { index : 1 } ,
552552 ] ) ;
553553 } ) ;
554554
@@ -557,7 +557,7 @@ describe("Snippet Body Parser", () => {
557557 '<' ,
558558 { index : 1 , content : [ 'p' ] } ,
559559 '>' ,
560- { index : 0 , content : [ ] } ,
560+ { index : 0 } ,
561561 '</' ,
562562 {
563563 index : 1 ,
@@ -579,7 +579,7 @@ describe("Snippet Body Parser", () => {
579579 '<' ,
580580 { index : 1 , content : [ 'p' ] } ,
581581 '>' ,
582- { index : 0 , content : [ ] } ,
582+ { index : 0 } ,
583583 '</' ,
584584 {
585585 index : 1 ,
@@ -598,38 +598,38 @@ describe("Snippet Body Parser", () => {
598598
599599 it ( "parses a snippet with a placeholder that mirrors another tab stop's content" , ( ) => {
600600 expectMatch ( "$4console.${3:log}('${2:$1}', $1);$0" , [
601- { index : 4 , content : [ ] } ,
601+ { index : 4 } ,
602602 'console.' ,
603603 { index : 3 , content : [ 'log' ] } ,
604604 '(\'' ,
605605 {
606606 index : 2 , content : [
607- { index : 1 , content : [ ] }
607+ { index : 1 }
608608 ]
609609 } ,
610610 '\', ' ,
611- { index : 1 , content : [ ] } ,
611+ { index : 1 } ,
612612 ');' ,
613- { index : 0 , content : [ ] }
613+ { index : 0 }
614614 ] ) ;
615615 } ) ;
616616
617617 it ( "parses a snippet with a placeholder that mixes text and tab stop references" , ( ) => {
618618 expectMatch ( "$4console.${3:log}('${2:uh $1}', $1);$0" , [
619- { index : 4 , content : [ ] } ,
619+ { index : 4 } ,
620620 'console.' ,
621621 { index : 3 , content : [ 'log' ] } ,
622622 '(\'' ,
623623 {
624624 index : 2 , content : [
625625 'uh ' ,
626- { index : 1 , content : [ ] }
626+ { index : 1 }
627627 ]
628628 } ,
629629 '\', ' ,
630- { index : 1 , content : [ ] } ,
630+ { index : 1 } ,
631631 ');' ,
632- { index : 0 , content : [ ] }
632+ { index : 0 }
633633 ] ) ;
634634 } ) ;
635635 } ) ;
0 commit comments