@@ -91,7 +91,8 @@ function upgradeModifier(modifier: ModifierV0V1): Modifier[] {
9191}
9292
9393function upgradePrimitiveTarget (
94- target : PartialPrimitiveTargetV0V1
94+ target : PartialPrimitiveTargetV0V1 ,
95+ action : ActionType
9596) : PartialPrimitiveTargetDesc {
9697 const {
9798 type,
@@ -108,12 +109,16 @@ function upgradePrimitiveTarget(
108109 if ( position === "before" ) {
109110 if ( insideOutsideType === "inside" ) {
110111 modifiers . push ( { type : "position" , position : "start" } ) ;
112+ } else if ( action === "remove" ) {
113+ modifiers . push ( { type : "leading" } ) ;
111114 } else {
112115 modifiers . push ( { type : "position" , position : "before" } ) ;
113116 }
114117 } else {
115118 if ( insideOutsideType === "inside" ) {
116119 modifiers . push ( { type : "position" , position : "end" } ) ;
120+ } else if ( action === "remove" ) {
121+ modifiers . push ( { type : "trailing" } ) ;
117122 } else {
118123 modifiers . push ( { type : "position" , position : "after" } ) ;
119124 }
@@ -172,13 +177,13 @@ function upgradeTarget(
172177 return {
173178 type,
174179 rangeType,
175- anchor : upgradePrimitiveTarget ( start ) ,
176- active : upgradePrimitiveTarget ( end ) ,
180+ anchor : upgradePrimitiveTarget ( start , action ) ,
181+ active : upgradePrimitiveTarget ( end , action ) ,
177182 excludeAnchor : excludeStart ?? false ,
178183 excludeActive : excludeEnd ?? false ,
179184 } ;
180185 case "primitive" :
181- return upgradePrimitiveTarget ( target ) ;
186+ return upgradePrimitiveTarget ( target , action ) ;
182187 }
183188}
184189
0 commit comments