[Cuis-dev] Extract Method improvements

Hernán Wilkinson hernan.wilkinson at 10pines.com
Thu Jul 20 05:25:52 PDT 2023


Hi,
 just to let you know that we just pushed two improvements in the Extract
Method refactorings:
1) You can rename a formal argument when it asks you for the selector name.
For example, example if you have this code:
m1
 | a b |
 a := 1.
 b := 2.
 a / b <--- you select this to extract

It will propose as a selector and argument names the following: "m1: a m2:
b"
You can rename the name of the formal arguments, for example to "m1:
dividend m2: divisor". The code will look like this:
m1
 | a b |
 a := 1.
 b := 2.
 self m1: a m2: b

m1: dividend m2: divisor
  ^dividend/divisor

Remember that you can also change #m1: and #m2: to for whatever you need.

2) You can reorder the actual arguments keeping the proposed names. Using
the same example as in 1), it will propose "m1: a m2: b", but you can
change the order of the arguments keeping its names like this: "m1: b m2:
a"
The code will look like this:
m1
 | a b |
 a := 1.
 b := 2.
 self m1: b m2: a

m1: b m2: a
  ^a/b

Reordering and renaming arguments can not be done at the same time, you
either reorder them (keeping the names) or rename them.

I hope you like it!
Thank you Paula for the renaming arguments code :-)

Cheers!
Hernán.

-- 

*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230720/61ed93f4/attachment.htm>


More information about the Cuis-dev mailing list