Closed hediet closed 2 years ago
Thanks for the suggestion! I'll think about how to best resolve this with a single refactoring.
It's already possible to achieve the renaming with a refactoring combo:
l
l
I thought more about this and evaluated various ways of achieving this. It turns out you can easily achieve this by using multiple cursors:
this
Since there is a pretty elegant built-in solution, I'm wondering how P42 could improve on this.
This only works if l
is not part of some other word.
Ah, right. One idea I have is a replace expression
code assist where you could select an expression, invoke the action, and then all it's occurrences would be replaced with a text that you'd enter in a text box. Would that be closer to what you imagine?
That would be cool!
I've added a "Select expression occurrences" code action in v1.117.0
. When you select an expression (selection boundaries must match expression), you can invoke the P42 action menu and start a multi-cursor selection on all occurrences:
This is different from the VS Code standard multi-cursor, because it checks that the expression occurrences use the same variables, this
context, etc.
After copy&pasting, I ended up with this code:
Now I would like to replace
l
withthis
. This is not very easy to do.It would be awesome if I could rename
l
tothis
.