Open Gabriel-Darbord opened 1 month ago
There is already:
RBClassRegexRefactoring
to rename classes,RBProtocolRegexTransformation
to rename protocols,RBSourceRegexTransformation
to rewrite methods, which can be used for renaming.However they seem to work through scripts only. The new 'Choose method' window in Pharo 13 could be a good base for an interface.
I would like to be able to rename methods and classes in bulk. Methods to be renamed can be selected through the GUI, or by matching a substring/pattern (such as in the 'Choose method' window). A simple approach would be to replace a substring with another.
Later, it would be interesting to enable regex translation:
do(.*?)Using:
->\l$1Using:
\l$1
refers to the first matching group with$1
, where the first letter is converted to lower case with\l
.However the current regex package does not support this syntax, it is only possible using the
String >> #copyWithRegex:matchesTranslatedUsing:
which takes a block, but then you might as well write a script rather than use a refactoring.