You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that it's exclusively used for untyped expansion. The only partial exception to that rule is that insertSnippet expands if untyped and not implicit (eg to distinguish "snip funk" vs "snip funk to this"). We could probably just have all of them require not implicit
My first thought was to just remove it altogether and let the action just run the action itself, but it is necessary to have this construct for two reasons:
For insertSnippet, we want to run the stage before converting to a destination, which has already happened by the time the action sees it
Generally, we want the stage to run on primitive targets, so that eg "funk wrap past air" / "funk wrap air past bat" perform expansion on the primitive targets rather than the final range. If we wait till the action gets the target, it's too late for that
I wonder if we should really just have actions expose a default scope type, and have it default to token. That would then also subsume the step where we run ContainingTokenIfUntypedEmptyStage. The only problem there is that that only runs on empty range, whereas the other ones still want to run for nonempty. Eg if you say "funk wrap this" and you have a nonempty selection, we still expand to containing statement, whereas if you say "take this" and you have a nonempty selection, we don't expand to token. I'd be tempted to unify these behaviours in exchange for a much simplified command pipeline and behaviour that's more consistent / easier to explain. I'd lean towards the token behaviour and only expand if empty.
insertSnippet
expands if untyped and not implicit (eg to distinguish "snip funk" vs "snip funk to this"). We could probably just have all of them require not implicitinsertSnippet
, we want to run the stage before converting to a destination, which has already happened by the time the action sees ittoken
. That would then also subsume the step where we runContainingTokenIfUntypedEmptyStage
. The only problem there is that that only runs on empty range, whereas the other ones still want to run for nonempty. Eg if you say "funk wrap this" and you have a nonempty selection, we still expand to containing statement, whereas if you say "take this" and you have a nonempty selection, we don't expand to token. I'd be tempted to unify these behaviours in exchange for a much simplified command pipeline and behaviour that's more consistent / easier to explain. I'd lean towards the token behaviour and only expand if empty.The text was updated successfully, but these errors were encountered: