I have not been able to find a solution to this frustrating problem. Here is the situation and my questions are at the end:
Given code that looks similar to this:
$this->hello()->wootFluent()->patterns();
I want to wrap the whole chain in parens, this could be just parens or maybe another function call. So I start with my cursor, |, at the front:
|$this->hello()->wootFluent()->patterns();
I insert-parentheses with M-(
()|$this->hello()->wootFluent()->patterns();
Then I sp-slurp-hybrid-sexp with C-S-right after moving the cursor within the parens:
($this)->hello()->wootFluent()->patterns();
One more time:
($thishello())->->wootFluent()->patterns();
And now my chain is illegal; fubar.
Is there a way to configure smartparens to include the -> in its slurping? Am I using the right smartparens command for slurping? I would like to make successive slurp commands so that I will end up with a structure like this:
($this->hello()->wootFluent()->patterns());
otherFunction($this->hello()->wootFluent())->patterns();Then I can slurp withC-<right>until I'm happy.