[Cuis-dev] Extract Method improvements

Juan Vuletich juan at cuis.st
Sun Jul 23 13:13:25 PDT 2023


Nice!

Cheers,

On 7/20/2023 9:25 AM, Hernán Wilkinson via Cuis-dev wrote:
> 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 Wilkinson
> Agile 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


-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230723/379498e4/attachment.htm>


More information about the Cuis-dev mailing list