@@ -15,7 +15,7 @@ const testData = generateTestData(100);
1515const smallThresholdMs = 100 ;
1616const largeThresholdMs = 500 ;
1717
18- type ModifierType = "previous" ;
18+ type ModifierType = "containing" | " previous" | "every ";
1919
2020suite ( "Performance" , async function ( ) {
2121 endToEndTestSetup ( this ) ;
@@ -59,6 +59,8 @@ suite("Performance", async function () {
5959 // Parse tree based, relative scope
6060 [ "collectionKey" , largeThresholdMs , "previous" ] ,
6161 [ "value" , largeThresholdMs , "previous" ] ,
62+ [ "collectionKey" , largeThresholdMs , "every" ] ,
63+ [ "value" , largeThresholdMs , "every" ] ,
6264 // Text based, but utilizes surrounding pair
6365 [ "boundedParagraph" , largeThresholdMs ] ,
6466 [ "boundedNonWhitespaceSequence" , largeThresholdMs ] ,
@@ -71,6 +73,7 @@ suite("Performance", async function () {
7173 largeThresholdMs ,
7274 "previous" ,
7375 ] ,
76+ [ { type : "surroundingPair" , delimiter : "any" } , largeThresholdMs , "every" ] ,
7477 ] ;
7578
7679 for ( const [ scope , threshold , modifierType ] of fixtures ) {
@@ -98,7 +101,7 @@ async function removeToken(thresholdMs: number) {
98101async function selectScopeType (
99102 scopeType : ScopeType ,
100103 thresholdMs : number ,
101- modifierType ? : ModifierType ,
104+ modifierType : ModifierType = "containing" ,
102105) {
103106 await testPerformance ( thresholdMs , {
104107 name : "setSelection" ,
@@ -111,9 +114,13 @@ async function selectScopeType(
111114
112115function getModifier (
113116 scopeType : ScopeType ,
114- modifierType ? : ModifierType ,
117+ modifierType : ModifierType ,
115118) : Modifier {
116119 switch ( modifierType ) {
120+ case "containing" :
121+ return { type : "containingScope" , scopeType } ;
122+ case "every" :
123+ return { type : "everyScope" , scopeType } ;
117124 case "previous" :
118125 return {
119126 type : "relativeScope" ,
@@ -122,8 +129,6 @@ function getModifier(
122129 length : 1 ,
123130 scopeType,
124131 } ;
125- default :
126- return { type : "containingScope" , scopeType } ;
127132 }
128133}
129134
0 commit comments